I came to this thread with what might be a similar need. For example,
if I'm writing a time-tracking app, I might have an Entry model.
Whenever I create instances of the model (via the DB API or in views),
I would like to have the "start time" field default to now(), so a user
entering a time sheet item gets the default. Kind of like "auto_now" or
"auto_now_add" for DateField/DateTimeField, except that the user should
be able to alter it. I saw information about overriding save(), but I'd
like the values visible in creation forms (as well as if I create
instances in the shell), and don't want to pollute views with business
logic.

This is just an example. What I think I'm looking for it an idea of
where business logic like that should lie. Other things, like
determining default values for a field based on app context, user,
etc., would all be similar.

H.B.


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to