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
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):
2 matches
Mail list logo