Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4554220
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:03:34+00:00 2026-05-21T17:03:34+00:00

This is what I have at the moment: views.py def activation_signupcount(request): if ‘datestart’ not

  • 0

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

enter image description here

Questions:

  1. How do I set a initial or default value?
  2. How do I remove the bullet points
  3. 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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T17:03:35+00:00Added an answer on May 21, 2026 at 5:03 pm

    “This field is required” is being displayed because you are passing in a data parameter 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 is datestart supposed to be, anyway?

    The way to pass initial data is well documented.

    def activation_signupcount(request):
        if request.POST:
            form = SegmentForm(request.POST)
            if form.is_valid():
                form.save()
            return HttpResponseRedirect('/somewhere/')
        else:
            form = SegmentForm(initial=request.GET)
    
        return render_to_response('activation/activation_signupcount.html',
                                  {'datestart': request.GET.get('datestart', '')
                                   'form': form})
    

    Here the initial parameter is passed to SegmentForm only on GET, and data is 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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At the moment I have this code which fires a projectile: Vector3 d =
I have this script at the moment, which changes an image when a thumbnail
This is what I have at the moment. <h2>Information</h2>\n +<p>(.*)<br />|</p> ^ that is
At the moment when i use this, i have to re-launch the app to
I have two nested loop in XSL like this, at this moment I use
I have 2 views in my app. A form input and a screen to
I have been learning iOS development for a few days now. At this moment,
Hay all, i have a simple model like this def Article(models.Model): upvotes = models.ManyToManyField(User,
I'm stuck with this: I have a ViewGroup that hosts few Views. All Views
I'm going to get parameter form AJAX request in Django, Here's what I'm doing:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.