Why store it in the database? You might be able to avoid this directly if you use a model method for this attribute.
Continuation wrote: > I'm working on an auction app. > > In an Auction object I store the current_high_bid for that auction. > > When a new_bid comes in, I: > 1) retrieve the current_high_bid field of the Auction object > 2) compare it with the new_bid > 3) if the new bid is higher than current_high_bid, I update > current_high_bid to the value of the new_bid. > > but there's a (slight) chance that between steps (1) and (3) a > different user could've submitted an even higher bid which then become > the current_high_bid. In that case step 3 should not proceed. What can > I do to make sure such a situation does not arise? > > Thanks --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---