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

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

django model method

2023-02-09 Thread Chelsea Fan
hello guys, Is it possible to use model method value to ordering model objects in meta class? class Post(models.Model): title = models.CharField(max_length=255, verbose_name="ady") text = RichTextField(verbose_name="text") tagList = models.ManyToManyField(Tag, verbose_name="taglar",