> Thanks for the reply.
>
> I previously had a look at how QuerySet.none (in
> Django.db.models.query) was implemented, and that didn 't give me any
> clues - hence the post. So I worked it out by looking at http://seanmonstar.com/post/708862164/extending-django-models-manager...
> which explains how QuerySet and manager methods are called through the
> QuerySetManager.
Did you actually read the source code for Manager.none() in /django/db/
manager.py ? I bet not, else you would already have solved your
problem !-)
> __getattr__ will be called prior to throwing an AttributeError to try
> an find a manager method that isn't already implemented by the manager
> **or any of its base classes**. That is, I think it's pulling none
> from the base class implementation.
Don't think, make sure !-)
Now the mere fact I mentionned the implementation of *Manager.none*
(nont "Queryset.None") is an answer in itself.
FWIW, you could have just logged calls to your manager's __getattr__
method, so you would have noticed that it didn't get called for
"none".
> This might not be the most elegant solution. I'll look into the
> Manager implementation as you suggested.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment