Changeset 555
- Timestamp:
- 08/26/05 00:32:30 (3 years ago)
- Files:
-
- django/trunk/docs/tutorial02.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/tutorial02.txt
r549 r555 87 87 Just one thing to do: We need to specify in the ``polls.Poll`` model that Poll 88 88 objects have an admin interface. Edit the ``myproject/apps/polls/models/polls.py`` 89 file and make the following change to add an ``admin`` attribute:: 89 file and make the following change to add an inner ``META`` class with an 90 ``admin`` attribute:: 90 91 91 92 class Poll(meta.Model): 92 93 # ... 93 admin = meta.Admin() 94 class META: 95 admin = meta.Admin() 96 97 The ``class META`` contains all non-field metadata about this model. 94 98 95 99 Now reload the Django admin page to see your changes. Note that you don't have … … 217 221 class Choice(meta.Model): 218 222 # ... 219 admin = meta.Admin() 223 class META: 224 admin = meta.Admin() 220 225 221 226 Now "Choices" is an available option in the Django admin. The "Add choice" form … … 300 305 class Poll(meta.Model): 301 306 # ... 302 admin = meta.Admin( 303 # ... 304 list_display = ('question', 'pub_date'), 305 ) 307 class META: 308 admin = meta.Admin( 309 # ... 310 list_display = ('question', 'pub_date'), 311 ) 306 312 307 313 Just for good measure, let's also include the ``was_published_today`` custom
