I have a model that contains a field, severity, that is a ForeignKey.
When I create a new instance, I'd like that field to have the id of
the Severity instance with the name 'Low'. What is the best way to do
this? Putting default=1 in the model breaks encapsulation. I could
manually set it to Severity.objects.get(name="Low").id in the view
that creates it, which is a bit better, but not much.

What's the right thing to do?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to