Re: custom managers and FOO_set

2008-01-25 Thread Eric Abrahamsen
> Try changing that to: > entries = self.filter(dispDate__lte=now).filter(isOpen=True) Perfect, thanks a lot Rajesh. I guess I hadn't picked up that the super() call was only being used when extending the original get_query_set() method. Eric --~--~-~--~~~---~--~~

Re: custom managers and FOO_set

2008-01-25 Thread Rajesh Dhawan
On Jan 24, 9:54 pm, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > > Can you include the code for your CustomManager.open() method? > > class OpenEntries(models.Manager): > def open(self): > now = datetime.now() > entries = super(OpenEntries, > self).get_query_set().filter(dispDa

Re: custom managers and FOO_set

2008-01-24 Thread Eric Abrahamsen
> Can you include the code for your CustomManager.open() method? class OpenEntries(models.Manager): def open(self): now = datetime.now() entries = super(OpenEntries, self).get_query_set().filter(dispDate__lte=now).filter(isOpen=True) return entries datetime is importe

Re: custom managers and FOO_set

2008-01-24 Thread Rajesh Dhawan
Hi Eric, > Is this possible, or should I just add a layer of filtering? And can > someone tell me where in the source code all this is going on? I tried > tracing the progress of the query set manager myself, to very little > avail. Can you include the code for your CustomManager.open() method?

custom managers and FOO_set

2008-01-24 Thread Eric Abrahamsen
I thought I had understood this, but I guess not... I've got a simple multi-user blog setup, where blog entries might have a future publish date, or be marked "don't publish", in which case I don't want them coming out on the site. I've done this by replacing the 'objects' manager with a custom m