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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:34:54+00:00 2026-05-15T03:34:54+00:00

Is it possible to change or assign new parent to the Model instance that

  • 0

Is it possible to change or assign new parent to the Model instance that already in datastore? For example I need something like this

task = db.get(db.Key(task_key))
project = db.get(db.Key(project_key))
task.parent = project
task.put()

but it doesn’t works this way because task.parent is built-in method. I was thinking about creating a new Key instance for the task but there is no way to change key as well.

Any thoughts?

  • 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-15T03:34:54+00:00Added an answer on May 15, 2026 at 3:34 am

    According to the docs, no:

    The parent of an entity is defined
    when the entity is created, and cannot
    be changed later.

    …

    The complete key of an entity,
    including the path, the kind and the
    name or numeric ID, is unique and
    specific to that entity. The complete
    key is assigned when the entity is
    created in the datastore, and none of
    its parts can change.

    Setting a parent entity is useful when you need to manipulate the parent and child in the same transaction. Otherwise, you’re just limiting performance by forcing them both to be in the same entity group, and restricting your ability to update the relationship after the entity has been created.

    Use a ReferenceProperty instead.

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

Sidebar

Related Questions

Is it possible for me to change or assign my server a new IP
Possible Duplicate: Change the URL in the browser without loading the new page using
Is it possible to change object's value not directly? For example a = {x:
is it possible to change the Audience of an already existing Post in my
Is it possible to change SQL in a z/OS mainframe COBOL application so that
First, I am very new to lisp, so it is possible that I'm just
I wanted to change ActionLink like: @Html.ActionLink(Create New, Create, null, new { @data-role =
Is it possible to assign some kind of variable that value of it would
Possible Duplicate: Algorithm for generating a random number Hi i need to assign a
Possible Duplicate: Change icon on of an App in iOS 4 in run-time Is

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.