Re: how to call user-defined database functions through the Django query syntax?

2011-04-21 Thread Riccardo Vianello
Hi Andrew, On Thu, Apr 21, 2011 at 7:59 AM, Andrew Dalke wrote: > I must say that I looked at the code with some dismay. Not because of > the code, but because it looks like it's a *lot* of work to handle > UDFs. I had hoped it would be much easier. I'm sure the code

Re: how to call user-defined database functions through the Django query syntax?

2011-04-20 Thread Andrew Dalke
Hi Riccardo, > I recently put some spare time on the same problem, trying to extend > the django database API to support the management of chemical > information. Sweet! I must say that I looked at the code with some dismay. Not because of the code, but because it looks like it's a *lot* of

Re: how to call user-defined database functions through the Django query syntax?

2011-04-20 Thread Riccardo Vianello
Hi Andrew, On Wed, Apr 20, 2011 at 5:18 PM, Andrew Dalke wrote: > I'm using MySQL and sometimes SQLite as the backend database. Both > databases let me add user-defined functions. I've made a set of UDFs > specific to my problem domain, which is chemsitry. > > How do I

Re: how to call user-defined database functions through the Django query syntax?

2011-04-20 Thread Andrew Dalke
Hi Ian, On Apr 20, 5:33 pm, Ian Clelland wrote: > It sounds like you could do this with a QuerySet.extra() call > (http://docs.djangoproject.com/en/1.3/ref/models/querysets/#extra) > > You could do something like: > myModel.objects.filter(title__icontains="test").extra( >

Re: how to call user-defined database functions through the Django query syntax?

2011-04-20 Thread Ian Clelland
On Wed, Apr 20, 2011 at 8:18 AM, Andrew Dalke wrote: > I'm using MySQL and sometimes SQLite as the backend database. Both > databases let me add user-defined functions. I've made a set of UDFs > specific to my problem domain, which is chemsitry. > > How do I call them from

how to call user-defined database functions through the Django query syntax?

2011-04-20 Thread Andrew Dalke
I'm using MySQL and sometimes SQLite as the backend database. Both databases let me add user-defined functions. I've made a set of UDFs specific to my problem domain, which is chemsitry. How do I call them from a database query? Currently I'm using a raw() call, which made for some rather ugly