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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:15:02+00:00 2026-05-25T13:15:02+00:00

I have a simple form and am trying to POST it to a simple

  • 0

I have a simple form and am trying to POST it to a simple service.

The form model:

class order_form(forms.Form):
    name = forms.CharField(max_length=100)
    phone = forms.CharField(max_length=20)
    email = forms.CharField(max_length=100)
    address = forms.CharField(max_length=200)
    ordered_picture = forms.CharField()

the view (haven’t sorted all the cleared_data bits and stuff yet):

def place_order(request):
    result = dict()
    if request.method == 'POST':
        try:
            form = order_form(request.POST)
            if not picture.objects.filter(id=form.ordered_picture).exists():
                result['status'] = 'error'
                result['message'] = 'Ordered picture does not exist'
            new_order = order()
            new_order.name = form.data.name
            new_order.phone = form.data.phone
            new_order.email = form.data.email
            new_order.address = form.data.address
            new_order.ordered_picture = int(form.data.ordered_picture)
            new_order.save()
            result['status'] = 'ok'
            result['message'] = new_order.id
        except Exception, e:
            result['status'] = 'error'
            result['message'] = e.message
    else:
        result['status'] = 'error'
        result['message'] = 'Only HTTP POST Method is supported by this service'
    return HttpResponse(content=simplejson.dumps(result))

Here is a copy of POST data that goes in:

csrfmiddlewaretoken:77d1ba277ef43838e670f598c2a128b6
name:qwe
phone:qwe
email:qwe
address:qwe
ordered_picture:1

and I get the following:

{"status": "error", "message": "'order_form' object has no attribute 'ordered_picture'"}

this “object has no attribute” thing is popping out at Exception right after form = order_form(request.POST) is attempted. I am about to break my head – why is this telling me the form does not have this attribute when it does in reality?

  • 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-25T13:15:03+00:00Added an answer on May 25, 2026 at 1:15 pm

    Time to sort out all the “cleaned_data bits”, since that’s how you access the field values.

            if not picture.objects.filter(id=form.cleaned_data['ordered_picture']).exists():
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple form. <form target=_blank action=somescript.php method=Post id=simpleForm> <input type=hidden name=url value=http://...> <input
I have a simple form like this: <form name=serachForm method=post action=/home/search> <input type=text name=searchText
I have a simple form in ASP.NET MVC. I am trying to post these
I have the following in a simple form; <form method=post action=inc/core.php> <input type=textbox name=lognick
I have a WPF form where I'm trying to make a simple input form.
I have a simple form that looks like so <% remote_form_for post, :url =>
I'm trying to make a simple room management service. The rooms have these properties:
Right now I have simple form with a single input. I'm trying to use
I can't set a variable from a post array. I have a simple form
I am trying to create a simple registration form. I have the following: include('User.datatype.php');

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.