Eric Shelby20,730 Points
Create a Model Form Challenge
According to the instructions: 'We need to make a model form for our Digital product model. We have a couple of fields on Product, its parent, though, that we don't want in our form.
Make a model form for Digital and name the form class DigitalProductForm. Only include the name, description, and url fields.'
However, I don't how to turn a model form for Digital. The lesson didn't cover that. I tried a few ways, but none of them worked. A hint would be appreciaed.
from django import forms from . import models class DigitalProductForm(forms.ModelForm) class Meta: model = models.DigitalProduct fields = ['name', 'description', 'url',]
Chris FreemanTreehouse Moderator 49,126 Points
You are very close! There is a colon missing from the end of the class definition. While the form is
DigitalProductsForm, the model it's based on is
DigitalProducts. Fix these and it should pass.
Post back if you need more help. Good luck!!