I create an entity like so:
company = dbDatafile(usOwner = user)
company.name = self.request.get("name")
company.put()
where user is the Google User account. Now when I try to search on that user like:
datafiles = dbDatafile.gql("WHERE usOwner = '%s'" % user.user_id())
assign to a jinja2 template var:
template_values = {
'datafiles': datafiles
}
and output to html:
{% for datafile in datafiles %}
>>>{{ datafile.name }} chevrons to indicate any looping
{% endfor %}
i get no output.
The data is there in the admin dashboard but I can’t access it. Any ideas?
Thanks
If
usOwneris a UserProperty, you need to useUSER()in GQL:Also remember always to use placeholders, not string interpolation – just because it’s not SQL, doesn’t mean it’s not vulnerable to injection.