Lazy load to avoid AppRegistryNotReady if installed apps import MigrationRecorder.
(cls)
| 23 | |
| 24 | @classproperty |
| 25 | def Migration(cls): |
| 26 | """ |
| 27 | Lazy load to avoid AppRegistryNotReady if installed apps import |
| 28 | MigrationRecorder. |
| 29 | """ |
| 30 | if cls._migration_class is None: |
| 31 | |
| 32 | class Migration(models.Model): |
| 33 | app = models.CharField(max_length=255) |
| 34 | name = models.CharField(max_length=255) |
| 35 | applied = models.DateTimeField(default=now) |
| 36 | |
| 37 | class Meta: |
| 38 | apps = Apps() |
| 39 | app_label = "migrations" |
| 40 | db_table = "django_migrations" |
| 41 | |
| 42 | def __str__(self): |
| 43 | return "Migration %s for %s" % (self.name, self.app) |
| 44 | |
| 45 | cls._migration_class = Migration |
| 46 | return cls._migration_class |
| 47 | |
| 48 | def __init__(self, connection): |
| 49 | self.connection = connection |
no outgoing calls