Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Expose NDB id in models #17

Merged
merged 5 commits into from
Aug 17, 2016
Merged

Expose NDB id in models #17

merged 5 commits into from
Aug 17, 2016

Conversation

ekampf
Copy link
Collaborator

@ekampf ekampf commented Aug 17, 2016

No description provided.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.8%) to 96.543% when pulling 9947f38 on feature/expose_ndb_ids into f354e7c on master.

@syrusakbary
Copy link
Member

As a suggestion, as both id's are Strings and focus on the identity of a store key maybe you can cover both use cases with just one field that receives an argument.

Something like:

store_id = graphene.String(ndb=graphene.Boolean())

def resolve_store_id(root, args, context, info):
    if args.get('ndb'):
        return store_key.id()
    return store_key.urlsafe()

😉

@ekampf
Copy link
Collaborator Author

ekampf commented Aug 17, 2016

@syrusakbary thats way nicer!

@ekampf ekampf force-pushed the feature/expose_ndb_ids branch from 9947f38 to aa883ea Compare August 17, 2016 00:45
@ekampf
Copy link
Collaborator Author

ekampf commented Aug 17, 2016

@syrusakbary WDYT now?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 98.361% when pulling 80589b4 on feature/expose_ndb_ids into f354e7c on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 98.361% when pulling 80589b4 on feature/expose_ndb_ids into f354e7c on master.

@syrusakbary
Copy link
Member

Looks good!

@ekampf ekampf merged commit e166f88 into master Aug 17, 2016
@ekampf ekampf deleted the feature/expose_ndb_ids branch August 17, 2016 17:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants