Re: Why save on attributes is no good?

2009-03-24 Thread Briel
Hi I'm not sure exactly how this work, but. Your problem is how the data is saved and retrieved.If you do self.sm_id after the save(), you will get the id by reference, but when the model itself needs to be saved, it need the data itself, which it hasn't, or something like that Anyways, to get i

Why save on attributes is no good?

2009-03-24 Thread Filip GruszczyƄski
If I create some model like this, it's ok: sm = SomeModel() sm.save() self.sm = sm But if I try to this: self.sm = SomeModel() self.sm.save() Then when I try to save self, OtherModel.save(self), because it wasn't yet saved I receive information, that self.sm id wasn't set (and it can't be null