Re: [web2py] .represent = ... in left join

2011-04-06 Thread Johann Spies
On 5 April 2011 15:51, Richard Vézina wrote: > About zero option, search in page for zero : > http://www.web2py.com/book/default/chapter/07 > > There is some explanation > near IS_IN_SET... > > Thanks. I found it. Johann -- May grace and peace b

Re: [web2py] .represent = ... in left join

2011-04-05 Thread Richard Vézina
I did not use export_to_csv for now... I just test it sometimes ago... But I guest you should define your .represent for stream table before try to apply them to your csv output... Hope it helps. Richard On Tue, Apr 5, 2011 at 3:27 AM, Johann Spies wrote: > On 5 April 2011 09:16, Johann Spies

Re: [web2py] .represent = ... in left join

2011-04-05 Thread Richard Vézina
About zero option, search in page for zero : http://www.web2py.com/book/default/chapter/07 There is some explanation near IS_IN_SET... There maybe more detailed information somewhere else too... I don't use it in my code since it arrive after I start

Re: [web2py] .represent = ... in left join

2011-04-05 Thread Johann Spies
On 5 April 2011 09:16, Johann Spies wrote: > > Thanks! That solved the problem. I could not find something in the book > about a 'zero option' though. > > Now .represent works on the screen but not in the CSV-output. I have used: {{ import cStringIO stream=cStringIO.StringIO() rows.export_to_

Re: [web2py] .represent = ... in left join

2011-04-05 Thread Johann Spies
On 4 April 2011 16:11, Richard Vézina wrote: > Are course_week1 and course_week2 not null?? > > No. > If not you need ...requires=IS_NULL_OR(IS_IN_DB(your requires) and in > ...represent= you should use zero option (see book about that) or something > like that : > > db.t_registration_form.cour

Re: [web2py] .represent = ... in left join

2011-04-04 Thread Richard Vézina
Are course_week1 and course_week2 not null?? If not you need ...requires=IS_NULL_OR(IS_IN_DB(your requires) and in ...represent= you should use zero option (see book about that) or something like that : db.t_registration_form.course_week1.represent=\ lambda value: (value!=None and "%(code)s"

[web2py] .represent = ... in left join

2011-04-04 Thread Johann Spies
I want to get a proper representation of a field in the result of a left join but am struggling to do so. Here is a simplified version of the problem. db.define_table('courses', Field('week','integer', requires=IS_IN_SET([1,2]), widget = SQLFORM.widgets.r