Discussion:
help
Tosin Ayoola
2018-11-27 12:59:37 UTC
Permalink
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+***@googlegroups.com.
To post to this group, send email to django-***@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.
Nelson Varela
2018-11-27 13:13:59 UTC
Permalink
where is your view and your template in which you show the form and handle
the from
--
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+***@googlegroups.com.
To post to this group, send email to django-***@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/63c77d1a-f4f6-48a2-82e5-25101b752ed7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...