Hello,
I'd rather check for self.pk as you can use primary_key argument on a
field whatever is its name.
Regards,
--
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 unsubscr
On 13 March 2011 00:40, Julian Hodgson wrote:
> I need to set up some default values on a ManyToMany field only when a model
> is first created.
>
> How can I find out in the save() override if the object is being created for
> the first time?
>
> Do I check the table for rows which have self.id o
I need to set up some default values on a ManyToMany field only when a model
is first created.
How can I find out in the save() override if the object is being created for
the first time?
Do I check the table for rows which have self.id or is this not defined till
after the save?
Julian
--
You
3 matches
Mail list logo