__init__.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:pretalx 作者: pretalx 项目源码 文件源码
def ready(self):
        from pretalx.event.models import Event
        from pretalx.common.tasks import regenerate_css
        from django.db import connection, utils

        if Event._meta.db_table not in connection.introspection.table_names():
            # commands like `compilemessages` execute ready(), but do not
            # require a database to be present. Bail out early, if the Event
            # table has not been created yet.
            return

        try:
            for event in Event.objects.all():
                regenerate_css.apply_async(args=(event.pk,))
        except (utils.OperationalError, utils.ProgrammingError):
            pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号