Changes between Version 35 and Version 36 of RemovingTheMagic
- Timestamp:
- Jan 11, 2006, 12:35:16 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RemovingTheMagic
v35 v36 1 1 = Removing the magic = 2 2 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. 3 The "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 5 These changes will be integrated into the next Django release, 0.92. 4 6 5 7 This document explains the changes in the branch. 6 8 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 11 Play with it! The branch is available via Subversion at http://code.djangoproject.com/svn/django/branches/magic-removal . 8 12 9 13 == Models support properties == … … 190 194 '''Status: Done''' 191 195 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.196 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. 193 197 194 198 {{{ … … 279 283 The {{{class META}}} within models should now be {{{class Meta}}}. The latter is nicer on the eyes. 280 284 285 == Moved admin options to 'class Admin' == 286 287 '''Status: Done''' 288 289 Instead of {{{admin=meta.Admin}}} in the {{{class META}}}, all admin options are in an inner {{{class Admin}}}. 290 291 Old: 292 {{{ 293 #!python 294 class 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 303 New: 304 {{{ 305 #!python 306 class 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 281 313 == get_object_or_404 and get_list_or_404 now take model classes, not modules == 282 314 … … 324 356 }}} 325 357 326 == Move "auth" and "core" models to django.contrib ==358 == Moved "auth" and "core" models to django.contrib == 327 359 328 360 '''Status: Done''' … … 340 372 341 373 * Old: {{{django.models.core.packages}}} 342 * New: {{{django.contrib.contenttypes.models}}} ( Thiswill most likely be removed in the future.)374 * New: {{{django.contrib.contenttypes.models}}} ("Packages" will most likely be removed in the future.) 343 375 344 376 == Moved Session model and middleware from core to django.contrib == … … 359 391 '''Status: Not done yet''' 360 392 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 367 393 == Database lookup API changes == 368 394 … … 371 397 See DescriptorFields, rjwittams' proposal on the API changes. 372 398 373 374 399 == Namespace Simplification == 375 400