Hi everyone,
I'm looking for the proper django way to do an update of an attribute on my
model instance, but only if the attribute current value is checked agains't
a condition, in an atomic way, something like this:
def use_money(self, value):
begin_transaction()
real_money = F('money')
the user's money the sum of all their transactions (credit -
>> debit).
>> You get lesser performance, but you also get history!
>>
>> Maybe you could try (not sure about that):
>>
>> MyModel.objects.filter(money__gte = value, pk = self.pk).update(F...)
&
2 matches
Mail list logo