2013-02-25 00:09:13 +01:00
|
|
|
from django.db import models
|
2013-01-29 06:28:09 +01:00
|
|
|
|
2013-02-25 00:09:13 +01:00
|
|
|
# The models definitions below used to crash. Generating models dynamically
|
2013-12-24 12:25:17 +01:00
|
|
|
# at runtime is a bad idea because it pollutes the app registry. This doesn't
|
2013-02-25 00:09:13 +01:00
|
|
|
# integrate well with the test suite but at least it prevents regressions.
|
|
|
|
|
|
|
|
|
|
|
|
class CustomBaseModel(models.base.ModelBase):
|
2013-01-29 06:28:09 +01:00
|
|
|
pass
|
2013-02-25 00:09:13 +01:00
|
|
|
|
|
|
|
|
2017-01-07 12:11:46 +01:00
|
|
|
class MyModel(models.Model, metaclass=CustomBaseModel):
|
|
|
|
"""Model subclass with a custom base using metaclass."""
|