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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:36:16+00:00 2026-06-12T04:36:16+00:00

In send_option (in views) variable I have name of Send . I would like

  • 0

In send_option (in views) variable I have name of Send.
I would like to have ID of Send

How to do it? Thanks

Form:

class SendOrderForm(forms.Form):
   send_option = forms.ModelChoiceField(queryset=Send.objects.all())

Model:

class Send(models.Model):
    name = models.CharField(max_length=50)
    price = models.DecimalField(max_digits=5, decimal_places=2)
    time = models.CharField(max_length=150)

Views:

if request.method == 'POST':
        form = SendOrderForm(request.POST)
        if form.is_valid():
            send_option = form.cleaned_data['send_option']
  • 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-06-12T04:36:17+00:00Added an answer on June 12, 2026 at 4:36 am

    What you can do is,

    if request.method == 'POST':
        form = SendOrderForm(request.POST)
        if form.is_valid():
            send_option = form.cleaned_data['send_option'].id
    

    form.cleaned_data['send_option'] would get the object, and you can get its id by doing a .pk or .id

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

Sidebar

Related Questions

Background and my research I would like to send data from server to client
I have a profile page like so: https://i.stack.imgur.com/Rx4kg.png . In management I would like
Either of these options would be fabulous: Send a bitmap image of the stage's
to send a message in my application in android i have used the following
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
I have a class, the outline of which is basically listed below. import org.apache.commons.math.stat.Frequency;
I have to change the is_staff option from views.py file to disabling the Django-admin
I have a ajax call to a controller that is supposed to send me
I have a a column in design view called RU. My function name is
I have a problem. I send a NSURLConnection sendSynchronousRequest for save data, and navigate

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.