當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。