0

I have this code:

my_table = db.define_table('my_table',
    Field('mt_table_id', 'id', requires=[IS_NOT_EMPTY()]),

I need to add something like requires= IS_LIST() to get a list e.g. ['a','b','c'] instead of ['a,b,c']. How is that done?

Stephen Byrne
  • 7,400
  • 1
  • 31
  • 51
user3346746
  • 327
  • 3
  • 14

1 Answers1

0

I ain't got what you meant, but perhaps you should look at custom validators section in web2py's book: http://www.web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-validators

You may create a custom validator called IS_LIST() and change the "formatter" method to return a list in the way that you want.

Matheus CAS
  • 161
  • 3
  • 4