Re: Weird error like tickets 8892 and 10811

2014-06-25 Thread Lachlan Musicman
ergh. Rookie error. Subtle bug in the Job class - see the save override: def save(self, *args, **kwargs): if not self.slug: self.slug = self.job_number super(Job, self).save(*args, **kwargs) Note that the call to super is only reachedwhen there is no slug. The fix is simple:

Re: Weird error like tickets 8892 and 10811

2014-06-25 Thread Lachlan Musicman
Ok, I now understand why this happens: >>> x == j True >>> j == x True >>> j.findings 'data' >>> x.findings u'' https://docs.djangoproject.com/en/dev/ref/models/instances/#eq "with the same primary key value and the same concrete class are considered equal. " (no docs in 1.6, but I presume that

Weird error like tickets 8892 and 10811

2014-06-25 Thread Lachlan Musicman
I have run up against this bug before: https://code.djangoproject.com/ticket/8892 Recently, it was updated to "duplicate of" https://code.djangoproject.com/ticket/10811 The TL;DR is Sometimes when you have models with O2O or FK you can lose data if the models are saved in the wrong order. I'm