On 3/3/06, kmh <[EMAIL PROTECTED]> wrote:
Assigning a list implies assigning an order. How about:

book.authors.set([author1, author2])

This doesn't address the problem - what is the 'set' behaviour of the descriptor protocol. The start of the _expression_ has to be 'book.authors ='; the question is what comes next, or what exception should be thrown if we are going to disable the __set__ part of the descriptor protocol.

If ordering is the problem, we could enforce a data type requirement of set():

books.authors = set([author1, author2])

However, I don't like locking it down to a specific data type - very non-pythonic - plus there is the Python 2.3 compatibility issue. Personally, I'd rather allow any iterable, and make a documentation note that order isn't preserved, which is true of all the database operations of the Django ORM anyway.

Russ Magee %-)

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