Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2907 Visualizzazioni

I want to apply the len(one2many_field) in Search method of ORM. Like this search(..,order = "len(one2many_field)",..) .I want to order the result by finding total number of their children. The one2many field is in the relation to the same table. Presently I am not able to use len() in order.

Example :

 id    name    parent_id
  1     A       - 
  2     B       1 
  3     C       1 
  4     D       - 
  5     E       4

Result :

A
D
Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
set 23
7715
2
mar 23
46792
2
dic 23
57706
0
mar 22
2385
3
giu 20
10690