google-app-engine


why does gql query result cause exception when calling get()


I am attempting to retrieve an entry from my datastore with this:
query = UserData.gql("WHERE mDeviceId = :1", id)
Utils.log("my Object:" + str(query))
entry = query.get()
It just so happens that the variable 'id' doesn't even exist (typo), so I know how to fix this, but I don't understand why the result I get won't let me call get() on it. When I do, I get the error:
Exception: Unsupported type for property : <type 'builtin_function_or_method'>
Normally I just check if entry == None to see if I get no results. Does anyone know why this occurs and if I should be doing my checks for None differently, in case I have such typos in the future?
A variable named id is not defined in your code, so it passes the builtin function id, and QL complains that it's getting a function when it expected a value (integer?).
Check to make sure you're assigning id a value before you use it.
Even better, don't shadow builtins with your own variables-- it'll cause confusing errors like this. :-)

Related Links

Solr Timeout error even data is instered
Why does BigQuery fail to parse an Avro file that is accepted by avro-tools?
Insufficient Permission with Appengine Flex service account to access Drive folder
Getting Invalid Key message thrown when creating child records
Where do I find the pricing for the different frontend instance types?
Missing index on specific entities in app engine
Get current deployed timestamp in AppEngine/Go
Jersey throwing exception in Google App Engine
Uploading >10k files as static content to GAE
Dealing with large zip uploads and extracting using google cloud
Android Studio not recognizing gradle 2.10
How to solving ImportError: No module named scraping
Securely providing external service credentials to Google App Engine?
Arduino make GET request to Google app engine
Is my GAE Search corrupt?
Jinja2 reuse templates for new and edit

Categories

HOME
android
windows
algorithm
oracle12c
adal
design-patterns
ggplot2
angular-formly
apache-spark-mllib
battery
pclxl
ms-access-2016
aws-cli
switch-statement
visual-studio-emulator
tvos
jtextpane
retrofit2
ibeacon-android
glyphicons
searchview
git-extensions
charles
symbols
cgbitmapcontext
event-store
exploit
object-storage
dapper-extensions
beautifier
has-and-belongs-to-many
firebase-analytics
paperjs
user-defined-functions
sqsh
calculation
cart
fstream
card.io
vue-chartjs
getpixel
fiware-cygnus
xajax
magento-1.9.2.4
graphhopper
xdocreport
tasm
azure-arm
xv6
apriori
angular-http
apache-directory
builder
tinymce-3
google-cse
corruption
wpas
modelsim
sundials
css-transforms
structuremap4
android-instrumentation
sandcastle
ziparchive
signalr.client
jquery-jscrollpane
dup
spreadjs
data-protection
blitline
crouton-os
finalbuilder
apache-commons-daemon
google-refine
actionfilterattribute
bcache
infosphere-spl
webfinger
teaspoon
insight.database
renderer
decoupling
twitter-bootstrap-rails
menubar
cfcache
gae-quotas
koala
windows-embedded-standard
spring-3
eclipse-kepler
away3d
hidapi
composite-component
http-status-code-410
panda3d
mkv
sentestingkit
lambdaj
urlrewriter
maven-1
interprocess
web-garden

Resources

Encrypt Message