You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class StudioAppointmentForm(SuperModelForm):
who = ForeignKeyFormField(form_class=CustomerForm, field_name='who', blank=True)
class Meta:
model = StudioAppointment
fields = ()
with a model
class StudioAppointmentForm(SuperModelForm):
who = ForeignKeyFormField(form_class=CustomerForm, field_name='who', blank=True)
class Meta:
model = StudioAppointment
fields = ()
But when I do
form = StudioAppointmentForm(request.POST or None)
I get
RelatedObjectDoesNotExist at /new/studio/
StudioAppointment has no who.
...
at .../django_superform/fields.py in get_instance
313. return getattr(form.instance, field_name)
StudioAppointment has a who field, but it's None because this is a new instance.
Am I doing something wrong?
Django Version: 2.0.2
Python version: 3.5.2
The text was updated successfully, but these errors were encountered:
I have this form
with a model
But when I do
I get
StudioAppointment has a who field, but it's None because this is a new instance.
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: