[web2py] Re: represent how to send row id in args

2015-03-06 Thread Oliver Holloway
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

[web2py] Re: represent how to send row id in args

2015-03-06 Thread Anthony
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

[web2py] Re: represent how to send row id in args

2015-03-06 Thread Oliver Holloway
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

[web2py] Re: represent how to send row id in args

2015-03-06 Thread Oliver Holloway
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)

[web2py] Re: represent how to send row id in args

2015-03-06 Thread Oliver Holloway
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

[web2py] Re: represent how to send row id in args

2015-03-06 Thread Oliver Holloway
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

[web2py] Re: represent how to send row id in args

2015-03-06 Thread Anthony
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

[web2py] Re: represent how to send row id in args

2015-03-06 Thread Leonel Câmara
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

[web2py] Re: represent how to send row id in args

2015-03-06 Thread Oliver Holloway
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)),

[web2py] Re: represent how to send row id in args

2015-03-06 Thread Anthony
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

[web2py] Re: represent how to send row id in args

2015-03-06 Thread Oliver Holloway
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

[web2py] Re: represent how to send row id in args

2015-03-06 Thread Leonel Câmara
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

[web2py] Re: represent how to send row id in args

2015-03-06 Thread Oliver Holloway
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

[web2py] Re: represent how to send row id in args

2015-03-06 Thread Oliver Holloway
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).

[web2py] Re: represent how to send row id in args

2015-03-06 Thread Anthony
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