On 9/08/2012 7:02am, Lachlan Musicman wrote:
Hola,

I've got a bunch of date dependent data that I will need to analyse as
the years go by. So adding create_date and update_date fields seems
like the thing to do.

I go researching I and I see that there are debates about whether
auto_now_add and auto_now are useful or whether they should be hated.
Plus there are various work arounds offered with various degrees of
DRY.

From what I can see, the admin interface already keeps this data for
each object

I think you might be thinking of the date/times in the admin log or the date_joined and last_login in the user table.

Otherwise you need to include such fields yourself in your own tables. I have been using auto_now_add and auto_now quite happily for some time in all my own tables and I don't hate them. If they are ever dropped, someone will likely contribute a replacement so I'm not going to worry just yet.

(exception: no create_date for data imported via fixtures
apparently).

In an effort to reduce duplicating data, how would I go about getting
at that data from within my model's view?

In the same way as any other data. There is plenty of date-time formatting in Django templates.

Mike


cheers
L.


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

Reply via email to