Re: Problem with creating a one-to-one instance

2013-04-25 Thread Carsten Fuchs
Hi Tom, Am 2013-04-25 18:53, schrieb Tom Evans: Yes, this is correct, when you assign an object to a foreign key, it must already be saved so that it has an id in order to persist in the database. It's very good to hear this, thank you very much for your reply! In 1.4, the check is not prese

Re: Problem with creating a one-to-one instance

2013-04-25 Thread Tom Evans
On Thu, Apr 25, 2013 at 4:55 PM, Carsten Fuchs wrote: > Hi all, > […] > In the example that works (in my original mail, not quoted here), when the > assignment is done, the Vorblendplan instance already has an id, so that it > is properly carried into ma.vbp_id. > > Can someone confirm this, is my

Re: Problem with creating a one-to-one instance

2013-04-25 Thread Carsten Fuchs
Hi all, Am 16.04.2013 17:50, schrieb Carsten Fuchs: I'm probably overlooking something very simple, but still cannot explain what the code below does wrong: [...] >>> ma = Mitarbeiter.objects.get(key="F426") >>> ma.vbp # ok, initially "None" >>> ma.vbp = Vorb

Problem with creating a one-to-one instance

2013-04-16 Thread Carsten Fuchs
Hi all, I'm probably overlooking something very simple, but still cannot explain what the code below does wrong: With these models: class Vorblendplan(models.Model): # ... pass class Mitarbeiter(models.Model): # ... vbp = models.OneToOneField(Vorblendp