On Nov 13, 3:36 pm, "Mike Feldmeier" <[EMAIL PROTECTED]> wrote:
> I know, I've seen a million posts about this, but they all seem to relate to
> m2m fields.  While I do have an m2m field in the table (blog entry <->
> tags), it's one of the simple fields I'm having trouble with.
>
>     def save(self):
>
> >         import datetime
> >         if not self.publish_date and self.state == 2:
> >             self.publish_date = datetime.date.today()
> >         return super(BlogEntry, self).save()
>
> This override works when in the shell, but not through the admin interface.
> I am just not understanding why it would fail on this simple field.

You do have a conditional statement there. I would put a couple of
debug prints just before that if statement and one inside the if
statement to see what's going on. May be the condition is not being
satisfied so that self.publish_date is never getting set?


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to