On 7.02.2010 3:06, Luke Plant wrote:
> 1. ForeignKey fields are different from simple values, in that they  
> cause database lookups (the only logical exception being nullable 
> foreign keys with a PK of None), so it's reasonable for them to behave 
> differently.

Luke, I disagree with your explanations. Django behaves oddly.

Model.save() is the place where empty non-nullable fields cause an
exception. There is no reason for ForeignKey to behave differently.
ForeignKey fields are different in that they cause database lookups when
they are not None, and that they can cause exceptions in some special
situations, for example
- asking them to save before the foreign instance has been saved
- database integrity errors (invalid non-None pk)

That said, it is clear that I don't know Django well enough to decide
whether it is feasible/necessary to fix this odd behaviour.

Luc

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to