I wrote an article here 
http://www.ryankaskel.com/2009/09/09/model-development-tips-for-django-projects/
describing a useful case (or rather a useful set up for many potential
cases) using abstract base models that implements this:

# Abstract models used by various application specific models

from django.db import models

class CommonAbstractModel(models.Model):
    added = models.DateTimeField(auto_now_add=True)
    modified = models.DateTimeField(auto_now=True)
    active = models.BooleanField(default=True)

    class Meta:
        abstract = True

The documentation still says these attributes are fine to use yet
respected Django develop James Bennett and Jacob (coBDFL) have both
stated comments to the effect that these attributes should never be
used (the former here: 
http://www.b-list.org/weblog/2006/nov/02/django-tips-auto-populated-fields/,
and the latter here: http://code.djangoproject.com/ticket/1056 -- a 4
year old ticket last updated two years ago). In the code it says that
using these attributes is a hack. Another blogger wrote here that
http://benspaulding.com/weblog/2008/aug/02/auto_now_add-evil/ that
auto_now_add is evil and it links to James's blog.

Now the newforms-admin was added within a year of that last referenced
blog post and in that case the auto_now_add failed during his admin
hacking experience. Does newforms-admin change the status of
auto_now_add and auto_now as being evil? The code itself doesn't look
evil?

I'm trying to give advice to people but I can't even figure it out
myself (even though it works for me just fine -- so far?).

Developer in distress,
Ryan Kaskel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to