Code

Changes between Version 24 and Version 25 of DjangoCheatSheet


Ignore:
Timestamp:
06/12/11 03:54:15 (3 years ago)
Author:
simon@…
Comment:

Removed superfluous admin registration note.

Legend:

Unmodified
Added
Removed
Modified
  • DjangoCheatSheet

    v24 v25  
    7373optionally register your model with the administrative interface (if you have the admin enabled under INSTALLED_APPS in settings.py), so you get a CRUD UI for free: 
    7474{{{ 
    75 # In admin.py in the same directory... 
     75# In admin.py in the invoices directory... 
    7676 
    7777import models 
     
    7979 
    8080admin.site.register(models.Ticket) 
    81 }}} 
    82  
    83 ...and tell the admin that Ticket objects have an admin interface. To do this, create a file called admin.py in your invoices directory, and edit it to look like this: 
    84 {{{ 
    85 from invoices.models import Ticket 
    86 from django.contrib import admin 
    87  
    88 admin.site.register(Ticket) 
    8981}}} 
    9082