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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:03:19+00:00 2026-06-10T01:03:19+00:00

Possible Duplicate: choice property in google app engine I am a newbie to App

  • 0

Possible Duplicate:
choice property in google app engine

I am a newbie to App Engine and also to Python (my experience is with ASP).

The DataModeling section of AppEngine Documentation (https://developers.google.com/appengine/docs/python/datastore/datamodeling) provides an example that starts as:

class Pet(db.Model):  
    name = db.StringProperty(required=True)  
    type = db.StringProperty(required=True, choices=set(["cat", "dog", "bird"]), default="dog")  

How do I reference these allowable values in a Jinja2 PetCreate.html template?

I am not sure if the choices option is only a Django-related structure (I am not using Django – only Jinja2)

It seems it would not make sense to have to hard-code these values into a html select structure (why bother putting it in the model if I have to hard code the allowable values in every create and edit case anyway).

Can anyone give me an example of what the PetCreate.html template might look like to go with this model?

I am using Python2.7 and trying to use Jinja2 for templates and want to stay with Datastore (not Cloud SQL).

Thanks.

  • 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-10T01:03:21+00:00Added an answer on June 10, 2026 at 1:03 am

    In the end I ended up not needing this because I decided I wanted to hard code the forms for other reasons. Having said that, I saw references of this using NDB, jinja2 and WTForms.

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

Sidebar

Related Questions

Possible Duplicate: What’s your choice for your next ASP.NET project: WebForms or MVC? Can
Possible Duplicate: Set Locale programatically I would like to create an english/spanish option choice
Possible Duplicate: Python : how to append new elements in a list of list?
Possible Duplicate: Which exception should I raise on bad/illegal argument combinations in Python? I've
Possible Duplicate: Integrate Python And C++ I am the python GUY and do web
Possible Duplicate: When is Winforms the correct choice vs. WPF? Hi, I have read
Possible Duplicate: Difference between static class and singleton pattern? I'm thinking about the choice
Possible Duplicate: Strip html from strings in python RegEx match open tags except XHTML
Possible Duplicate: Replacements for switch statement in python? I'm making a little console based
Possible Duplicate: Python-LDAP integration Good afternoon! I am writing a program for work that

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.