user_data = web.ctx.db.select('role',
what="id, name, email, administrative_division",
where="email=$user_input_email",
vars={"user_input_email":user_input.email}
).list()
print user_data[0].name
Use the "list" method on your database query to load the complete result into
memory as a python list. Can be dangerous with queries that return a lot of
results.
Am 25.07.2013 16:56, schrieb Claudio Dusan Vega Ozuljevich:
> Hi guys.
>
> I got this statement
>
> user_data = web.ctx.db.select('role',
> what="id, name, email,
> administrative_division",
> where="email=$user_input_email",
> vars={"user_input_email":user_input.email}
> )
>
> now my question is, if I want to access just the name, how do I do it?
>
> I'm using the following statement, but I think is a wrong way to do it.
>
> for data in user_data:
> print data.name
>
> is there a way to access the parameter name or any other without using
> the for in.
>
> Thanks in advance!
>
--
http://1x-upon.com/~despens/ >NEW!<
http://noobz.cc/
http://contemporary-home-computing.org/1tb/
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/groups/opt_out.