-
Notifications
You must be signed in to change notification settings - Fork 52
Added child_enpoints_model example. #112
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,17 @@ | |||
application: my-api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is identical to the app config for basic
, can you make this a symlink as in
@rhodul Thanks for being so thorough! I'm going to check out your branch since viewing an entire new file as a diff is a bit hard on the eyes. A general word of advice, create a new branch before make a pull request so that your master branch can always be a clean copy of the main repo. |
@@ -0,0 +1,205 @@ | |||
# If you have not yet seen the source in keys_with_ancestors/main.py, please take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line (and lines 51 and 53, to name a few) exceed 80 chars, please adhere to PEP8 as close as possible.
I know, sorry about that. I realized it a bit too late. On Tue Oct 28 2014 at 4:32:52 PM Danny Hermes notifications@github.com
|
# we include "parent" in the request path by setting | ||
# path='mymodel/{parent}'. | ||
# Unlike in keys_with_ancestors/main.py, we want a datastore to generate | ||
# child ID, therefore we do not include it in the request body. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Moving conversation here to latest diff)
The statement "we do not include it in request body" doesn't clearly indicate why this happens. Instead you could say
# Unlike in keys_with_ancestors/main.py, we want the datastore to generate
# child ID, therefore we do not include it in the default message fields schema
# which determines the request body.
Thank you for this example,maybe i would still trying to find out what is wrong with my code if i had not found it. Unfortunately the keys with ancestors example uses a string identifier as the id, which is unnecessary to get started. It would be very helpful to have a standard ancestor-child example you can use for getting started and just copy&paste |
@pfried That example is quite complex. The 10 examples are listed on How do imagine you could get ancestor-child in a different way that would be simpler? |
@dhermes I would imagine two simple models coupled as parent child by the id property. The ancestor example http://endpoints-proto-datastore.appspot.com/examples/keys_with_ancestors.html couples them by the parent name, which mixes in another aspect (string field as key). I know most examples cover more than one aspect. But as the ancestor is already very complex i would like to see an example which uses the id property for building the key |
@dhermes Sorry, i just took a look at it again (wrote the first comment when i started using the lib) and i realize that it already is the way i asked it to be. I think i got confused on the thank you for your patience |
No worries. Glad the library helps you. |
As per #110 (comment) I have added the example for simple parent child relationship.