1 2 3 4 5 6 7 | #Put this in yourproject/yourtestapp/models.py
from django.core.management import inspectdb
code = "\n".join(inspectdb())
code = code.replace(" class Meta:", " class Admin: pass\n class Meta:")
exec code in globals()
|
More like this
- Save a model using an arbitrary db connection by weswinham 2 years, 8 months ago
- Custom 'save' method, automate creating pdf file from entry. by I159 8 months ago
- PowerDNS models by diverman 2 years, 12 months ago
- Models with database views by diverman 2 years, 11 months ago
- Unittest: Compare max_size with column size of database by guettli 3 years, 9 months ago
Comments