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
- inspectdb fixer by kriberg 4 years ago
- Extended cacheable callables and properties by gsakkis 2 years, 11 months ago
- DisplayModelForm by koenb 5 years ago
- A small script to rearranging the models generated from inspectdb command by m_tayseer 4 years, 6 months ago
- FlatPageOverrideMiddleware by David 4 years, 5 months ago
Comments