On Mon, Jul 11, 2011 at 10:36, Venkatraman S <venka...@gmail.com> wrote: > Raw-sql and the snippet provided by me would end up generating the same sql. > > One advantage of my snippet is, if your db does not support sin/cos > functions(like sqlite3), > then you can go ahead defining funcs which computes the same. Something like.. > from django.db import connection, transaction > cursor = connection.cursor() > import math > connection.connection.create_function('acos', 1, > math.acos) > connection.connection.create_function('cos', 1, > math.cos) > connection.connection.create_function('sin', 1, > math.sin) >
Nice! Didn't know this could be done. Thanks for the update. -- http://about.me/rosh -- 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.