Did you try the orderby fields without the .lower() ?
I don't think you can do that.

On May 4, 2:47 pm, niknok <nikolai...@gmail.com> wrote:
> I'm using v1.94.6 and retrieving ordered search results from crud.search
> always produces a list sorted by id
>
> Tried various combinations:
>
>     orderby=db.auth_user.last_name
>     orderby=db.auth_user.birth_date
>     orderby=db.auth_user.last_name.lower()|db.auth_user.first_name.lower()
>
> Attached is a screenshot with orderby set to last entry above.
>
> The code I use is:
>
> form,rows = crud.search(db.auth_user
>     ,query=(db.auth_user.account_type==0)&(db.auth_user.id!=auth.user.id)
>     ,fields=['id','last_name','first_name','middle_name','birth_date']
>     ,orderby=db.auth_user.last_name.lower()|db.auth_user.first_name.lower()
>     ,queries=['equals','contains','starts with','ends with','greater 
> than','less than'])
>
> Did I miss anything or doing something wrong here?
>
> /r
> Nik
>
>  crud.search-sorting.png
> 103KViewDownload

Reply via email to