From what I've read, this is how I should check for any records...
v = PC_Applications.all().filter('column =', value)
if not v:
return False
But this returns an error!
IndexError: The query returned fewer than 1 results
Any ideas to doing this? I've read that .count() is a bad option. I'm new to Python and App Engine so thank you for any patience!
if not v.get():
From App Engine, Query Class get()
Executes the query, then returns the first result, or None if the query returned no results.
This should work:
q = db.Query(PC_Applications, keys_only = True)
if not q.get():
return false
I think .all().filter('column =', value)
is even worse than .count
, because it's not doing a keys-only query.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With