title: Accessing parent model instance from modelform of admin inline
body: <p>I'm using a TabularInline in Django's admin, configured to show one extra blank form.</p>
  
  <pre><code>class MyChildInline(admin.TabularInline):
      model = MyChildModel
      form = MyChildInlineForm
      extra = 1
  </code></pre>
  
  <p>The model looks like MyParentModel->MyChildModel->MyInlineForm.</p>
  
  <p>I'm using a custom form so I can dynamically lookup values and populate choices in a field. e.g. </p>
  
  <pre><code>class MyChildInlineForm(ModelForm):
  
      my_choice_field = forms.ChoiceField()
  
      def __init__(self, *args, **kwargs):
          super(MyChildInlineForm, self).__init__(*args, **kwargs)
  
          # Lookup ID of parent model.
          parent_id = None
          if "parent_id" in kwargs:
              parent_id = kwargs.pop("parent_id")
          elif self.instance.parent_id:
              parent_id = self.instance.parent_id
          elif self.is_bound:
              parent_id = self.data['%s-parent'% self.prefix]
  
          if parent_id:
              parent = MyParentModel.objects.get(id=parent_id)
              if rev:
                  qs = parent.get_choices()
                  self.fields['my_choice_field'].choices = [(r.name,r.value) for r in qs]
  </code></pre>
  
  <p>This works fine for the inline records bound to an actual record, but for the extra blank form, it doesn't display any values in my choice field, since it doesn't have any record id and there can't lookup the associated MyParentModel record.</p>
  
  <p>I've inspected all the values I could find (args, kwargs, self.data, self.instance, etc) but I can't find any way to access the parent object the tabular inline is bound to. Is there any way to do this?</p>