On 3/3/06, Luke Plant <[EMAIL PROTECTED]> wrote:

fields.  For ManyToMany, you do:
  book.author.add(author1, author2...)

I guess it would be good if the __set__ descriptor was there, and either
did the right thing or threw some exception.

I've been working with the descriptor protocol on RelatedManager objects recently; I have added a __set__ for single object descriptors so you can do choice.poll = p. I can see the merit in finishing the descriptor protocol for all m2m objects. So:

book.authors = [author1, author2]
would be equivalent to
book.author.clear(); book.author.add(author1, author2)

We could possibly do a similar thing with __delete__, but I'm not sure that the interpretation is quite as clear (does it map to delete() on all QuerySets, or to clear(), but only on m2m RelatedManagers?)

Opinions?

Russ %-)



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to