help

13 views
Skip to first unread message

Tosin Ayoola

unread,
Nov 27, 2018, 8:00:37 AM11/27/18
to django...@googlegroups.com
Good day guyz trying to create a radio button and checkbox and save it to the database using my models, but it doesn't seems to be working the way i want it, hoping anyone can help me out below is my code.


models.py

class Sports(models.Model):
  sport = models.CharField(max_length = 150)

class School(models.Model):
  SPORTS = models.ManyToManyField(Sports)

 forms.py
class Data(ModelForm)
  SPORT = forms.MultipleChoiceField(
    widget=forms.CheckboxSelectMultiple,
    queryset=Sports.objects.all(),)


will be glad if i can get any one to help


Nelson Varela

unread,
Nov 27, 2018, 8:13:59 AM11/27/18
to Django users
where is your view and your template in which you show the form and handle the from
Reply all
Reply to author
Forward
0 new messages