[web2py] 'NoneType' object is not callable

2015-02-27 Thread Cory
Hi, I am having trouble logging into my website because of a 'Nonetype' not callable error. More specifically, I believe I am getting the error from current.sesssion.renew because it is None. The traceback is below. I have emptied the sessions folder and cleared my cookies on my browser to see

[web2py] How to use bootstrap or new layout file into web2py

2015-02-27 Thread Abhijit Chatterjee
I have downloaded a bootstrap file that consist of css, js, img, fonts folder and its associated file. Here is the link: http://startbootstrap.com/template-overviews/freelancer/ How do I import this layout into web2py but keep all my admins and login, menu from DAL but just use the image, slid

[web2py] Re: show_if is not working with SQLFORM.factory multitable

2015-02-27 Thread Leonel Câmara
I don't usually use show_if but I'm guessing it's because a db.purchase.have_coupon is not == to True. Which makes sense since it's a string. You can test in the python interpreter 'abc' == True, the result will be False. The correct form would be: db.purchase.coupon_code.show_if = (db.purch

[web2py] show_if is not working with SQLFORM.factory multitable

2015-02-27 Thread Ramkrishan Bhatt
HI Every one , Why show_if validation does't work with SQLFORM.factory(). Here is the one example , please provide the solution. Model db.define_table('client', Field('name')) db.define_table('address', Field('client',db.client,writable=False,readable=False), Field('street'),Field

[web2py] Re: File download - disable link when no files are available

2015-02-27 Thread P T
Thank you Leonel for taking the time to explain the syntax! Best Regards, PT On Friday, February 27, 2015 at 11:45:03 AM UTC-6, P T wrote: > > Hello All, > > Currently using Web2Py 2.8.2-stable+timestamp.2013.11.28.13.54.07 > > I have a simple page for announcing seminars and for downloading >

[web2py] Re: File download - disable link when no files are available

2015-02-27 Thread Leonel Câmara
The syntax is just regular python, what I've used is called a conditional expression which is python's version of the ternary operator. It has the form: a if test else b Which is equivalent to this in many languages: test ? a : b; So what's happen

[web2py] Re: File download - disable link when no files are available

2015-02-27 Thread P T
Thanks Leonel, it works great. But, I am stumped by the syntax. On Friday, February 27, 2015 at 11:45:03 AM UTC-6, P T wrote: > > Hello All, > > Currently using Web2Py 2.8.2-stable+timestamp.2013.11.28.13.54.07 > > I have a simple page for announcing seminars and for downloading > presentation

[web2py] Re: File download - disable link when no files are available

2015-02-27 Thread Leonel Câmara
Hey, How about this: db.seminars.sem_file.represent = lambda value,row:A('Download', _href=URL( 'download', args=value)) if value else "No Files Available" -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code

[web2py] File download - disable link when no files are available

2015-02-27 Thread P T
Hello All, Currently using Web2Py 2.8.2-stable+timestamp.2013.11.28.13.54.07 I have a simple page for announcing seminars and for downloading presentation files. Here are definitions for table, controller and view : db.define_table("seminars", Field('sem_date', 'date', label=

Re: [web2py] pycharm python console

2015-02-27 Thread Richard Vézina
Diogene, I think that Antonio want to use pycham python console like you would use python console started with web2py command line where you can make available web2py environnment and particularly access database models of a given application. Tim answer seems the way to go... I didn't test it th

[web2py] Re: Customize incoming POST data

2015-02-27 Thread Leonel Câmara
I'm a little confused by this question. You could do something like this: def POST(*args, **vars): if (some_controller_method(vars['desired_value'])): return something else: ??? return something_else I this what you need? -- Resources: - http://web2py.com - ht

Re: [web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-27 Thread Michele Comitini
Try too see if in production there is a transaction that stays open for a long time. It could be a console left open somewhere? 2015-02-27 8:42 GMT+01:00 Osman Masood : > Right. The purpose of using the console was to simulate what actually > happens in production. > > On Thu, Feb 26, 2015 at 11

Re: [Bulk] [web2py] Re: Use DAL as standalone

2015-02-27 Thread Michele Comitini
Repeating myself If you need DAL as a standalone package use pydal: https://github.com/web2py/pydal 2015-02-26 12:19 GMT+01:00 'Diogene Laerce' via web2py-users < web2py@googlegroups.com>: > > On 02/21/2015 12:56 AM, Cássio Botaro wrote: > > Do you clone the repository or use stable version

[web2py] select string expression from query

2015-02-27 Thread Manuele Pesenti
Hi *, let's say I got a table on a postgresql database (<=9.3) with native json support made like that: db.define_table('sitelog', Field('log', 'json'), auth.signature.created_on, auth.signature.modified_on ) introducing some records and knowing for example that the field "uuid" is a