Hi,
In this example you aren't fetching the query results at all. You should do
something like
query = GqlQuery("SELECT * FROM directions WHERE directions = :directions",
directions = form.cleaned_data["direction"])
my_directions = query.get()
self.extra_context['direction'] = my_directions.directionsid
-Marzia
On Mon, Jan 5, 2009 at 7:37 AM, Lacrima <[email protected]> wrote:
>
> Hello!
>
> I am trying to set some extra_context in my template using query.
>
> For example, I have the next model:
> class directions(db.Model):
> directions = db.StringProperty()
> directionsid = db.IntegerProperty()
> def __unicode__(self):
> return self.directions
>
> Then I try to access data depending on user input and to set
> extra_context. A bit of my code:
>
> ###
> query = GqlQuery("SELECT * FROM directions WHERE directions
> = :directions", directions = form.cleaned_data["direction"])
> self.extra_context["direction"] = directions.directionsid
> ####
>
> And finally, when I use {{direction}} in my template I just receive
> something like that:
> <google.appengine.ext.db.IntegerProperty object at 0x08583CF0>
> But I want my results to be human readable.
>
> What should I do?
> Looking forward to your replies.
>
> P.S.: Sorry for my English. If most isn't quite clear i"ll try to
> explain it in other way.
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---