Ticket #8150: 8150.overview-doc.diff

File 8150.overview-doc.diff, 1.2 KB (added by Julien Phalip, 16 years ago)

Same patch as mk's, but against the refactored doc

  • django/django/docs/intro/overview.txt

     
    132132
    133133Once your models are defined, Django can automatically create a professional,
    134134production ready :ref:`administrative interface <ref-contrib-admin>` -- a Web
    135 site that lets authenticated users add, change and delete objects. It's as easy
    136 as adding a line of code to your model classes::
     135site that lets authenticated users add, change and delete objects. It's as
     136easy as registering your model in the admin site::
    137137
     138    from django.contrib import admin
     139
    138140    class Article(models.Model):
    139141        pub_date = models.DateTimeField()
    140142        headline = models.CharField(max_length=200)
    141143        content = models.TextField()
    142144        reporter = models.ForeignKey(Reporter)
    143145       
    144         class Admin: pass
     146    admin.site.register(Article)
    145147
    146148The philosophy here is that your site is edited by a staff, or a client, or
    147149maybe just you -- and you don't want to have to deal with creating backend
Back to Top