Re: Why doesn't saving a related model update the _id field?

2014-06-10 Thread Tom Evans
On Tue, Jun 10, 2014 at 12:25 PM, Malcolm Box wrote: > On Monday, 9 June 2014 03:08:21 UTC+1, Russell Keith-Magee wrote: >> >> >> On Sun, Jun 8, 2014 at 10:34 PM, Malcolm Box wrote: >>> >>> I'm confused by Django's behaviour when saving related models.

Re: Why doesn't saving a related model update the _id field?

2014-06-10 Thread Malcolm Box
On Monday, 9 June 2014 03:08:21 UTC+1, Russell Keith-Magee wrote: > > On Sun, Jun 8, 2014 at 10:34 PM, Malcolm Box > wrote: > >> I'm confused by Django's behaviour when saving related models. Take for >> example: >> >> I kind of understand this, but it's not obvious to

Re: Why doesn't saving a related model update the _id field?

2014-06-08 Thread Russell Keith-Magee
On Sun, Jun 8, 2014 at 10:34 PM, Malcolm Box wrote: > I'm confused by Django's behaviour when saving related models. Take for > example: > > class X(models.Model): > pass > > class Y(models.Model): >x = models.ForeignKey(X) > > Now if I create some objects

Why doesn't saving a related model update the _id field?

2014-06-08 Thread Malcolm Box
I'm confused by Django's behaviour when saving related models. Take for example: class X(models.Model): pass class Y(models.Model): x = models.ForeignKey(X) Now if I create some objects (unsaved): x = X() y = Y(x=x) All well so far. But now odd things happen when I save: A) y.save()