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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:33:21+00:00 2026-06-14T21:33:21+00:00

How do I assign a ListProperty with Google App Engine? name = self.request.get(name) description

  • 0

How do I assign a ListProperty with Google App Engine?

    name = self.request.get("name")
    description = self.request.get("description")
    list = '''insert code here'''

I want list to work like a dictionary, is this possible with Google App Engine, if so, how:

[wordone : score; wordtwo : score; wordthree : score]

^I want the list property to store some data like this, how is this possible?

  • 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-14T21:33:22+00:00Added an answer on June 14, 2026 at 9:33 pm

    You actually won’t be able to store a true dictionary as type in a ListProperty (it only supports datastore property types, of which dict is not one), so you won’t be able to get the behavior you’re looking for. Will all of the data be the same (i.e. each element represents a word score)? Assuming storing each word as its own property on the model doesn’t make sense, one ‘dirty’ solution would be to make a ListProperty of type str, and then append the word and score as separate elements. Then, when you searched for a word in the list, you would return the value at the index position of the word + 1. That would looks something like:

    class MyEntity(db.Model):
      name = db.StringProperty()
      description = db.TextProperty()
      word_list = db.ListProperty()
    

    You could then add words like:

    new_entity = MyEntity()
    new_entity.word_list = ['word1', 1, 'word2', 2, 'word3', 10]
    

    You could then query for a particular entity and then examine its word_list property (a list), looking for your target word and returning the element one position after it.


    More convoluted suggestion

    However if that isn’t an option, you could look into creating another model (let’s say WordScore) that looked something like:

    class WordScore(db.Model):
      word = db.StringProperty()
      score = db.IntegerProperty()
    

    Then, whenever you needed to add a new score, you would create a WordScore instance, fill out the properties and then assign it to the proper entity. I haven’t tested any of this, but the idea would be something like:

    # Pull the 'other' entity (this would be your main class as defined above)
    q = OtherEntity.all()
    q.filter('name =', 'Someone')
    my_entity = q.get()
    
    # Create new score
    ws = WordScore(parent=my_entity)
    ws.word = 'dog'
    ws.score = 2
    ws.put()
    

    You could then pull out the score for dog for ‘Someone’ by doing something like this (again, completely untested for now – be warned 🙂 ):

    # Get key of 'Someone'
    q = OtherEntity.all()
    q.filter('name =', 'Someone')
    my_entity = q.get().key()
    
    # Now get the score
    ws = WordScore.all()
    ws.filter('word = ', 'dog').ancestor(my_entity)
    word_score = ws.get().score
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how to assign value directly to kendo data-bind here is the code <script type=text/x-kendo-template
I want to assign a value from a select box to an input field
Is it possible to assign to a list slice in one go, that would
I just want to assign a variable to a function so it can be
I assign here on a an Object a derivative of the same object. Is
I want to assign a default value if url parameter is not set. Something
i want to assign the linq result to a multidimensional array and the below
I want to assign the decimal variable "trans" to the double variable "this.Opacity". decimal
I want to assign a class attribute via a string object - but how?
private List<T> newList; public List<T> NewList { get{return newList;} set{newList = value;} } I

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.