title: django modelchoicefield with unsaved models
body: <p>All,</p>
  
  <p>Is there a straightforward way for me to display a form that uses a modelchoicefield for models that have yet to be saved?</p>
  
  <pre><code>class Foo(models.Model):
    name = models.CharField(max_length=42)
  
  class Bar(models.Model):
    name = models.CharField(max_length=42)
    foo = models.ForeignKey("Foo",blank=True,null=True)
  
  class BarForm(ModelForm):
    class Meta:
      model = Bar
    pass
  
  def create_new_bar(request):
    foos = [Foo(name='foo1'), Foo(name='foo2'), Foo(name='foo3')]
    bar = Bar(name='bar',foo=foos[0])
    form = BarForm(instance=bar)
    return render_to_response('bar_template.html',{"form" : form},context_instance=RequestContext(request))
  </code></pre>
  
  <p>But the "select" widget that gets rendered in the form has empty content.  Presumably, this is because there is nothing to bind the queryset to for the ModelChoiceField that Bar's ForeignKey to Foo uses.  (Since nothing in "foos" has been saved and therefore does not exist in the database).</p>
  
  <p>Is there another way to deal with this besides writing a custom formfield/widget?</p>
  
  <p>Thanks.</p>