This is what I have at the moment:
views.py
def activation_signupcount(request):
if 'datestart' not in request.GET:
form = SegmentForm(request.GET)
#form2 = Period(request.GET)
return render_to_response('activation/activation_signupcount.html', {'datestart':'', 'form':form})
template
<form method="get" action="">
<h3>1. Choose segment</h3>
{{ form.as_p }}
forms.py
from django import forms
from django.forms.widgets import RadioSelect
from django.forms.extras.widgets import SelectDateWidget
usersegment = [['non-paying','Non-paying'],['paying','Paying'], ['all', 'All']]
class SegmentForm(forms.Form):
radio = forms.ChoiceField(required = True, label= False, widget=RadioSelect(), choices=usersegment)
The output looks like this

Questions:
- How do I set a initial or default value?
- How do I remove the bullet points
- How do I get rid of the text ‘This field is required.’
I had a good look at the documentation on djangoprojects but there doesn’t seem to be anything on it unless I missed something?
“This field is required” is being displayed because you are passing in a
dataparameter when you instantiate the form – you should only do this on POST, not GET. If you show your view code I can advise further on how to set initial values.Updated Well, it’s clear that this is indeed your problem. For some reason, you are passing the request.GET as the first positional parameter, which is
data, thus binding the form. Don’t do that. That’s why you’re getting that unwanted “This field is required”. What isdatestartsupposed to be, anyway?The way to pass initial data is well documented.
Here the
initialparameter is passed to SegmentForm only on GET, anddatais passed only on POST.To get rid of the bullet points, you just use CSS, but again you haven’t shown us how you’re doing that so it’s impossible to say why it doesn’t work.