Tuesday, November 27, 2018

help

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


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHLKn71H%3DeFN4i_ccusvQFVD8yb-Jxib%3D3y8XH%2B6JgcYTF3oQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment