Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialcsj
12,678 Points[Django] Question about the admin interface
In the Admin when you create an app and register it in the admin.py, the app's name is shown in blue bar. Like AUTHENTICATION AND AUTHORIZATION. But how do you change that? Like verbose_name for models? Can you use something like verbose_name in admin.py?
Jeff Muday
Treehouse Moderator 28,720 PointsJeff Muday
Treehouse Moderator 28,720 PointsI'm not sure if I understood what you were trying to achieve, but Django has a "proxy model" Meta you can use rather than using "verbose_name".
Take a look here: https://docs.djangoproject.com/en/1.10/topics/db/models/#proxy-models
Here's an example... suppose you had a model named ContactModel (which of course is a fine name, but a little redundant). And you decided you wanted to make it look like a separate model, named Client in the admin interface because it is more "intuitive" for your Django staff. We can therefore, create a class named Client that inherits all of ContactModel -- but use the Meta class property called "proxy"
The Client model looks and acts like ContactModel and uses the exact same table in the database. You, as the programmer, can reference either Client or ContactModel for queries, but they are equivalent. So if you CRUD (CREATE, READ, UPDATE, DELETE) on the ContactModel, you CRUD Client and vice-versa.
so something like:
Here's how you would use it in models.py