summaryrefslogtreecommitdiff
path: root/tests/base/models.py
blob: b179878704e06842fca11d322a7046b25d9df354 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from django.db import models


# The models definitions below used to crash. Generating models dynamically
# at runtime is a bad idea because it pollutes the app registry. This doesn't
# integrate well with the test suite but at least it prevents regressions.


class CustomBaseModel(models.base.ModelBase):
    pass


class MyModel(models.Model, metaclass=CustomBaseModel):
    """Model subclass with a custom base using metaclass."""