Ticket #8150: 8150.patch

File 8150.patch, 1.0 KB (added by Matthias Kestenholz, 16 years ago)
  • docs/overview.txt

    diff --git a/docs/overview.txt b/docs/overview.txt
    index dae0ffb..bb224d2 100644
    a b A dynamic admin interface: it's not just scaffolding -- it's the whole house  
    129129
    130130Once your models are defined, Django can automatically create a professional,
    131131production ready administrative interface -- a Web site that lets authenticated
    132 users add, change and delete objects. It's as easy as adding a line of code to
    133 your model classes::
     132users add, change and delete objects. It's as easy as registering your model in
     133the admin interface::
     134
     135    from django.contrib import admin
    134136
    135137    class Article(models.Model):
    136138        pub_date = models.DateTimeField()
    137139        headline = models.CharField(max_length=200)
    138140        content = models.TextField()
    139141        reporter = models.ForeignKey(Reporter)
    140         class Admin: pass
     142
     143    admin.site.register(Article)
    141144
    142145The philosophy here is that your site is edited by a staff, or a client, or
    143146maybe just you -- and you don't want to have to deal with creating backend
Back to Top