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


Python pre_migrate.connect方法代码示例

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


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

示例1: ready

# 需要导入模块: from django.db.models.signals import pre_migrate [as 别名]
# 或者: from django.db.models.signals.pre_migrate import connect [as 别名]
def ready(self):
        pre_migrate.connect(inject_rename_contenttypes_operations, sender=self)
        post_migrate.connect(update_contenttypes)
        checks.register(check_generic_foreign_keys, checks.Tags.models) 
开发者ID:KimJangHyeon,项目名称:NarshaTech,代码行数:6,代码来源:apps.py

示例2: ready

# 需要导入模块: from django.db.models.signals import pre_migrate [as 别名]
# 或者: from django.db.models.signals.pre_migrate import connect [as 别名]
def ready(self):
        pre_migrate.connect(inject_rename_contenttypes_operations, sender=self)
        post_migrate.connect(create_contenttypes)
        checks.register(check_generic_foreign_keys, checks.Tags.models) 
开发者ID:prakharchoudhary,项目名称:Scrum,代码行数:6,代码来源:apps.py

示例3: ready

# 需要导入模块: from django.db.models.signals import pre_migrate [as 别名]
# 或者: from django.db.models.signals.pre_migrate import connect [as 别名]
def ready(self):
        from .operations import inject_pre_migration_operations, inject_post_migration_operations

        pre_migrate.connect(inject_pre_migration_operations, sender=self)
        post_migrate.connect(inject_post_migration_operations, sender=self) 
开发者ID:craigds,项目名称:django-mpathy,代码行数:7,代码来源:apps.py

示例4: ready

# 需要导入模块: from django.db.models.signals import pre_migrate [as 别名]
# 或者: from django.db.models.signals.pre_migrate import connect [as 别名]
def ready(self):
        """

        This supports two use cases for using tsvector_field:

        1. Configure your Django project to use tsvecotr_field's DatabaseSchemaEditor
           directly by creating your own DatabaseWrapper and referencing
           tsvector_field.DatabaseSchemaEditor in the SchemaEditorClass attribute.
           See: tsvector_field/schema.py for more info.

        2. Just add `tsvector_field` to your project's INSTALLED_APPS setting and this
           will use the `pre_migrate` mechanism. Note: `pre_migrate` is not fired for
           ./manage.py migrate --run-syncdb. So if you are building apps without migrations
           you will have to use the more reliable approach in option #1.

        """
        from django.db import connection
        from . import DatabaseSchemaEditor
        if not isinstance(connection.schema_editor(), DatabaseSchemaEditor):
            # only register for pre_migrate if we're not already configured
            # with the DatabaseSchemaEditor, see option #1 in doc above
            from django.db.models.signals import pre_migrate
            from .receivers import inject_trigger_operations
            pre_migrate.connect(inject_trigger_operations) 
开发者ID:damoti,项目名称:django-tsvector-field,代码行数:26,代码来源:apps.py

示例5: ready

# 需要导入模块: from django.db.models.signals import pre_migrate [as 别名]
# 或者: from django.db.models.signals.pre_migrate import connect [as 别名]
def ready(self):
        """
        Perform other one-time initialization steps.
        """
        from enterprise.signals import handle_user_post_save
        from django.db.models.signals import pre_migrate, post_save

        post_save.connect(handle_user_post_save, sender=self.auth_user_model, dispatch_uid=USER_POST_SAVE_DISPATCH_UID)
        pre_migrate.connect(self._disconnect_user_post_save_for_migrations) 
开发者ID:edx,项目名称:edx-enterprise,代码行数:11,代码来源:apps.py


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