You can make the field integer and then do
db.mytable.myfield.requires=IS_IN_SET(range(3),('dog','cat','mouse'))
This would be a enum.
Massimo
On 22 Apr, 07:27, Michal Jursa <[email protected]> wrote:
> Validation is done by web2py and database field is string as you've
> said. This is so due to database compatibility i think. Not every
> database supported by web2py provides ENUM type.
>
> Michal
>
> Álvaro Justen [Turicas] wrote:
> > On Wed, Apr 22, 2009 at 9:20 AM, Michal Jursa <[email protected]> wrote:
> >> Just use:
>
> >> SQLField('field_name', requires = IS_IN_SET(['val1', 'val2'])
>
> > Ok, I'm doing this way, but my doubt is: how web2py will handle this?
> > Will it be a 'string' field with validation made by web2py or will it
> > be a ENUM() field (example, in MySQL)?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---