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

  • Home
  • SEARCH
  • 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 6372163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:12:01+00:00 2026-05-25T01:12:01+00:00

Relatively new to Python.. I would like to know how to check if a

  • 0

Relatively new to Python..

I would like to know how to check if a check box has been selected.
I am reading the form values into a python script and am unsure how to go about validating.

Using the Web Framework Django. The form is being posted back to a views.py script.
I am loading up a dictionary with many different variables. These variables need to then be passed to a shell script, the command to the shell script requires these check box values to be returned in the form of 0 or 1 in order to create a zip file.

I understand this code is not python but it is my understanding of what i am trying to achieve:

if variable.checked == 'yes'
    return 1
elif
    return 0
  • 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-25T01:12:02+00:00Added an answer on May 25, 2026 at 1:12 am

    The documentation for Django is really quite good. Check out the description of the HttpRequest class for more information on how this part works. The short answer is that you can do something like this:

    def myview(request):
        # do stuff
        option_checked = 'myvariable.checkboxoption' in request.REQUEST
        # do more stuff and return the response
    

    That being said, Django also has a comprehensive form widget/validation/extraction subsystem. I’d recommend going through the full tutorial (particularly part 4, which covers forms) and checking out the mailing list to answer any more specific questions about how to use these libraries.

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

Sidebar

Related Questions

I am relatively new to python I would like to run a block of
I'm relatively new to python and know very little syntax, but I'm willing to
Relatively new to C++ and this has been bugging me for a while. I'm
I am relatively new to python (already did some 1h scripts like a little
I'm new to python and I would like some help. I created some classes
I'm relatively new to the Python world, but this seems very straight forward. Google
I'm relatively new to Python and am having problems programming with Scapy, the Python
I am relatively new to python and app engine, and I just finished my
I'm a relatively new convert to Python. I've written some code to grab/graph data
I'm relatively new to wxPython (but not Python itself), so forgive me if I've

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.