[web2py] Re: Formatting GRID rows data based on the field value in database

2014-06-07 Thread Anthony
def on_define_product(table): if 'product' in request.function : if table.signoff == 'No': table.signoff.represent = lambda signoff, field: SPAN(signoff, _class = 'text-error') elif table.signoff == 'Yes': table.signoff.represent = lambda

[web2py] Re: Adding information to certain input before added to db?

2014-06-07 Thread Anthony
Aside from the code below, somewhat simpler approaches would be to manipulate request.post_vars *before* calling SQLFORM, or using an onvalidation function (which allows you to change form.vars after validation but before the db insert). With those approaches, you don't have to manually do the

[web2py] Re: scheduler worker assignment and disable behavior

2014-06-07 Thread Niphlod
ok, my responses are inline your post On Friday, June 6, 2014 9:34:00 PM UTC+2, DeanK wrote: I'm have a few things that need clarification and am also experiencing some odd behavior with the scheduler. I'm using my app's db instance (mysql) for the scheduler. mysql is the

[web2py] Re: Formatting GRID rows data based on the field value in database

2014-06-07 Thread 黄祥
yes, you are right, my fault, my code only produce one color, thank you so much for your detail explaination, anthony. e.g. if 'product' in request.function : table.status.represent = lambda status, field: SPAN(status, _class = 'text-success' if status == 'Sold' else 'text-warning'

[web2py] Re: Formatting GRID rows data based on the field value in database

2014-06-07 Thread Anthony
Note, it would be more appropriate to use lambda status, row:, as the second value passed to the represent function is the Row object (not the Field object). You might be thinking of custom validators, which are passed the value being validated and the Field object. Anthony On Saturday, June

[web2py] Re: Create other autoincrement field besides the id on MongoDB

2014-06-07 Thread Massimo Di Pierro
If you use db = DAL('mongodb:...') tables get automatically an integer id field. It is not auto-increment and it is stored as a UUID by mongo. web2py converts the UUID to an integer and back so that web2py does not break. On Thursday, 5 June 2014 23:08:03 UTC-5, Leonardo Tada wrote: I know

[web2py] Re: what about the old web2py blog?

2014-06-07 Thread Massimo Di Pierro
It was not not been updated since web2pyslices.com On Friday, 6 June 2014 02:47:34 UTC-5, chuan137 wrote: It is quite helpful for me, I read it and like the way it explains things. But why is it called 'old'? The techniques are no longer ideal or it just stop updating? I wish there is such

[web2py] Re: join does not work, when enabling record versioning

2014-06-07 Thread Massimo Di Pierro
If you are doing a left join: db(db.person.id 0).select(db.person.ALL,db.thing.ALL,left=db.thing.on(db.thing.owner_id== db.person.id)) if you are doing an inner join: db(db.person.id 0).select(db.person.ALL,db.thing.ALL,join=(db.thing.owner_id==db.person.id )) which is equivalent to

[web2py] Bootstrap 3

2014-06-07 Thread Osswalt
Any plan to embed Bootstrap 3 into web2py ? Greg -- 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