[web2py] best place to put style

2017-04-01 Thread 黄祥
what is the difference to put the style in static/css or put it on views/templates? *e.g.* *views/templates/style/loader.html* .loader { border: 3px solid #f3f3f3; border-radius: 50%; border-top: 3px solid blue; border-right: 3px solid green; border-bottom: 3px solid red; border-left: 3px solid

[web2py] Re: How to format the result of a sum()

2017-04-01 Thread 黄祥
of course you can do it in controller *e.g.* def index(): import locale sum = db.log.severity.sum() sum_result = db().select(sum).first()[sum] # float sum_result_formatted = DIV('%s' % (locale.format("%.2f", sum_result, grouping = True) ) ) # int #sum_result_formatted = DIV('%s' %

[web2py] Re: Forms with readonly fields

2017-04-01 Thread Anthony
On Friday, March 31, 2017 at 5:41:49 PM UTC-4, Joe Barnhart wrote: > > Anthony -- > > One more tiny but not insignificant detail... > > I found I had to add "requires=[]" to the custom.widget: > > [form.custom.widget[f.name].update(_readonly=True, requires=[]) for f > in readonly_fields] > >

[web2py] Re: I can't post into a DAL Field

2017-04-01 Thread Anthony
It is not clear what you are trying to do. You can only insert values in fields that exist -- there is no "name" field in your table, so you cannot insert a value for a "name" field. If you want to insert a value for "reply", then you must specify the "reply" field:

[web2py] Re: Any more elegant way to redirect to user login when updating a div by ajax callback if not auth.user

2017-04-01 Thread Paco Bernal
Sorry I lost my own question for almost a yer :S Finally I was doing this: def get_index(): if not auth.user: return 'Your session has expired, you have to %s again.' % A('login' , _href=URL('user', 'login')) or def remove_ref_blacklisted(): if not auth.user: return

[web2py] Re: Any more elegant way to redirect to user login when updating a div by ajax callback if not auth.user

2017-04-01 Thread Paco Bernal
Sorry I lost my own question for almost a year :S Finally I was doing this: def get_index(): if not auth.user: return 'Your session has expired, you have to %s again.' % A('login', _href=URL('user', 'login')) El domingo, 19 de junio de 2016, 6:33:47 (UTC+2), Anthony escribió: > > What

[web2py] I can't post into a DAL Field

2017-04-01 Thread Maurice Waka
I have this: Post =define_table('post' Field('message', 'text', requires=IS_NOT_EMPTY, notnull=True), Field('reply', 'text', requires=IS_NOT_EMPTY). auth.signatue ) Post.is_active.readable=False

[web2py] Re: How to format the result of a sum()

2017-04-01 Thread mkerins
Thanks for this, but is there no way to apply this formatting in the controller? My views are very simple, with tables being rendered simply with {{=tbl}}, so unless I'm missing something, I don't think I really have any way to apply the DIV as you suggested. Thanks. On Friday, March 31,

[web2py] JOB POST: set up routes for one web2py instance, several top level domains, and two apps per domain

2017-04-01 Thread Lisandro
Originally this was a question, but considering is something I need for my business, I added "JOB POST" to the title. If you consider that you know how to achieve what I need, I'm willing to pay for the work. Sorry if this is not the place to ask for a web2py developer (in that case, the post