コード例 #1
0
 def run(self,
         force,
         update,
         materialized_views_check_sql_changed=False,
         **options):
     if super().run(force=force,
                    update=update,
                    materialized_views_check_sql_changed=
                    materialized_views_check_sql_changed):
         all_views_synced.send(sender=None)
コード例 #2
0
    def run(self, force, update, **options):
        backlog = []
        for view_cls in apps.get_models():
            if not (isinstance(view_cls, type) and
                    issubclass(view_cls, View) and
                    hasattr(view_cls, 'sql')):
                continue
            backlog.append(view_cls)
        loop = 0
        while len(backlog) > 0 and loop < 10:
            loop += 1
            backlog = self.run_backlog(backlog, force, update)

        if loop >= 10:
            log.warn('pgviews dependencies hit limit. Check if your model dependencies are correct')
        else:
            all_views_synced.send(sender=None)
コード例 #3
0
ファイル: models.py プロジェクト: mypebble/django-pgviews
    def run(self, force, update, **options):
        self.synced = []
        backlog = []
        for view_cls in apps.get_models():
            if not (isinstance(view_cls, type) and
                    issubclass(view_cls, View) and
                    hasattr(view_cls, 'sql')):
                continue
            backlog.append(view_cls)
        loop = 0
        while len(backlog) > 0 and loop < 10:
            loop += 1
            backlog = self.run_backlog(backlog, force, update)

        if loop >= 10:
            log.warn('pgviews dependencies hit limit. Check if your model dependencies are correct')
        else:
            all_views_synced.send(sender=None)