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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:28:54+00:00 2026-06-06T20:28:54+00:00

I want the user’s input to eventually be modeled with a db.stringListProperty(). What would

  • 0

I want the user’s input to eventually be modeled with a db.stringListProperty(). What would the input format have to look like and how would the user’s inputs have to be constructed (with []’s, with quotes, with commas, etc.), if this is possible? I am using jinja2 for form templates, if that matters. (Extra credit for how to validate that the data was input correctly .)
Thanks.

I get this error from appengine.

raise BadValueError('Property %s must be a list' % self.name)
BadValueError: Property choices must be a list

The error occurs on this line below.

person.choices = self.request.get(‘choices’)

class PQ(db.Model):
    choices = db.StringListProperty()


    key = db.Key.from_path("PQ", ID_id)
    person = PQ.get(key)
    template_values = {'ID_id':person.key(),
                      'p': person,
                      }
    path = os.path.join(TEMPLATE_DIR, 'add_person.html')
    self.response.out.write(template.render(path, template_values))


class AddPerson(BaseHandler):
    def post(self):
        ID_id = self.request.get('ID')
        key = db.Key.from_path("PQ", ID_id)
        person = PQ.get(key)

        person.choices = self.request.get('choices')
        person.put()
        self.redirect("/?ID=%s" % ID_id)



add_person.html
<html>
  <body>

<div id="inputdata">
    <form action="add_person" method="post" enctype="multipart/form-data">
        <label>Enter your list of choices. Your list must follow this format:
            ["Less","Same","More"] </label>
    <input type="textbox" name="choices" size="30" value="{{ p.choices }}"></input><br/>
    <input type="submit" value="Submit"></input>
    </form>
</div>
    </body>
</html>
  • 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-06T20:28:56+00:00Added an answer on June 6, 2026 at 8:28 pm

    It seems that you get this error because choices must be a list type, but the value that you get from your request is a string – and it’ll always be, since you get it from your HTTP request.

    On the form side, it doesn’t matter what format the user types data in, since it’s always passed as a string – a comma-separated list should suffice. Then you could parse it with e.g. self.request.get('choices').split(",") (and trim whitespace on your side so you don’t bother the user with exact whitespace requirements).

    Best practices dictate that you should assist the user as much as possible – if you have a set of pre-defined choices, you could use Select2 or a similar widget to guide the user with making their selection.

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

Sidebar

Related Questions

I want a user to input time, so like 12:00, but I need to
like I want the user to send some info only once ..actually have sent
I have a model called Person. I want User to inherit from Person. class
I have an android application and web-server working together. Now I want user log
I want user A and B to have clone, push and pull while user
I want let user to upload images to server add some info (like description,
I have a Lexicon model, and I want user to be able to create
I have a form, in whmcs that I want user to only be able
I want after login user redirects to page creating new table(website), so I have
I have a scenario in which I want user to be able to start

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.