Re: Records doesn't sometimes get upated

2009-09-22 Thread Daniel Roseman
On Sep 22, 9:48 am, Szymon wrote: > On 21 Wrz, 22:47, Javier Guerra wrote: > > > only if you include it in the parameter list: > > Oh, yes. I forget about self in my example, but in function that makes > problem there is of course self in parameter list. I

Re: Records doesn't sometimes get upated

2009-09-22 Thread Szymon
On 21 Wrz, 22:47, Javier Guerra wrote: > only if you include it in the parameter list: Oh, yes. I forget about self in my example, but in function that makes problem there is of course self in parameter list. --~--~-~--~~~---~--~~ You received

Re: Records doesn't sometimes get upated

2009-09-21 Thread Javier Guerra
On Mon, Sep 21, 2009 at 3:29 PM, Szymon wrote: > Isn't "self" refers to existing object? only if you include it in the parameter list: class whatever: def method (self, moreparams...): ... use 'self' instance... -- Javier

Re: Records doesn't sometimes get upated

2009-09-21 Thread Szymon
Yes. self.bar += c self.save() Isn't "self" refers to existing object? On 21 Wrz, 16:18, phoebebright wrote: > The code looks like it only handles the case of adding a new foo > object but your comments refer to "old values".  Are you also > expecting this to work

Re: Records doesn't sometimes get upated

2009-09-21 Thread phoebebright
The code looks like it only handles the case of adding a new foo object but your comments refer to "old values". Are you also expecting this to work for an update? On Sep 21, 7:35 am, Szymon wrote: > Hello, > > I have strange problem. I will give example. I have model: > >

Records doesn't sometimes get upated

2009-09-21 Thread Szymon
Hello, I have strange problem. I will give example. I have model: class foo(models.Model) bar = models.IntegerField() and method in it def add_bar(c): from something.models import bar_log b = bar_log(foo=self, cnt=c) b.save() self.bar += c self.save() ... and now the problem.