Changes between Version 35 and Version 36 of RemovingTheMagic


Ignore:
Timestamp:
Jan 11, 2006, 12:35:16 PM (19 years ago)
Author:
Adrian Holovaty
Comment:

Couple of rewordings

Legend:

Unmodified
Added
Removed
Modified
  • RemovingTheMagic

    v35 v36  
    11= Removing the magic =
    22
    3 The "magic-removal" branch aims to make several sweeping changes to the Django codebase. Most changes involve the database API and removing some of its unneeded magic, which confuses newbies and is a bit of a wart.
     3The "magic-removal" branch aims to make several sweeping changes to the Django codebase, removing warts that Django has accumulated over the years. Most changes involve the database API and removing some of its unneeded magic, and other changes involve improving the framework's simplicity and usability.
     4
     5These changes will be integrated into the next Django release, 0.92.
    46
    57This document explains the changes in the branch.
    68
    7 These changes will be integrated into the next Django release (either 0.91 or 0.92, depending on whether we decide to release a 0.91 as a "middle" release for people who want new features currently in trunk but don't want to wait for magic-removal).
     9== How to get the branch ==
     10
     11Play with it! The branch is available via Subversion at http://code.djangoproject.com/svn/django/branches/magic-removal .
    812
    913== Models support properties ==
     
    190194'''Status: Done'''
    191195
    192 You can override any table-level functions, such as {{{get_list()}}} or {{{get_object()}}}. Do this by creating a custom {{{models.Manager}}} subclass and passing it to your model. The term "manager" could be replaced with some other word.
     196You can override any table-level functions, such as {{{get_list()}}} or {{{get_object()}}}. Do this by creating a custom {{{models.Manager}}} subclass and passing it to your model.
    193197
    194198{{{
     
    279283The {{{class META}}} within models should now be {{{class Meta}}}. The latter is nicer on the eyes.
    280284
     285== Moved admin options to 'class Admin' ==
     286
     287'''Status: Done'''
     288
     289Instead of {{{admin=meta.Admin}}} in the {{{class META}}}, all admin options are in an inner {{{class Admin}}}.
     290
     291Old:
     292{{{
     293#!python
     294class Person(meta.Model):
     295    first_name = meta.CharField(maxlength=30)
     296    last_name = meta.CharField(maxlength=30)
     297    class META:
     298        admin = meta.Admin(
     299            list_display = ('first_name', 'last_name')
     300        )
     301}}}
     302
     303New:
     304{{{
     305#!python
     306class Person(models.Model):
     307    first_name = models.CharField(maxlength=30)
     308    last_name = models.CharField(maxlength=30)
     309    class Admin:
     310        list_display = ('first_name', 'last_name')
     311}}}
     312
    281313== get_object_or_404 and get_list_or_404 now take model classes, not modules ==
    282314
     
    324356}}}
    325357
    326 == Move "auth" and "core" models to django.contrib ==
     358== Moved "auth" and "core" models to django.contrib ==
    327359
    328360'''Status: Done'''
     
    340372
    341373 * Old: {{{django.models.core.packages}}}
    342  * New: {{{django.contrib.contenttypes.models}}} (This will most likely be removed in the future.)
     374 * New: {{{django.contrib.contenttypes.models}}} ("Packages" will most likely be removed in the future.)
    343375
    344376== Moved Session model and middleware from core to django.contrib ==
     
    359391'''Status: Not done yet'''
    360392
    361 == Move admin options to 'class Admin' ==
    362 
    363 '''Status: Done in [1864]'''
    364 
    365 Instead of {{{admin=meta.Admin}}} in the {{{class META}}}, we'll move all admin options into an inner {{{class Admin}}}.
    366 
    367393== Database lookup API changes ==
    368394
     
    371397See DescriptorFields, rjwittams' proposal on the API changes.
    372398
    373 
    374399== Namespace Simplification ==
    375400
Back to Top