Hi!

>1) What should be the behaviour of __set__ for descriptors where
>multiple values are allowed (ForeignKey, ManyToManyField)?

Allow assignement of any iterator. If people are confused by the fact
that a list has an order and a set doesn't, they will be confused by
the fact of sets themselves, too, so we can't help them anyway ;-)

>2) If a related attribute currently has a value of None, should the
>__get__ method return None, or raise a DoesNotExist if accessed? Does
>this behaviour change if the attribute is set null=True?

Raise DoesNotExist only on never assigned attributes and return None if
the attribute has a None value because of a SQL NULL value in the
database. This might require to keep track of unassigned attributes,
though.

>3) What is to become of the _id fields for ForeignKeys?
>
>The descriptor work has always talked about reporter.id becoming the
>new notation for reporter_id, but reporter_id is still there.

There should only be one way to access the id.

>a) make add()/remove()/clear()/__set__ implicit save points. This
>would have the added bonus of making ForeignKey add() etc mirror
>ManyToMany add() behaviour (since m2m table additions occur
>immediately, where ForeignKey add()'s are not applied until save() on
>the underlying objects)

I would be +1 on this. Especially since transactions are already in
m-r, so we won't have to worry about multiple save points playing havoc
with our database connection. If you do it this way, keep the
transaction management intact on .add()/.remove()/.clear() - currently
only .add()/.delete() do that stuff, because up to now those are the
only save points.

I don't like (-1) cascading, because that might introduce all weird
things (and possibly take up a lot of performance just to "make sure")
when you have a lot of related objects in your model.

bye, Georg


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