Last active
November 7, 2019 19:37
Revisions
-
lovesh renamed this gist
Jul 25, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
lovesh created this gist
Jul 25, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ """ Here models are in different modules and the models.py imports them from different modules like this from model1 import * # or the name of models you want to import from model2 import User or you might write all your models in models.py """ from django.db.models.base import ModelBase from django.contrib import admin import models for model_name in dir(models): model = getattr(models, model_name) if isinstance(model, ModelBase): admin.site.register(model)