Hi Omat,

On 8/14/07, omat <[EMAIL PROTECTED]> wrote:
> def save(self):
>     if not self.reftable_id:
>         self.added = datetime.now()
>     super(MyModel, self).save()
>
> where reftable_id is the field that references to the related model.

Is

self.added = models.DateTimeField(auto_now=True)

what you need?
Kai

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

Reply via email to