Anthony, thanks, I swapped vars back in and that works now. You must be
right, I must have made some other change, but I can't see what I did. At
any rate, this is working now, and I regret if I've wasted anyone's time.
On Friday, March 6, 2015 at 3:32:36 PM UTC-5, Anthony wrote:
>
> If vars=dic
If vars=dict(i=r.id) works, then so will args=r.id. More specifically, if
the latter generates an error saying the Row object has no attribute "id",
then the former would also generate the same error, as "r" is the same Row
object in both cases. I suspect you made some other change that made it
Hey! I switched to vars and it worked :) Thank you to all of you who
helped.
db.sessions.session_name.represent = lambda session_name, r: A(r.
session_name, _href=URL('demo', 'tests_for_this_eval', vars=dict(i=r.id)))
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentati
I've caused some confusion with my typos. Here's the code.
model
db.define_table('sessions',
Field('program_name', 'string', requires=IS_IN_DB(db,
db.programs.program_name)),
Field('session_type', 'string',
requires=IS_IN_SET(['practice', 'evaluation'], zero=None)
Hi, Anthony. I've posted the variations I've tried. As for the second
select, I should have excised that because it's unimportant right now.
On Friday, March 6, 2015 at 2:37:37 PM UTC-5, Anthony wrote:
>
> Is that the exact code, because you didn't change to args=row.id, and
> your second select
Sorry, I've been trying various combinations. Here's what I've tried, none
of them work.
#db.sessions.session_name.represent = lambda session_name, row:
A(row.session_name, _href=URL('demo', 'tests_for_this_eval',*
args=sessions.id*))
# global name 'sessions' is not defined
#db.sessions.sess
Is that the exact code, because you didn't change to args=row.id, and your
second select is still missing the "id" field?
Anthony
On Friday, March 6, 2015 at 2:23:48 PM UTC-5, Oliver Holloway wrote:
>
> Added sessions.id to the select, same thing. Here's the table definition
> and the controlle
You have 'db' instead of 'row' in your args.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the G
Added sessions.id to the select, same thing. Here's the table definition
and the controller. The id does show up on the view page, but isn't passing
as an arg.
db.define_table('sessions',
Field('program_name', 'string', requires=IS_IN_DB(db,
db.programs.program_name)),
On Friday, March 6, 2015 at 2:02:57 PM UTC-5, Leonel Câmara wrote:
>
> you need to write row.sessions.id
>
> You always need to be explicit in represents.
>
You need to be explicit in virtual fields (i.e., include the table name),
but I don't think that is the case with represent. I think the p
Hi, Leonel. When I do that, I get this error: 'Row' object has no
attribute 'sessions'
On Friday, March 6, 2015 at 2:02:57 PM UTC-5, Leonel Câmara wrote:
>
> you need to write row.sessions.id
>
> You always need to be explicit in represents.
>
--
Resources:
- http://web2py.com
- http://web2py.c
you need to write row.sessions.id
You always need to be explicit in represents.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message
This is the controller, in case that matters.
@auth.requires_membership('coach')
def show_list_of_sessions():
# get list of evaluations
evaluations =
SQLTABLE(db(db.sessions.session_type=='evaluation').select(db.sessions.session_name),
headers=None, truncate=128
When I try that, this error occurs: 'Row' object has no attribute 'id'
On Friday, March 6, 2015 at 1:47:08 PM UTC-5, Anthony wrote:
>
> It should be args=row.id, not args=db.session.id (the former is the value
> of the id for the current record, and the latter is the actual id Field
> object).
It should be args=row.id, not args=db.session.id (the former is the value
of the id for the current record, and the latter is the actual id Field
object).
Anthony
On Friday, March 6, 2015 at 1:37:22 PM UTC-5, Oliver Holloway wrote:
>
> In the following table, the session_name is represented as
15 matches
Mail list logo