Author: simon
Date: 2008-09-02 13:38:55 -0500 (Tue, 02 Sep 2008)
New Revision: 8865
Modified:
django/trunk/docs/releases/1.0-porting-guide.txt
Log:
Fixed spelling typo in porting guide and added __str__ to __unicode__ to the
model example
Modified: django/trunk/docs/releases/1.0-porting-guide.txt
===================================================================
--- django/trunk/docs/releases/1.0-porting-guide.txt 2008-09-02 17:57:18 UTC
(rev 8864)
+++ django/trunk/docs/releases/1.0-porting-guide.txt 2008-09-02 18:38:55 UTC
(rev 8865)
@@ -80,6 +80,9 @@
class Admin:
list_display = ['first_name', 'last_name']
+ def __str__(self):
+ return '%s %s' % (self.first_name, self.last_name)
+
New (1.0) ``models.py``::
class Author(models.Model):
@@ -87,13 +90,16 @@
last_name = models.CharField(max_length=30)
slug = models.CharField(max_length=60)
+ def __unicode__(self):
+ return u'%s %s' % (self.first_name, self.last_name)
+
New (1.0) ``admin.py``::
from django.contrib import admin
from models import Author
class AuthorAdmin(admin.ModelAdmin):
- list_display=['first_name', 'last_name']
+ list_display = ['first_name', 'last_name']
prepopulated_fields = {
'slug': ('first_name', 'last_name')
}
@@ -109,7 +115,7 @@
as been rewritten to use Django's new form-handling library and redesigned with
extensibility and customization in mind.
-Practially, this means you'll need to rewrite all of your ``class Admin``
+Practically, this means you'll need to rewrite all of your ``class Admin``
declarations. You've already seen in `models`_ above how to replace your
``class
Admin`` with a ``admin.site.register()`` call in an ``admin.py`` file. Below
are
some more details on how to rewrite that ``Admin`` declaration into the new
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---