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