On 10/30/07, cjl <[EMAIL PROTECTED]> wrote:
> > def save(self):
> >     self.account.current_balance += self.amount
> >     self.account.save()
> >     super(Transaction, self).save()
>
> That did the trick, thank you.

I'm glad to hear that. On second thought, though, you might want to
move self.account.save() to the line AFTER super(Transaction,
self).save(). This would make sure that the account balance is only
updated if the transaction saved properly. As it stands, if anything
goes wrong saving the transaction, the account balance would already
be updated, so there'd be a discrepancy.

-Gul

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to