True. But surprisingly enough, the `create` method is a QuerySet
instance method. And it doesn't use any of the filtering, so

    Article.objects.filter(category=cat).create(title=title,
content=content)

doesn't do what you'd expect. (Though `cat.article_set.create` should
work.) Has that actually confused anyone?

-Ken


On Jun 16, 2:57 pm, Johannes Dollinger
<[EMAIL PROTECTED]> wrote:
> > So then what is the difference between a Manager and a QuerySet?
>
> > Nearly everything would work identically if Manager were simply:
>
> > class Manager(QuerySet):
> >     pass
>
> > (except actually keeping the magic that connects it to the model
> > class.)
>
> Utility methods in managers wouldn't make much sense if Manager was a  
> QuerySet:
>
> User.objects.filter(username='foo').create_user('bar',  
> '[EMAIL PROTECTED]')
>
> Although those utilities could as well be class methods.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to