[web2py] Re: smartgrid - limit which fields are editable after creation of record

2013-04-13 Thread 黄祥
thank you so much for your hints niphlod, i've test it and work well : db.define_table('test', Field('test'), Field('test_read'), Field('test_write'), format='%(test)s') # not show in new and edit page show_test = request.args(-2) == 'new' or request.args(-3) == 'edit' db.test.tes

[web2py] Re: smartgrid - limit which fields are editable after creation of record

2013-04-12 Thread Niphlod
you're not doing the right checks. I posted a reply directly on the issue. -- --- 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.

[web2py] Re: smartgrid - limit which fields are editable after creation of record

2013-04-09 Thread 黄祥
yes, sure, i've tested it from scratch. the issue created : Issue 1440 thanks -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails

[web2py] Re: smartgrid - limit which fields are editable after creation of record

2013-04-09 Thread Massimo Di Pierro
It should work. Are you sure it does not? If so please open a ticket and link this thread. On Tuesday, 9 April 2013 02:56:35 UTC-5, 黄祥 wrote: > > why this can't work for readable? i've tried > with db.thetable.thefield.readable = (request.args(-2) == 'new') but the > result is not expected. >

[web2py] Re: smartgrid - limit which fields are editable after creation of record

2013-04-09 Thread 黄祥
why this can't work for readable? i've tried with db.thetable.thefield.readable = (request.args(-2) == 'new') but the result is not expected. on edit and view i still can read the field. anyone know about this? thank you -- --- You received this message because you are subscribed to the Goog

[web2py] Re: smartgrid - limit which fields are editable after creation of record

2013-04-02 Thread DeanK
I didn't understand how smartgrid was using request.args which was my main problem. Now that you and massimo pointed it out i've played around and see what is going on. I've got 3 grids in 1 page editing a bunch of tables in a controlled fashion with just a few lines of code. not bad web2py.

[web2py] Re: smartgrid - limit which fields are editable after creation of record

2013-04-02 Thread Cliff Kachinske
Dean, You need to brush up on Python sequences and slicing. Try this: db.thetable.thefield.writable = (request.args(-2) == 'new') request.args[0] is valid Python but it returns an index out of range error if request.args is empty. request.args(0) returns None. Same with request.args(-x) Yo

[web2py] Re: smartgrid - limit which fields are editable after creation of record

2013-04-01 Thread DeanK
So I'm not sure if I understand this one-liner to properly use it. Request.args(-1) doesn't quite make sense to me...i would think you'd have to index into it starting at 0? If I place the line in the model or in my function that renders the smartgrid form the field is disabled completely. If

[web2py] Re: smartgrid - limit which fields are editable after creation of record

2013-04-01 Thread Massimo Di Pierro
Yes: db.thetable.thefield.writable = (request.args(-1) == 'new') On Monday, 1 April 2013 17:31:16 UTC-5, DeanK wrote: > > I've been searching and haven't seemed to find someone trying to do this > yet. I'm wondering if there is a way to use the smartgrid, but limit what > fields can be edited