Re: django model method

2023-02-13 Thread Jason
there's alot to not like about the implementation here. You're effectively hiding queries and db hits with those methods, since the naming does not give any indication that its a db hit. So its really easy to forget that, and then after a while, you're wondering why your project is so slow and

Re: django model method

2023-02-10 Thread Gabriel Araya Garcia
Allways there is a way to improve the code, but if that not run, then try with CYTHON Gabriel Araya Garcia GMI - Desarrollo de Sistemas Informáticos El jue, 9 feb 2023 a las 10:09, Andréas Kühne () escribió: > Not if you want it to be fast. Python itself is slow - so you should try > to offl

Re: django model method

2023-02-09 Thread Vitaly Bogomolov
You can look towards Django Q-objects . This filtering method is implemented in the MultiChoiceExt filter of my DjangoAdminFilters lib

Re: django model method

2023-02-09 Thread Andréas Kühne
Not if you want it to be fast. Python itself is slow - so you should try to offload most of the computation on the database. So filtering would need to be done on database fields as well. Otherwise you would need to load all of the rows into memory and then do the filtering there. If you want to

Re: django model method

2023-02-09 Thread Chelsea Fan
understood, is there any way to filter objects by method value? On Thu, Feb 9, 2023 at 4:42 PM Andréas Kühne wrote: > No. > > Ordering works by using the database to order the models. It therefore > needs to be a database field - otherwise the database can't order by the > field? > > Regards, >

Re: django model method

2023-02-09 Thread Andréas Kühne
No. Ordering works by using the database to order the models. It therefore needs to be a database field - otherwise the database can't order by the field? Regards, Andréas Den tors 9 feb. 2023 kl 12:09 skrev Chelsea Fan < allaberdi16yazha...@gmail.com>: > hello guys, Is it possible to use mod