On 1/30/06, Luke Plant <[EMAIL PROTECTED]> wrote:
> I attempted something like this first time (I think you mean it would
> return a version with caching *enabled* each time, right?), but removed
> it again.  I wasn't sure how it would interact with things like
> _default_manager, and also if you create custom managers based on the
> the default one, Article.objects.  I don't know enough about whether
> creating the managers performance-wise either - funny things go on with
> events - maybe Adrian could advise on that.
>
> Luke

Er, I meant the property would return a query object with the cache
reset.  The best way to do it would be to have the metaclass move the
given manager to something like "__manager__", and then the property
would do:

def get_manager(self):
    q = self.__manager__.filter()
    return q

It's surely hacky, but I think it needs to be to match the proposed
functionality.

Reply via email to