I am trying to configure Django Admin.
models.py ============= class Question(models.Model): poll = models.ForeignKey(Poll) name = models.CharField(max_length=100) pub_date = models.DateTimeField('date published') admin.py =========== class QuestionAdmin(admin.ModelAdmin): list_display = ('name', 'poll'. 'pub_date') inlines = [ChoiceInline] admin.site.register(Question)
This seems to be the right setting to configure QuestionIndex.I want it displayed: What is your question? introPoll July 31, 2009
However, the Question index only displays unicode by default.
Am I missing a step?
What could be the reasons why additional data is not displayed in the index?
You must specify the admin class in the function admin.site.registerif you configured it:
admin.site.register
admin.site.register(Question, QuestionAdmin)
, , , list_display , : ('name', 'poll'. 'pub_date') ('name', 'poll', 'pub_date').
list_display
('name', 'poll'. 'pub_date')
('name', 'poll', 'pub_date')
Source: https://habr.com/ru/post/1714101/More articles:View WPF master part with list and Combobox with binding - data-bindingiteration of object properties - javascriptsIFR 3 Upper case - sifrget url from urloader? - flexWhy use typedef in this template? - c ++A few questions about PHP memcache - phpWhere to write code to draw a square in UITableViewCell on iPhone - iphoneZend_Auth_Adapter using a data converter - zend-frameworkHow to effectively combine two search results? - algorithmUsing the * selector in the stylesheet for styles reset - performanceAll Articles