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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:57:23+00:00 2026-06-17T08:57:23+00:00

I tried to address a repeated property element using a key, like : ndb.Key(‘Books’,

  • 0

I tried to address a repeated property element using a key, like : ndb.Key(‘Books’, ‘Programming.one’) but this key (the .one part) is not valid.

My example model below is a simplified version of my app’s model. In this example code I have dependencies (using keys) between book chapters and tags :

class Tags(ndb.Model):
    tag = ndb.StringProperty()

example : Tags(id = ‘python’, tag = ‘python’)

class Books(ndb.Model):
    book = ndb.StringProperty)
    chapters = ndb.StringProperty(repeated = True)

example : Books(id = ‘Programming’, book = ‘Programming’, chapters = [‘one’, ‘two’])

class Dependencies(ndb.Model):
    chapter_key = ndb.KeyProperty()
    tag_keys = ndb.KeyProperty(repeated = True)

example :

chapter_key = ndb.Key('Books','Programming.one')
dependency_key = ndb.Key('Dependencies', chapter_key.id())
Dependencies(key = dependency_key, chapter_key = chapter_key, 
                   tag_keys = [ndb.Key('Tags', 'python'), ndb.Key('Tags', 'java')])

Is it possible to address a repeated property using a ndb.Key. In my code example the chapter_key is not valid. Can I use a hook or property subclass to make it work?

To make it work I can combine a valid Book Key with a StringProperty to hold the chapter.

book_key = ndb.Key('Books','Programming')
chapter = 'one'
dependency_key = ndb.Key('Dependencies', book_key.id() + '.' + chapter)
Dependencies(key = dependency_key, book_key = book_key, chapter = chapter, 
                   tag_keys = [ndb.Key('Tags', 'python'), ndb.Key('Tags', 'java')])

But I would like to benifit from a key.

I have the same question for a structured property. For this question the repeated StringProperty chapters is replaced by a repeated StructuredProperty like :

class Chapters(ndb.Model):
    chapter = ndb.StringProperty()
    word_count = ndb.IntegerProperty()

About my example and the use of keys :

I use keys in Dependencies, because keys in dependencies can refer to different kinds. These kinds differ from the Book like kind, because they do not have a repeated property like Book chapters. I use repeated depends_on_keys in my application, instead of chapter_keys.

In the example I also left out the parent keys. The Book like kind can have dependencies, but in my application you cannot find entities, which depend on the Book like kind.

  • 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-17T08:57:23+00:00Added an answer on June 17, 2026 at 8:57 am

    No, you cannot use a key to identify a part of an entity. If you want to reference a part of an entity, you will need to use a key in conjunction with your own scheme for addressing entity parameters.

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

Sidebar

Related Questions

i want get the base address from one module, i was tried using GetModuleHandleEx
I tried to control email address and reviewer's name with the following code but
I have an address database and I tried to find latitude and longitude using
i tried to get the real user ip address, it's working, but i'm not
How to get Bluetooth MAC address from Windows Mobile? I tried OPENNETCF library but
I'm trying to resolve a hostname from an ip address. I have tried using
i tried to get current system domain ip address using c++ win32 API. How
I tried to get the address info in to structred addrinfo **result . but
I tried connecting to an IP address (e.g. http://222.222.222.222:8080 ) and a URL (e.g.
in c, i tried to print out address of variable and address of some

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.