Re: [web2py] Re: SmartGrid Add make a Fld Readonly

2014-03-18 Thread Dan Kozlowski
I found the problem after hours of testing different things. It was my mistake. I was using *writeable* when it should have been *writable*. Works perfect now. Thanks for your help On 03/17/2014 06:39 PM, 黄祥 wrote: had you already try to simplify or minimalist your app first? e.g. def client

Re: [web2py] Re: SmartGrid Add make a Fld Readonly

2014-03-17 Thread Dan Kozlowski
I am getting the same result with a minimalist controller. The field still takes a date and updates. Do you think that is a bug or something that can not be done ? On 03/17/2014 06:39 PM, 黄祥 wrote: had you already try to simplify or minimalist your app first? e.g. def clients(): write_in

Re: [web2py] Re: SmartGrid Add make a Fld Readonly

2014-03-17 Thread 黄祥
had you already try to simplify or minimalist your app first? e.g. def clients(): write_in_form_new = 'new' in request.args if write_in_form_new: db.clients.add_date.writeable = False grid = SQLFORM.smartgrid(db.clients) return locals() best regards, stifan -- Resources: - ht

Re: [web2py] Re: SmartGrid Add make a Fld Readonly

2014-03-17 Thread Dan Kozlowski
I see what you are doing but still does not work. My code is below. Could I have my code in the wrong location ? def clients(): write_in_form = 'new' in request.args or 'edit' in request.args if write_in_form: db.clients.add_date.writeable=False ##db.clients.add_date.readable=Tru

Re: [web2py] Re: SmartGrid Add make a Fld Readonly

2014-03-17 Thread 黄祥
i'm sorry, my bad : # check if new or edit is in args (url) write_in_form = '*new*' in request.args or '*edit*' in request.args db.table_name.date_field_1.writeable = not write_in_form db.table_name.date_field_2.writeable = not write_in_form or another way around # check if new or edit is in ar

Re: [web2py] Re: SmartGrid Add make a Fld Readonly

2014-03-17 Thread Dan Kozlowski
This does not seem to work. Maybe I am asking wrong. I have 2 date fields that get updated from a batch process so I need to restrict them from input on the create and edit form. Thanks On 03/14/2014 10:11 PM, 黄祥 wrote: i think you can achieve it using conditional for that. e.g. write_in_for