Changes between Version 74 and Version 75 of IrcFAQ


Ignore:
Timestamp:
May 4, 2008, 1:58:06 PM (17 years ago)
Author:
Paul Bissex
Comment:

updated model inheritance blurb

Legend:

Unmodified
Added
Removed
Modified
  • IrcFAQ

    v74 v75  
    8484= How to do Stuff = #HowTo
    8585
    86 == How do I extend a model? I want to subclass django.contrib.auth.models.User. == #ModelSubclassing
    87 
    88 This feature has been added to the queryset-refactoring branch, but it is not available in either the trunk or a numbered release yet. Specific instructions for the User model can be found at http://www.b-list.org/weblog/2007/02/20/about-model-subclassing and http://www.djangobook.com/en/beta/chapter12/#cn226
     86== How do I create a subclass of an existing model? == #ModelInheritance
     87
     88Model inheritance (aka model subclassing) is available in Django trunk as of r7477.
     89
     90If you're using it, make sure you've [http://www.djangoproject.com/documentation/model-api/#model-inheritance read the documentation] and understand the difference between '''abstract base class''' and '''multi-table''' inheritance options. The latter can be confusing to newcomers because an instance of a parent class will also contain, on an attribute named after a child class, that same object represented as an instance of the child class. Got that?
     91
     92An established mechanism for adding additional information to Django `User` objects without subclassing is known as  "profiles"; you can [http://www.djangobook.com/en/1.0/chapter12/#s-profiles read about it in the Definitive Guide].
     93
     94For an important alternatve viewpoint on model subclassing, see: http://www.b-list.org/weblog/2007/02/20/about-model-subclassing
    8995
    9096== I think Ajax is awesome! How do I do Ajax with Django? == #Ajax
Back to Top