黄祥 you were right!
I fixed the issue just by copy pasting your first solution.
Very stange as I tries a almost identical solution that failed.
I tried something like:
edit_in_form = 'edit' in request.args
db.product.price.readable = db.product.price.writable = not edit_in_form

your second solution fails though I think it's because the request.args[-3] 
== 'edit' is always false and edit is not contained in de normal url it's 
only [-3] after you click the edit button. edit doesn't exist until then.

the thing I don't understand is why it errors out on me. it should just 
pass it when the condition is False.

At least I got it to work thank you so much! 

On Wednesday, December 4, 2013 1:11:25 AM UTC+1, 黄祥 wrote:
>
> App/default/product/edit/(record id)?(hmac)
>>
>
> if my logic is correct the edit is args so :
> edit_in_form = 'edit' in request.args
> or
> edit_in_form = request.args[-3] == 'edit'
> should work
>
> are you sure? i've tested right now, both is work in mine. tested in 
> web2py 2.8.2 windows binary on windows 7.
>
> best regards,
> stifan
>

-- 
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/groups/opt_out.

Reply via email to