google-app-engine


How to get only a key—without loading the entity—from ReferenceProperty in GAE?


When ReferenceProperty is accessed it loads an entity from datastore, but sometimes I'd like only to use a referenced model key only and I don't want to pay the additional cost of referenced model loadup.
Is there a way to access just the key on a ReferenceProperty?
Given
class Foo(db.Model):
bar = db.ReferenceProperty()
and
foo = Foo.get_by_id(1) # or however you get it
you can retrieve the key foo's bar ReferenceProperty like so:
key = Foo.bar.get_value_for_datastore(foo)

Related Links

Google Datastore - Search Optimization Technique
Can't lease tasks by service account
Why custom domain “myapp.com” which replaces “myapp.appspot.com” took so long to load when comparing to “myapp.appspot.com”?
Does objectify have a get_or_insert equivalent
Custom domain from google not routing to App engine site
Unable to stop or delete datalabs environment on Google Cloud Platform
Is there a way to interactively create a new Datastore entity kind for Go GAE apps?
Is IP address from GoogleAppEngine URLFetch in same project static?
Index Disadvantages
Communications link failure when connect to Google Cloud SQL(second gen) only from prod
How do I add a Google Cloud Endpoints Module to my Android project in IntelliJ?
Does anyone know how to configure grunt-gcloud?
Can I have two instances on same App Engine project - Java servlet and Endpoints side by side?
Validate appspot application for mailgun
Google App Engine: Development only route in app.yaml
Google App Engine: Only serve existing files in static directory

Categories

HOME
embedded
delphi-7
amp-html
nunit
battery
components
rendering
alarm
tivoli
mips
big-o
regular-language
android-json
jax-ws
boto3
barcode
jquery-ui-sortable
mautic
shared-libraries
renjin
package-managers
aws-sdk
selinux
comparator
asymptotic-complexity
spotipy
sinch
paperjs
jaws
corenlp-server
complex-numbers
paragraph
utorrent
quickfixj
autolisp
linkedhashmap
reverse
searchkit
parse-tree
docfx
timing
google-data-api
news
apache-stanbol
plr
tcc
angular-http
oim
jquery-ui-draggable
dbcontext
tinymce-3
posixct
headless
smartfoxserver
omxplayer
reporting-services-2012
latin
async.js
spring-cloud-feign
mta
freepbx
nupic
toast
cgi-bin
batik
haskell-warp
jquery-forms-plugin
xmltype
nodelist
angular-gettext
sip-server
structuremap3
kissfft
grails-domain-class
vsx
twitter-bootstrap-rails
mt4j
cnf
asplinkbutton
redis-py
cakephp-1.2
cuda-gdb
google-ajax-api
vs-android
visualj#
xpsdocument
sqlobject
business-model
wcf-proxy

Resources

Encrypt Message