Hi, I've looked at the svn and I don't quite understand what's wrong with auto_now or auto_now_add. Can you see a problem with it? http://code.djangoproject.com/browser/django/trunk/django/db/models/fields/__init__.py#L453
On Sep 10, 10:35 am, Ryan K <ryankas...@gmail.com> wrote: > I wrote an article > herehttp://www.ryankaskel.com/2009/09/09/model-development-tips-for-djang... > 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-f..., > 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 > thathttp://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 -~----------~----~----~----~------~----~------~--~---