Sorry to dig up an old thread, but I've just created a ticket to bring this functionality into django: https://code.djangoproject.com/ticket/24060
Tim Martin, are you interested in bringing this up to date? The alpha freeze for 1.8 is Jan 12th, and I'd really like to get this ready before then. I'm happy to pick up your work and finish it off if you haven't got the time to do it though. Just thought I'd give you the chance since you've put in the effort. Josh On Wednesday, 18 June 2014 07:51:31 UTC+10, Tim Martin wrote: > > On Monday, 16 June 2014 01:25:45 UTC+1, Josh Smeaton wrote: >> >> Nice work, I think that's a lot better. The only thing that now worries >> me is that order_by doesn't accept sql parameters for some reason. I'm not >> sure how many expressions produce sql_params and if they'd be useful in an >> ordering context. It might be worth looking into that a little more. >> > > Disallowing params was just a conservative default. I can't see any reason > why this can't be made to work. However, I couldn't see any obvious > expressions that would need to use parameters, and I was doubtful that it > would be supported across all backends. > > I guess COALESCE(some_field, %s) could be useful in certain circumstances, > or SUBSTRING(some_field, %s, %s). > > On the cross-platform issue, is the general pattern to allow params > anywhere and just expose the error to the developer if they use an > expression with parameters in a place that doesn't support it on their > backend? I'm fine to follow that if it's the pattern. > > [Support for platform-dependence in function expressions] > >> Perhaps we can start another discussion on the ML so we can address >> these concerns without it being hidden inside this thread? >> > > Sounds good. Do you wan to start a new topic, since you understand the > issue better than I do at the moment? > > Tim > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/aef69cdb-7de6-4526-a33d-a53a4c45ad1f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
