Author: mtredinnick
Date: 2008-08-26 02:11:14 -0500 (Tue, 26 Aug 2008)
New Revision: 8574
Modified:
django/trunk/docs/intro/overview.txt
Log:
Fixed #8150 -- Updated a reference to creating an admin class in the overview
document. Based on a patch from mk.
Modified: django/trunk/docs/intro/overview.txt
===================================================================
--- django/trunk/docs/intro/overview.txt 2008-08-26 06:58:43 UTC (rev
8573)
+++ django/trunk/docs/intro/overview.txt 2008-08-26 07:11:14 UTC (rev
8574)
@@ -133,16 +133,26 @@
Once your models are defined, Django can automatically create a professional,
production ready :ref:`administrative interface <ref-contrib-admin>` -- a Web
site that lets authenticated users add, change and delete objects. It's as easy
-as adding a line of code to your model classes::
+as registering your model in the admin site::
+ # In models.py...
+
+ from django.db import models
+
class Article(models.Model):
pub_date = models.DateTimeField()
headline = models.CharField(max_length=200)
content = models.TextField()
reporter = models.ForeignKey(Reporter)
- class Admin: pass
+ # In admin.py in the same directory...
+
+ import models
+ from django.contrib import admin
+
+ admin.site.register(models.Article)
+
The philosophy here is that your site is edited by a staff, or a client, or
maybe just you -- and you don't want to have to deal with creating backend
interfaces just to manage content.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---