Re: filtering based on property

2007-09-16 Thread Doug B
Not without a little work, atleast as far as I know. A custom manger is what you want. Then you could do something like model.current.filter(otherstuff) or make an extra method on the manager and chain model.objects.is_current().filter(otherstuff) class CustManager(models.Manager): def is_c

filtering based on property

2007-09-16 Thread cesco
Hi, is it possible to do filtering based on a method or a property of the model? Say I have a model with a from_date field and a to_date field and a method, defined within the model, which checks if the model instance is current, that is: from datetime import date @property def is_current(self):