[web2py] Re: cannot operate on a closed database

2014-05-10 Thread jc
Have you read the items that result from a search in this group on "ProgrammingError: Cannot operate on a closed database"? There a lot of hits with varyious causes. I had a similar problem the other day and the items which described my error were: https://groups.google.com/forum/#!searchin/web

[web2py] Re: cannot operate on a closed database

2014-05-10 Thread Wonton
Hello Jc, Yes, I forgot to say that, but I read and tried all posts related to this issue, but none of them seems to be the cause of my problem. Anyway, since this morning everything is working again and *I haven't changed anything*!! But, it seems that the server has started to work again once

[web2py] Re: Web2py isn't loading my custom css file

2014-05-10 Thread Massimo Di Pierro
Use Chrome and inspect the tag that is not styled. Probably there is a conflict about your style and bootstrap.css. On Friday, 9 May 2014 12:38:59 UTC-5, ari northage-orr wrote: > > Hey Everyone, > > So I'm working on a website for a few friends who make music together and > I have a custom css

[web2py] Security of serving static files referenced in DB

2014-05-10 Thread Mark Graves
Hey everyone, So I have a bunch of static files, managed by the database, which are not proprietary. They will be public content on the web site. I put them in the static folder so they can be served by Apache instead of streamed by web2py. As I developed, I put a link in to download these f

[web2py] Re: color cells based on value in SQLFORM

2014-05-10 Thread Michael Beller
I learned this method from one of Massimo's lecture video's: At the top of your model file: # function to allow models to set status style def show_status(status,row=None): return SPAN(status.f_name.replace(' ','_'),_class=status.f_name) ifstatus else status After your table definition (coul

[web2py] Re: color cells based on value in SQLFORM

2014-05-10 Thread Anthony
Not tested, but another option would be to keep something like your current code (though you can simplify by creating just a single version of the SPAN code and fill in the color via a lookup in a dictionary, as in my previous example), but instead of setting style attributes in your represent

[web2py] Re: Security of serving static files referenced in DB

2014-05-10 Thread Anthony
Note, even when serving files from the /uploads folder via response.download(), the links still include the web2py obfuscated filename -- so no difference when serving from /static. The transformed filenames include the table and field name as well as (1) a 16 character fragment from a UUID and

[web2py] Re: represent in form field

2014-05-10 Thread Michael Beller
If you're using a custom form for input fields, you may need to invoke represent() explicitly. I found this in https://groups.google.com/forum/#!searchin/web2py/number$20format/web2py/Rn587zKW8MU/lzwVJw7naucJ : {{=db.table.column.represent(record.column, record)}} If you're using CRUD or Grid

Re: [web2py] Re: Security of serving static files referenced in DB

2014-05-10 Thread Mark Graves
Thanks Anthony, I really appreciate the sanity check. On Sat, May 10, 2014 at 1:07 PM, Anthony wrote: > Note, even when serving files from the /uploads folder via > response.download(), the links still include the web2py obfuscated filename > -- so no difference when serving from /static. > >

[web2py] Re: is CAT() causing RuntimeError: maximum recursion depth exceeded in cmp ?

2014-05-10 Thread Niphlod
I'd even go for tds = [] for piece in loop: tds.append(...) result = TR(*tds) On Friday, May 9, 2014 10:35:43 PM UTC+2, SimonD wrote: > > Anthony, thanks for the quick reply. Very appreciated. > That confirms my suspicions. Thanks also for the alternative code. > Simon > > > On Friday, May

[web2py] Re: represent in form field

2014-05-10 Thread 黄祥
thank you so much for the link e.g. work but not interactive db.product.price.widget = lambda field, value: SQLFORM.widgets.string.widget(field, format(value, ",d").replace(",", ".") ) what i mean is when user input in the form field it's not automatically add the thousand separator, thousand se

[web2py] Re: represent in form field

2014-05-10 Thread Anthony
On Saturday, May 10, 2014 2:11:04 PM UTC-4, Michael Beller wrote: > > If you're using a custom form for input fields, you may need to invoke > represent() explicitly. I found this in > https://groups.google.com/forum/#!searchin/web2py/number$20format/web2py/Rn587zKW8MU/lzwVJw7naucJ > : > > {{=db

[web2py] Re: represent in form field

2014-05-10 Thread 黄祥
i tried using jquery to face this, but it's only work for the first change, the others change is not effected, it seems like the twitter bootstrap enforce the form field (i guessed). e.g. *views/layout.html* *views/default/product.html* {{extend 'layout.html'}} {{=grid}} jQuery(document).rea

[web2py] Re: appointment application doesn't work out of box

2014-05-10 Thread LoveWeb2py
Is there any interest in fixing this app or how I could fix it? On Sunday, April 20, 2014 6:02:03 PM UTC-4, LoveWeb2py wrote: > > Hello, > > I'm trying to create a website for my Mom that she can use to book > appointments. She has a day spa and really could use something like the > appointment

Re: [web2py] Re: appointment application doesn't work out of box

2014-05-10 Thread Roberto Perdomo
Hello, Try changing the line 8 in default/appointment_read.html: {{for t,f in db.t_appointment._referenced_by:}}{{if not t[-8:]=='_archive':}}[{{=A(t[2:],_href=URL('%s_select'%t[2:],args=(f, form.record.id)))}}]{{pass}}{{pass}} to this: {{for f in db.t_appointment._referenced_by:}}{{t=f.tablena

Re: [web2py] Re: appointment application doesn't work out of box

2014-05-10 Thread Roberto Perdomo
This line can work too: {{for x in db.t_appointment._referenced_by:}}{{t,f = x if isinstance(x,tuple) else (x.tablename,x.name)}}{{if not t[-8:]=='_archive':}}[{{=A(t[2:],_href=URL('%s_select'%t[2:],args=(f, form.record.id)))}}]{{pass}}{{pass}} You can replace that form with a grid: http://web2p

Re: [web2py] Re: appointment application doesn't work out of box

2014-05-10 Thread LoveWeb2py
Thanks, Roberto! Works great now! On Saturday, May 10, 2014 9:51:28 PM UTC-4, Roberto Perdomo wrote: > > This line can work too: > > {{for x in db.t_appointment._referenced_by:}}{{t,f = x if > isinstance(x,tuple) else (x.tablename,x.name)}}{{if not > t[-8:]=='_archive':}}[{{=A(t[2:],_href=URL('%