On 10 May 2008, at 14:47, Sebastian Noack wrote: > You can still do model.objects.update(foo=42) with my patch, because > of 42 is casted to a LiteralExpr under the hood. I could even make it > possible to do model.objects.update(foo=CurrentExpr() + 42). But there > is no way to enable model.objects.update(foo=42 + CurrentExpr()), > because of in this case int.__add__ instead of Expression.__add__ is > called, so I decided to introduce LiteralExpr. But I agree that it > would be cool, if you could use a literal as it is.
You can handle this case by defining Expression.__radd__ (see http://docs.python.org/ref/numeric-types.html) -- Sean --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@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-developers?hl=en -~----------~----~----~----~------~----~------~--~---