Code

Changes between Version 95 and Version 96 of RemovingTheMagic


Ignore:
Timestamp:
04/06/06 07:38:06 (8 years ago)
Author:
adrian
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