Changes between Version 95 and Version 96 of RemovingTheMagic


Ignore:
Timestamp:
Apr 6, 2006, 9:38:06 AM (19 years ago)
Author:
Adrian Holovaty
Comment:

Added note to 'class Admin' section

Legend:

Unmodified
Added
Removed
Modified
  • RemovingTheMagic

    v95 v96  
    288288    class Admin:
    289289        list_display = ('first_name', 'last_name')
     290}}}
     291
     292If you're using the admin interface but aren't specifying any admin options, just put a {{{pass}}} in that inner class.
     293
     294Old:
     295{{{
     296#!python
     297class Person(meta.Model):
     298    first_name = meta.CharField(maxlength=30)
     299    last_name = meta.CharField(maxlength=30)
     300    class META:
     301        admin = meta.Admin()
     302}}}
     303
     304New:
     305{{{
     306#!python
     307class Person(models.Model):
     308    first_name = models.CharField(maxlength=30)
     309    last_name = models.CharField(maxlength=30)
     310    class Admin:
     311        pass
    290312}}}
    291313
Back to Top