Robb, On Sat, Aug 22, 2009 at 6:06 PM, Robb Bossley<robb.boss...@gmail.com> wrote: > In the course of writing this program, I have run into a challenge with > regard to the way that things are retrieved and displayed. The problem is > as follows: > > #"var3" is passed in from the following > def Someprog(request, var1, var2, var3) > #My first attempt to handle this > var3 = int(var3) > var4 = var3 - 6 #Subtract six from the value passed in to compare to > another value > #The issue deals with "var4" in this line > Some.object.filter(id = var1).filter(value = > var2).extra(where=['Cost>%s'], params=['var4']) > > I am getting an error from Microsoft SQL server because it doesn't like the > variable being passed - it complains about having to convert this variable > and it cannot (or doesn't want to) > > Any thoughts of another way to pass this integer or make this work?
Is there a reason why you cannot simply do the following? Some.object.filter(id = var1).filter(value = var2).filter(Cost__gt=var4) HTH Matthias -- FeinCMS Django CMS building toolkit: http://spinlock.ch/pub/feincms/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---