Issue #19 new

Without either `exclude` or `fields`, no fields show up.

cazcazn
created an issue

A very simple view:

class SimpleView(CreateView):
    form_class = SimpleForm
    model = Simple

In the template:

{{ form }}

When SimpleForm subclasses forms.ModelForm, everything works as expected. When SimpleForm subclasses BetterModelForm, the page is completely blank.

I don't know where to begin trying to create a PR for this!

Comments (5)

  1. Carl Meyer repo owner

    Sorry, no idea. I don't use the class-based views, so I'm probably not going to have time for debugging this. Pull request welcome if you can figure out what the issue is!

  2. cazcazn reporter

    I switched to using function view and the problem was the same. So, I added

    exclude = ('',)
    

    to the Meta class, and all the fields miraculously appeared.

  3. Carl Meyer repo owner

    Well that's odd. So it seems that BetterModelForm requires either fields or exclude to be specified? I'll update the issue title to better describe the issue.

  4. Log in to comment