Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How does Django admin determine which fields are shown
- from jobs.models import *
- from django.contrib import admin
- admin.site.register(Country)
- admin.site.register(City)
- class Mymodel(Model)
- field1 = CharField()
- field3 = CharField()
- field3 = CharField()
- def __unicode__(self):
- return self.field1
- >>> Mymodel.objects.get(pk=1)
- "contents of field1 that will show up for all related fields in admin"
- admin.site.register(Country, CountryAdmin)
- admin.site.register(City, CityAdmin)
Add Comment
Please, Sign In to add comment