On Thu, Oct 22, 2009 at 14:12, Eoghan Murray <[email protected]> wrote:

> I'd like to express an advanced order_by clause (not just a column).
> At the moment I have:
>
>   OneToMany('OtherTable', order_by='field1')
>
> I'd like to be able to put in an sql function (in this case a postgres
> function) in the order_by clause, e.g.:
>
>   OneToMany('OtherTable', order_by="position(' ' in field1)")
>
> However the elixir order_by expects column names.
>
> What would be the easiest way around this?

You might be able to do the sort in python (wrap the relation in a
property) but, depending on the size of the dataset, that might be too
slow...
I don't think there is any other option currently (except, of course,
moving away from Elixir to "declarative" or even "raw" SQLAlchemy).

Could you add a ticket for this in our trac?

-- 
Gaëtan de Menten
http://openhex.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to