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 3404400
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:22:42+00:00 2026-05-18T05:22:42+00:00

In a Django request I have the following: POST:<QueryDict: {u’section’: [u’39’], u’MAINS’: [u’137′]}> How

  • 0

In a Django request I have the following:

POST:<QueryDict: {u'section': [u'39'], u'MAINS': [u'137']}>

How do I get the values of section and MAINS?

if request.method == 'GET':
    qd = request.GET
elif request.method == 'POST':
    qd = request.POST

section_id = qd.__getitem__('section') or getlist....
  • 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-18T05:22:43+00:00Added an answer on May 18, 2026 at 5:22 am

    You can use [] to extract values from a QueryDict object like you would any ordinary dictionary.

    # HTTP POST variables
    request.POST['section'] # => [39]
    request.POST['MAINS'] # => [137]
    
    # HTTP GET variables
    request.GET['section'] # => [39]
    request.GET['MAINS'] # => [137]
    
    # HTTP POST and HTTP GET variables (Deprecated since Django 1.7)
    request.REQUEST['section'] # => [39]
    request.REQUEST['MAINS'] # => [137]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following logic in my view: def view_function(request): if request.method == 'POST':
In my django views i have the following def create(request): query=header.objects.filter(id=a)[0] a=query.criteria_set.all() logging.debug(a.details) I
Django code samples involving post data often shows code similar to this: if request.method
Are forms that use the POST method required to have CSRF protection? I'm following
I have the following view in my django application def ViewSale( request ): salecur
I have a django view that returns HTTP 301 on a curl request: grapefruit:~
I have a Django view called change_priority. I'm posting a request to this view
Let's suppose I have the following url: /valid/django/app/path/?foo=bar&spam=eggs I can simulate a request to
I have the following view code: def activate( request = '', actkey = ):
I have trouble transforming the following code into the new django 1.3 class-based generic

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.