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