On 19/07/10 13:06 +0300, Elver Loho wrote:
> Hi,
> 
> I came across an odd error message and figured out what was causing
> it. The cause turned out to be weird enough to make me write this
> e-mail and ask if this is intended behavior or not.
> 
> Turns out that if you have two objects (let's say Car and Owner) with
> the Car having a Many2One relationship with the Owner.
> The Owner has a "name" field, which is a fields.Function for good reasons.
> The Car's __init__ also has this line: self._order.insert(0, ('owner', 'ASC'))

This is the expected behavior. You can not sort on Function field except if
you define an order_field.
The order_field is a string that will be use in the SQL query for the order
statement.

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/

Attachment: pgpnWoG1OtbAk.pgp
Description: PGP signature

Reply via email to