Re: filtering on a model method

2011-12-06 Thread kenneth gonsalves
On Tue, 2011-12-06 at 13:04 +, Tom Evans wrote: > > say I have a model method like get_age(self), can I filter on this? > > > > Mymodel.objects.filter(get_age() = 5) (this does not work, but any > ideas > > would be appreciated) > > You can't do this. Querysets are interfaces to the database,

Re: filtering on a model method

2011-12-06 Thread Tom Evans
On Tue, Dec 6, 2011 at 7:09 AM, kenneth gonsalves wrote: > hi, > > say I have a model method like get_age(self), can I filter on this? > > Mymodel.objects.filter(get_age() = 5) (this does not work, but any ideas > would be appreciated) You can't do this. Querysets are interfaces to the database,

filtering on a model method

2011-12-06 Thread kenneth gonsalves
hi, say I have a model method like get_age(self), can I filter on this? Mymodel.objects.filter(get_age() = 5) (this does not work, but any ideas would be appreciated) -- regards Kenneth Gonsalves -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Goog