what version of web2py are you using ?

On Saturday, April 11, 2015 at 6:00:33 AM UTC+2, Thomas Sitter wrote:
>
> Hello,
>
> I have the following in my db.py file:
>
> db.define_table('customer',
>> Field('firstname'),
>> Field('lastname'),
>> Field('account', unique=True, length=12),
>> Field('email', unique=True, length=255),
>> Field('phone', unique=True, length=255),
>> Field('addr'),
>> Field('city'),
>> Field('postal'),
>> Field('signup_date', default=now),
>> Field('recruited', 'boolean'),
>> Field('recruitment_date'),
>> Field('dropped_out', 'boolean'),
>> Field('dropout_date'),
>> Field('service_type'),
>> format = '%(lastname)')
>
>
> as well as these restraints
>
> db.customer.firstname.requires = IS_NOT_EMPTY()
>> db.customer.lastname.requires = IS_NOT_EMPTY()
>> db.customer.email.requires = IS_EMAIL()
>> db.customer.signup_date.writeable = db.customer.signup_date.readable = 
>> False
>> db.customer.recruited.writeable = db.customer.recruited.readable = False
>> db.customer.recruitment_date.writeable = 
>> db.customer.recruitment_date.readable = False
>> db.customer.dropped_out.writeable = db.customer.dropped_out.readable = 
>> False
>> db.customer.dropout_date.writeable = db.customer.dropout_date.readable = 
>> False
>> db.customer.service_type.writeable = db.customer.service_type.readable = 
>> False
>
>
> And this controller:
>
> def register():
>>     form=SQLFORM(db.customer)
>>     return dict(form=form)
>
>
> But when I insert my form into a view I get all of the fields -- readable 
> and writeable seem to be ignored. I'm using mysql as my database. What am I 
> doing wrong?
>
> Thanks!
> Tom
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to