Seem to be some issues. Right? Or may be something I am missing.

Field('link', 'list:string', requires=IS_URL()),

The above wouldn't work because the validator breaks. If I take off 
'list:string' from above field and type a wrong URL (let's say without 
 .com or something), the validator will protects such an entry. When 
list:string is inserted. Validator breaks.

same will be for 

Field('emails', 'list:string', requires=IS_EMAIL()),

And idk if its a bug or something. With regards to one to many. Isn't 
that's the purpose of 'list:string'? Basically one to -> many. 






On Monday, January 18, 2016 at 8:24:44 AM UTC-5, Manuele wrote:
>
> Il 18/01/16 02:36, Ron Chatterjee ha scritto: 
> > Thank you Massimo, 
> > 
> > It seems that will only work with string. But for an example of file 
> > upload validator, this wouldn't work. Or if I have a DAL validator 
> > like is URL(). In other words... Let's say I want someone to create a 
> > profile of his work by adding multiple url links to their portfolio 
> > using a same table. Or add couple of primary emails as a validator 
> > IS_EMAIL(). It wouldn't. 
> > 
> > 
> > db.define_table('news', 
> >                       Field('title', notnull=True), 
> >                       Field('link','list:string', requires=IS_URL()), 
> > #This is wrong 
> >                       Field('body', 'text'), 
> >                       Field('files','list:string','upload'), #This is 
> > wrong 
> I think that for a solution to the need of multiple file upload you have 
> to think of a one to many relation with a table in wich to save your 
> attachments. 
> Mind that in this case records in attachment table have to be created 
> only after your record exist in the "news" table. 
>
> Cheers 
>
>     Manuele 
>
>

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to