[web2py] Re: list:string type field output format

2014-03-22 Thread Pedro Pisandelli
Hi Antony! This made too many things clear to me. I got the point about represent function, but i guess the DIV(db...represent(...)) must be at a view file... and what about appadmin? Trying to get the fields value through appadmin, I got the error *sequence item 0: expected string, long found*

[web2py] Re: list:string type field output format

2013-04-18 Thread Niphlod
check again: there's no way mine and Anthony's last snippets generates a single A holding two addresses On Thursday, April 18, 2013 4:04:26 AM UTC+2, 黄祥 wrote: thank you so much for your hints niphlod and anthony, i've tried both of your hints, but the result is not what i'm expected (no

[web2py] Re: list:string type field output format

2013-04-18 Thread 黄祥
yes, you are right, my mistake, the problem is on the data itself, because i input it via populate. thank you so much for your hints and suggestions -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop

[web2py] Re: list:string type field output format

2013-04-17 Thread 黄祥
thank you so much for your hint, anthony both of it is work well. {{extend 'layout.html'}} {{for i, row in enumerate(rows):}} {{=DIV(', '.join(row.test))}} {{=DIV(db.test.test.represent(row.test))}} {{pass}} On Wednesday, April 17, 2013 10:33:13 AM UTC+7, Anthony wrote: In the database, the

[web2py] Re: list:string type field output format

2013-04-17 Thread 黄祥
it seems can not make it work for the link, i've tried both, but same result {{=SPAN(T('Email : '), A(', '.join(row.email), _title=T('Send Email'), _target='_blank', _href='mailto:%s' % row.email), _id='email_%s' % i)}} {{=SPAN(T('Email : '), A(db.branch.email.represent(row.email),

[web2py] Re: list:string type field output format

2013-04-17 Thread Niphlod
then you want to have 2 separate A, one for each email! On Wednesday, April 17, 2013 9:41:02 AM UTC+2, 黄祥 wrote: it seems can not make it work for the link, i've tried both, but same result {{=SPAN(T('Email : '), A(', '.join(row.email), _title=T('Send Email'), _target='_blank',

[web2py] Re: list:string type field output format

2013-04-17 Thread Anthony
You have to make a comma-separated list of A()'s instead of inserting all the email addresses in a single mailto: ', '.join([A(email, _title=T('Send Email'), _target='_blank', _href='mailto:%s' % email) for email in row.email]) Anthony On Wednesday, April 17, 2013 3:41:02 AM

[web2py] Re: list:string type field output format

2013-04-17 Thread 黄祥
thank you so much for your hint anthony, it seems must be string type, when i try to use your hints it return an error *not work* {{=SPAN(T('Email : '), ', '.join([A(email, _title=T('Send Email'), _target='_blank', _href='mailto:%s' % email) for email in row.email]),

[web2py] Re: list:string type field output format

2013-04-17 Thread Niphlod
yep, html helpers aren't properly strings, so they can't be joined with a simple ','.join() However, you can do it with the CAT (from conCAT) try SPAN(T('Email'), CAT([A(email) for a in emails])) On Wednesday, April 17, 2013 11:12:26 PM UTC+2, 黄祥 wrote: thank you so much for your hint

[web2py] Re: list:string type field output format

2013-04-17 Thread Anthony
Sorry, wasn't thinking -- you could do: {{=SPAN(T('Email : '), XML(', '.join([A(email, _title=T('Send Email'),_target ='_blank', _href='mailto:%s' % email).xml() for email in row.email])), _id= 'email_%s' % i)}} Anthony On Wednesday, April 17, 2013 5:12:26 PM UTC-4, 黄祥 wrote: thank you

[web2py] Re: list:string type field output format

2013-04-17 Thread 黄祥
thank you so much for your hints niphlod and anthony, i've tried both of your hints, but the result is not what i'm expected (no error occured) {{=SPAN(T('Email : '), XML(', '.join([A(email, _title=T('Send Email'), _target='_blank', _href='mailto:%s' % email).xml() for email in

[web2py] Re: list:string type field output format

2013-04-16 Thread Anthony
In the database, the value is stored as a string with the individual values separated by pipe characters (i.e., |a|b|). However, when you select from the DB using the DAL, the value gets converted to a list. list:string fields get a default represent attribute that displays the values as a