Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBronson Avila
4,160 PointsPylint warning: "Unexpected keyword argument 'queryset' in constructor call"?
I've been coding along with the Exploring Django | Django Forms | Inlines and Media | Formsets lecture on my local environment in VS Code (rather than in the Workspace), and Pylint displays the warning in the title when setting the formset
value under the answer_form
view in courses/views.py
:
formset = forms.AnswerFormSet(queryset=question.answer_set.all())
Everything still works as shown in the video lecture. I have included from . import models
in courses/views.py
, and It does not appear that there is anything wrong with the AnswerFormSet
model in my courses/forms.py
file:
AnswerFormSet = forms.modelformset_factory(
models.Answer,
form=AnswerForm,
extra=2,
)
Just wondering if anyone else is going through this course in VS Code, and whether they are also seeing the same warning. Again, everything still works even though the warning is showing up. It just seems odd to receive that warning when nothing is going wrong.
Thank you.
1 Answer
Tlotlo Molokwe
16,618 PointsI dont use VS but its problably how the ide reads code, since there is no place were queryset was imported or created as a variable it assumes queryset might cause an error