ManyToManyFields - a double operation to the database?

2010-04-04 Thread Robert
I wonder whether you have to save a record to the database BEFORE you can update a ManyToMany field? I came across a post by Karen Tracey that seems to suggest this. The problem is that I am unable to do so because the ManyToManyField in my model has no default value and this triggers an error wh

Re: ManyToManyFields - a double operation to the database?

2010-04-04 Thread Daniel Roseman
On Apr 4, 11:56 am, Robert wrote: > I wonder whether you have to save a record to the database BEFORE you > can update a ManyToMany field? > > I came across a post by Karen Tracey that seems to suggest this. > > The problem is that I am unable to do so because the ManyToManyField > in my model has

Re: ManyToManyFields - a double operation to the database?

2010-04-04 Thread Robert
Hi, I get OperationalError: (1364, "Field, 'user_id' doesn't have a default value") As I understand, the many-to-many relationship shall be taken care of by a join table.No such table shows up when I run mysql show tables;. I have of course run a syncdb command. All other tables are present. Tha

Re: ManyToManyFields - a double operation to the database?

2010-04-04 Thread Daniel Roseman
On Apr 4, 1:44 pm, Robert wrote: > Hi, > > I get OperationalError: (1364, "Field, 'user_id' doesn't have a > default value") > > As I understand, the many-to-many relationship shall be taken care of > by a join table.No such table shows up when I run mysql show tables;. > I have of course run a sy

Re: ManyToManyFields - a double operation to the database?

2010-04-04 Thread Robert
That's a spot on, DR. I'll try that and I'm sure it will work out. Have an excellent day. R On 4 apr, 15:03, Daniel Roseman wrote: > On Apr 4, 1:44 pm, Robert wrote: > > > Hi, > > > I get OperationalError: (1364, "Field, 'user_id' doesn't have a > > default value") > > > As I understand, the