ForeignKey pointing to "nothing"

2014-01-03 Thread Phil Hughes
I have a model where a foreign key reference may be undefined when a record is first created. In particular, I have the following in my model seller = models.ForeignKey(User, related_name='+', blank=True, null=True) The form accepts not setting the seller field but I get an Integrity Error

Re: ForeignKey pointing to "nothing"

2014-01-04 Thread Phil Hughes
That was it -- thanks. I usually create a MySQL database to use in development but decided to just use sqlite. So much for my "shortcut". On Saturday, January 4, 2014 4:26:59 AM UTC-6, Russell Keith-Magee wrote: > > > On Sat, Jan 4, 2014 at 9:57 AM, Phil Hughes > > w

referencing choices tuples

2014-01-08 Thread Phil Hughes
I have a typical set of choices tuples that are then referenced in a choices=... reference in a field definition. It does, well, what it is supposed to do. But, I have a situation where I need to change the value of the field to "a different choice" in code in the view (rather than as a from ch