i have same problem i cant figure out the solution i am new to django and web programming also.... My console error is : VM328 SelectFilter2.js:246 Uncaught ReferenceError: grp is not defined at VM328 SelectFilter2.js:246 (anonymous) @ VM328 SelectFilter2.js:246 SelectBox.js:144 Uncaught ReferenceError: grp is not defined at VM327 SelectBox.js:144 (anonymous) @ SelectBox.js:144 SelectFilter2.js:246 Uncaught ReferenceError: grp is not defined at VM328 SelectFilter2.js:246
Cant get rid of it someone aware of this problem plz help.. i am a student a this is my final year project. On Wednesday, July 3, 2019 at 6:34:30 AM UTC+5, Yeashin Rabbi wrote: > > Hello, > I tried to use Django's FilterSelectMultiple Widget. But it does not > render the right list box. Any help would be appreciated. > > Thanks > > Here is my code: > > forms.py > > class appForm(ModelForm): > port = forms.ModelMultipleChoiceField(internalapp.objects.all(),widget= > FilteredSelectMultiple("Port",False,attrs={'rows':'10'})) > class Meta: > model = internalapp > fields = '__all__' > class Media: > css = {'all': ('/static/admin/css/widgets.css',), } > js = ('/admin/jsi18n/',) > > views.py > def testhome(request): > submitted = False > if request.method == 'POST' : > form = appForm(request.POST) > if form.is_valid(): > form.save() > return HttpResponseRedirect('/testhome/?submitted=True') > else: > form = appForm() > > if 'submitted' in request.GET: > submitted = True > return render(request, 'tryout/testhome.html', {'form': form, 'submitted': > submitted}) > > templates > {% load static %} > <!DOCTYPE html> > <html lang="en"> > <head> > <meta charset="UTF-8"> > <meta name="viewport" content="width=device-width, initial-scale=1.0"> > <meta http-equiv="X-UA-Compatible" content="ie=edge"> > <title>Document</title> > </head> > <body> > {{ form.media }} > <form> > <table> > {{form.ports }} > </table> > </form> > </body> > </html> > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0c2fc354-c1d9-4fe8-8a47-e384ba865d1fo%40googlegroups.com.