You have:
form = SQLFORM.factory(Field("members", "list:string",
requires=IS_LIST_OF(IS_EMAIL(error_message="Invalid email found."))),
default=emails)
Try
form = SQLFORM.factory(Field("members", "list:string",
requires=IS_LIST_OF(IS_EMAIL(error_message="Invalid email found.")),
default=emails))
On Wednesday, 3 August 2016 05:20:50 UTC-5, Encompass solutions wrote:
>
> It seems that my SQLFORM.factory won't populate default values. Are you
> guys getting similar or am I doing this wrong?
> Here is what I am doing.
>
> emails = []
> for member in members:
> emails.append(member.email)
> form = SQLFORM.factory(Field("members", "list:string",
> requires=IS_LIST_OF(IS_EMAIL(error_message="Invalid email found."))),
> default=emails)
>
> I am hoping emails should actually be in the list but they don't show up.
> It shows a blank form, as attached. All other aspects of the form work
> just fine including the validation and repopulating the form if it was not
> valid.
> Any ideas?
> BR,
> Jason Brower
>
>
--
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.