On Thursday, June 21, 2012 4:37:35 AM UTC-6, Melvyn Sopacua wrote:
>
> Which is /exactly/ why I mention it. If the default value is inserted 
> instead of an empty string, you can pre-insert the default value and 
> have it linked to an invalid entry. Any attempts to insert the default 
> value on the primary key of the linked model will trigger an integrity 
> error. Any models referencing the pre-inserted "invalid key" can now be 
> identified and relinked properly. 
>

Then all your application logic and views have to be written to ignore the 
invalid entry.  It seems a lot simpler and less error-prone to just tweak 
the DDL to add a "NOT NULL" constraint.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/9dWmb4ori3EJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to