Re: Initial save()

2011-03-12 Thread werefr0g
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

Re: Initial save()

2011-03-12 Thread rebus_
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

Initial save()

2011-03-12 Thread Julian Hodgson
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