On Thu, Jun 4, 2009 at 3:25 PM, Luc Saffre <luc.saf...@gmx.net> wrote:
> > On 4.06.2009 19:46, Karen Tracey wrote: > > Well the problems the test reveal with the in-memory Journal instance > > having a stale lastnum after documents are deleted is a bit of a gotcha > > with they way you have set this up. Though it's easily fixed in the > > test, I fear actual code that uses these models would easily run afoul > > of the same problem. > > Thanks, Karen, for your explanations. Now I understood the problem. Yes, > the other errors produced by this example were of course due to the same > mistake. > > But what can I do to avoid this gotcha? Is there a better way to set > this up? > My first thought would be to not store that value in a model at all, but rather pull it from the DB as max of the appropriate column when needed. Karen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---