Re: Accessing Models After get_model()

2014-12-26 Thread llanitedave
On Monday, December 22, 2014 7:51:58 PM UTC-8, Collin Anderson wrote: > > Hi, > > The model name is hidden in model.__name__ or model._meta.model_name, and > you can't access attributes starting with underscore in templates. > > This might work: > > from django.db.models import get_app, get_model

Re: Accessing Models After get_model()

2014-12-22 Thread Collin Anderson
Hi, The model name is hidden in model.__name__ or model._meta.model_name, and you can't access attributes starting with underscore in templates. This might work: from django.db.models import get_app, get_models def index(request): app = get_app('sampledb') modeldict = {model._meta.mod

Re: Accessing Models After get_model()

2014-12-21 Thread Mike Dewhirst
Have you enabled admindocs? Might be the solution you are looking for. Connected by Motorola llanitedave wrote: >I'm trying to display a list of the models in my app on a web page, similar to >the way the Django Admin does it.  I'm not sure where the admin section is >coded, which might be

Accessing Models After get_model()

2014-12-21 Thread llanitedave
I'm trying to display a list of the models in my app on a web page, similar to the way the Django Admin does it. I'm not sure where the admin section is coded, which might be part of my problem. I'm using Django 1.7, and have built a very simple view: from django.db.models import get_app, get_