[web2py] Re: Trying to port django app to web2py

2017-01-02 Thread LoveWeb2py
Answered by the Godfather himself. Thank you, Massimo. Great explanation! On Monday, January 2, 2017 at 12:25:54 AM UTC-5, Massimo Di Pierro wrote: > > > In web2py you would do > > CLASS_TYPE = (('field1', 'Field1'), ('field2', 'Field2')) > > db.define_table('myclass', > Field('type',

[web2py] Re: Trying to port django app to web2py

2017-01-01 Thread Massimo Di Pierro
In web2py you would do CLASS_TYPE = (('field1', 'Field1'), ('field2', 'Field2')) db.define_table('myclass', Field('type', length=12, requires=IS_IN_SET(CLASS_TYPE)), Field('name',length=10), Field('set','boolean',default=False), Field('isset','boolean',default=False),

[web2py] Re: Trying to port django app to web2py

2017-01-01 Thread LoveWeb2py
Here is what I'm really trying to do: *class MyClass(models.Model):CLASS_TYPE = (('field1', 'Field1'), ('field2', 'Field2'))type = models.CharField(max_length=12, choices=CLASS_TYPE) name = models.CharField(max_length=10)set = models.BooleanField(default=False)isset =