当前位置: 首页>>代码示例>>Python>>正文


Python Migrations._clear_cache方法代码示例

本文整理汇总了Python中south.migration.base.Migrations._clear_cache方法的典型用法代码示例。如果您正苦于以下问题:Python Migrations._clear_cache方法的具体用法?Python Migrations._clear_cache怎么用?Python Migrations._clear_cache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在south.migration.base.Migrations的用法示例。


在下文中一共展示了Migrations._clear_cache方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _clear_south_cache

# 需要导入模块: from south.migration.base import Migrations [as 别名]
# 或者: from south.migration.base.Migrations import _clear_cache [as 别名]
 def _clear_south_cache(self):
     for mig in list(migration.all_migrations()):
         try:
             delattr(mig._application, "migrations")
         except AttributeError:
             pass
     Migrations._clear_cache()
开发者ID:SocialSchools,项目名称:django-tenant-schemas,代码行数:9,代码来源:migrate_schemas.py

示例2: _clear_south_cache

# 需要导入模块: from south.migration.base import Migrations [as 别名]
# 或者: from south.migration.base.Migrations import _clear_cache [as 别名]
 def _clear_south_cache(self):
     for mig in list(migration.all_migrations()):
         delattr(mig._application, "migrations")
     Migrations._clear_cache()
     for mig in list(migration.all_migrations()):
         for m in mig:
             m.calculate_dependencies()
         mig._dependencies_done = False
开发者ID:Jafula,项目名称:django-tenant-schemas,代码行数:10,代码来源:migrate_schemas.py

示例3: create_models

# 需要导入模块: from south.migration.base import Migrations [as 别名]
# 或者: from south.migration.base.Migrations import _clear_cache [as 别名]
    def create_models(self):
        models_cache.app_models[settings.DYNAMIC_MODELS_APP] = SortedDict()
        for model_name, model_info in self.models_settings.iteritems():
            m_name = "".join([s.capitalize() for s in str(model_name).split('_')])
            class Meta:
                pass

            setattr(Meta, 'app_label', settings.DYNAMIC_MODELS_APP)
            setattr(Meta, 'verbose_name', model_info['title'])
            setattr(Meta, 'verbose_name_plural', model_info['title'])
            
            fields = self._create_model_fields(model_info['fields'])
            fields['Meta'] = Meta
            fields['__module__'] = settings.DYNAMIC_MODELS_APP + '.models'

            cls = type(m_name, (models.Model, ), fields)

            try:
                admin.site.register(cls)
            except AlreadyRegistered:
                pass

        try:
            try:
                try:
                    Migrations(settings.DYNAMIC_MODELS_APP)
                    management.call_command('schemamigration', settings.DYNAMIC_MODELS_APP, auto=True)
                except NoMigrations:
                    management.call_command('schemamigration', settings.DYNAMIC_MODELS_APP, initial=True)
            except (SystemExit, Exception):
                pass
            Migrations._clear_cache()
            try:
                management.call_command('migrate', settings.DYNAMIC_MODELS_APP)
            except SystemExit:
                pass
        except Exception:
            pass
开发者ID:GeyseR,项目名称:dynamic_models,代码行数:40,代码来源:parsers.py

示例4: _clear_south_cache

# 需要导入模块: from south.migration.base import Migrations [as 别名]
# 或者: from south.migration.base.Migrations import _clear_cache [as 别名]
 def _clear_south_cache(self):
     for mig in list(migration.all_migrations()):
         delattr(mig._application, "migrations")
     Migrations._clear_cache()
开发者ID:davinirjr,项目名称:django-tenant-schemas,代码行数:6,代码来源:migrate_schemas.py


注:本文中的south.migration.base.Migrations._clear_cache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。