[web2py] Re: cache.disk.clear() crashes in appadmin

2015-02-24 Thread Robin Manoli
Hey! I'm having the same issue here, however not in appadmin, but using cache.disk.clear in a controller instead. What did you change to fix this? Traceback (most recent call last): File "/web2py/gluon/restricted.py", line 224, in restricted exec ccode in environment File "/web2pyapplicat

[web2py] Re: cache.disk stores mysql password in a path visible to all!

2015-02-24 Thread Robin Manoli
Ok thanks guys! So I can fix the issue myself by editing that code you supplied, Leonel? I submitted the issue here: https://github.com/web2py/web2py/issues/820 Niphlod, actually the password is store in the filename, so anyone who has access to the file system would be able to read it. To read

[web2py] Re: bar chart

2015-02-24 Thread T.R.Rajkumar
Thank you Massimo. On Saturday, February 21, 2015 at 4:46:34 PM UTC+5:30, T.R.Rajkumar wrote: > > I want to display a bar chart. I went through the book, wiki plugins > widget bar chart. I am unable to comprehend the matter. So pl. tell me what > I should write in the controller and view to show

[web2py] only whole table search instead granular by field in grid?

2015-02-24 Thread Alex Glaros
is there a way to prevent granular field-specific search in grid? just want the top-level search (that searches all fields) and not the drop down that let's user choose which fields to search thanks Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http:

Re: [web2py] Re: rewrite the controller function for clarity

2015-02-24 Thread Ron Chatterjee
You explained very well Leonel, if you don't mind asking. What would be wrong if I do? news = dbOBJECT(dbOBJECT.news.category==request.args(0)).select() Instead of how its written. Same thing. Right? Basically, its like a "find" command in MATLAB. in the "set", if the category is 1, return the

[web2py] Re: confirm

2015-02-24 Thread Alex Glaros
is a social network app. Form asks user to accept, reject, or block member who is seeking to connect with other member. want "are you sure?" in case user accidentally chooses an unintended selection thanks Alex -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - ht

[web2py] Re: confirm

2015-02-24 Thread JorgeH
Hmmm For starters, why are you stating.. form = SQLFORM.*confirm *(whatever. ) On Tuesday, February 24, 2015 at 7:05:06 PM UTC-5, Alex Glaros wrote: > > This works: > > form = SQLFORM(db.Role, connection_request_id, formstyle='table2cols') > > what is syntax for adding confirm? Unsuc

[web2py] Re: Best approach for simultaneous async API calls

2015-02-24 Thread Dave S
On Tuesday, February 24, 2015 at 1:13:59 PM UTC-8, Niphlod wrote: > > [...] > > The thing is, usually webservers put a hard timeout on the time it takes > to generate a result, so if your "rest api calls" are taking more than > -e.g.- 60 seconds, the right thing to do is to avoid using the w

[web2py] confirm

2015-02-24 Thread Alex Glaros
This works: form = SQLFORM(db.Role, connection_request_id, formstyle='table2cols') what is syntax for adding confirm? Unsuccessfully tried many combinations, e.g., form = SQLFORM.confirm('Are you sure?',{'Cancel and go back':URL( 'view_suggestions')}, db.Role, connection_request_id,

[web2py] Re: Modifying "A" helper callback behavior

2015-02-24 Thread 黄祥
done ref: https://github.com/web2py/web2py/issues/819 thanks and 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

[web2py] did anyone ever tried to use cpickle inside web2py

2015-02-24 Thread Abhijit Chatterjee
Hello, wondering if anyone ever tried to use cpickle inside the controler function. I have done import cpickle from the src version n then tried to dump few variable like request, db but gave me an error. The idea was to debug them in standalone mode n then inject back into the controler -- Re

[web2py] Re: Creating my own layout.html, but errors not displaying

2015-02-24 Thread Niphlod
whoops. Then I need to rephrase (although the point remains the same)... response.flash is missing, everything referenced as "bootstrap" in static needs to be altered accordingly to static assets for AdminLTE, response.menu would need some tuning but yes...basically the mantra is "start

[web2py] Re: Creating my own layout.html, but errors not displaying

2015-02-24 Thread JorgeH
Of course, read what I wrote. Use an existing layout.html, and change what is inside the tags, leaving the rest intact. From there, start playing until you obtain what you want. On Tuesday, February 24, 2015 at 4:32:38 PM UTC-5, Niphlod wrote: > > > >> Hello >> An easy way is to grab the exis

[web2py] Re: Creating my own layout.html, but errors not displaying

2015-02-24 Thread Niphlod
> > Hello > An easy way is to grab the existing layout.html file that comes with > web2py > and change what is between the tags. > > example: > > > > > {{include}} > > > > > > > > > > > > Use this as a starting point, leaving the rest of the file intact and see > if that

[web2py] Re: Creating my own layout.html, but errors not displaying

2015-02-24 Thread JorgeH
On Monday, February 23, 2015 at 6:58:52 PM UTC-5, Tom Campbell wrote: > > Creating my own layout.html based on the AdminLTE theme > . It works, but errors are not > being displayed. For example, I have a notnull*=*True validation rule in > the 'descr

[web2py] Re: Best approach for simultaneous async API calls

2015-02-24 Thread Niphlod
woah. that's a lot of unconcerned copy-paste around the web. Did you even try to start "small" and then see what your issues would be ? let's take every statement in order. I need to render a page that requires a number of REST API calls to > external web services that take a significant amoun

[web2py] Re: cache.disk stores mysql password in a path visible to all!

2015-02-24 Thread Leonel Câmara
Yes I don't consider this high risk. The only problem I see is that people know that they have the password in db.py while they have no idea that it can also be in the cache if they use cacheable selects. Another problem is that this password can be seen by just reading the filename whereas you

[web2py] Re: manually update password

2015-02-24 Thread Niphlod
it should work without issues. the 'password' field has a validator attached that takes care of handling everything. On Tuesday, February 24, 2015 at 12:22:32 AM UTC+1, José Eloy wrote: > > Hello! > > I have an auth_user form with extra fields. To update a record I use a > SQLFORM and the update

[web2py] Re: First post: Is this a bug?

2015-02-24 Thread Niphlod
the first thing to be noted is that you'd need to define the referencED table before the referencING one. not strictly needed always but a good place to start. On Monday, February 23, 2015 at 11:44:43 PM UTC+1, Mat Miles wrote: > > db.define_table('daily_schedule', > Field('the_d

[web2py] Re: Creating my own layout.html, but errors not displaying

2015-02-24 Thread Niphlod
given that it seems that the layout is not web2py-specific, if you took it as it is, you're missing pretty much everything... the error shown in the forms are handled first thing by web2py widgets, that are coupled with a minimum of css to be displayed. On Tuesday, February 24, 2015 at 2:54:50 A

[web2py] Re: web2py on Microsoft Azure PAAS

2015-02-24 Thread Niphlod
web2py can be run on pretty much anything that supports wsgi. I don't see why not. On Tuesday, February 10, 2015 at 1:03:15 PM UTC+1, Gary Cowell wrote: > > Anyone any experience on deploying a web2py app on Microsoft Azure Web? > > Can it be done? > -- Resources: - http://web2py.com - http://w

[web2py] Re: cache.disk stores mysql password in a path visible to all!

2015-02-24 Thread Niphlod
+1 for handling consistently cache keys, but I'm not an advocate of "security by oscurity". File names in the cache folder aren't supposed to be read, and are not visible to anyone if not the administrator of the server. if access is granted to anybody, the password can be retrieved looking at

[web2py] Re: error: "name 'auth' is not defined" after upgrading web2py

2015-02-24 Thread Niphlod
2.5.1 to 2.9.12 is a pretty steep "upgrade". In theory, compilation could break only if you're switching interpreters (such as, python 2.6 to 2.7). On Tuesday, February 24, 2015 at 1:58:31 PM UTC+1, Ivan wrote: > > Hi, > I have upgraded web2py from 2.5.1 to 2.9.12 but a compiled app stopped to >

[web2py] Re: not web2py question - test timezone detection

2015-02-24 Thread Niphlod
I don't see any cons in the actual naming conventions, and frankly, no pros on the one you're suggesting...granted, web2py plugins won't work with django, but the same applies for django packages: they don't work on web2py. -- Resources: - http://web2py.com - http://web2py.com/book (Documentati

[web2py] Re: Is it possible to rename a database without using csv export/import?

2015-02-24 Thread Niphlod
usually when migrating an app from a server to another, you can just run the first request with migrate=True, fake_migrate_all = True and .table files are recreated as needed. Then you can turn faek_migrate_all = False and resume your work on models, without worries. -- Resources: - http://we

[web2py] Re: Change in application request.vars when switching from Rocket to Lighttpd+FastCGI

2015-02-24 Thread Niphlod
how did you setup lighttpd and fastcgi ? On Tuesday, February 24, 2015 at 7:41:11 PM UTC+1, Mike wrote: > > Hello, > I have been modifying an application deployment to use Lighttpd + FastCGI > instead of the built-in Rocket web server, and I have noticed that the app > controllers now get an emp

[web2py] Re: Modifying "A" helper callback behavior

2015-02-24 Thread Leonel Câmara
There's also another bug in web2py.js it only tests if it's an input or a button. It needs to check if it's an "A" too and use the same code as for the button. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://co

[web2py] Re: importing .csv to create DAL object

2015-02-24 Thread Greg Born
This is one approach. http://stackoverflow.com/questions/17799041/how-to-import-existing-mysql-database-into-web2py On Monday, February 23, 2015 at 1:44:27 PM UTC-7, Abhijit Chatterjee wrote: > > If I have an old site n mysql database. N want to convert to web2py, > rather than typing up the ent

[web2py] Best approach for simultaneous async API calls

2015-02-24 Thread gb
I need to render a page that requires a number of REST API calls to external web services that take a significant amount of time to return. What is the best approach to fire all of these calls simultaneously instead of sequentially? Should I try something like Celery: https://groups.goo

[web2py] Re: First post: Is this a bug?

2015-02-24 Thread Mat Miles
db.define_table('daily_schedule', Field('the_day', type='date', label='Schedule Day', requires=IS_NOT_EMPTY()), Field('assignment_type_id', type='reference assignment_type', label='Assignment', requires=IS_NOT_EMPTY()), format = '%(the_day)s') db.d

Re: [web2py] Re: pre filled fields SQLFORM for new entry in db

2015-02-24 Thread MAbeeTT
Thanks I was doing form.accepts(request, session, dbio=False...) before form.vars.name = request.post_vars.name Whe should be after. On Tue, Jan 20, 2015 at 3:24 PM, Nbush wrote: > Use default: > > db.person.name.default="MAbeeTT" > form = SQLFORM(db.person) > ... > > вторник, 20 января 20

[web2py] Confirm password placed after extra_fields

2015-02-24 Thread David Cash
Hi all, I've defined some extra_fields in auth_user, however the confirm password row appears after all the extra_fields, and not directly after the password field. Is this a bug? Is there a simple workaround? Thanks, David -- Resources: - http://web2py.com - http://web2py.com/book (Documenta

[web2py] Change in application request.vars when switching from Rocket to Lighttpd+FastCGI

2015-02-24 Thread Mike
Hello, I have been modifying an application deployment to use Lighttpd + FastCGI instead of the built-in Rocket web server, and I have noticed that the app controllers now get an empty request vars object. For example, previously this Form Button would call the 'assign_cmd' function with the pr

[web2py] Re: Modifying "A" helper callback behavior

2015-02-24 Thread Massimo Di Pierro
Can you please open a ticket? On Wednesday, 4 December 2013 14:49:38 UTC-6, Anthony wrote: > > I think you're supposed to be able to do: > > A(..., data=dict(w2p_disable_with=...)) > > but looks like there might be a bug in the A() code that prevents that > from working properly right now. > > An

[web2py] Re: Beginner Dropbox question

2015-02-24 Thread Massimo Di Pierro
yes. Look into this: https://github.com/web2py/web2py/blob/master/gluon/contrib/login_methods/dropbox_account.py It has methods and example about how to copy files (put/post) and do directory listings (dir) in dropbox. On Monday, 23 February 2015 18:09:53 UTC-6, Alex Glaros wrote: > > Am writing

[web2py] Re: wiki_editor group added to impersonated account

2015-02-24 Thread Massimo Di Pierro
Probably not. Can you open a github issue about this? On Monday, 23 February 2015 19:00:17 UTC-6, Calvin wrote: > > Hi > > When I access the wiki function with an impersonated account, the > impersonated account automatically gets added to the wiki_editor group at > least for the duration of the

[web2py] Re: Create many similar forms on one page

2015-02-24 Thread 黄祥
> > The LOad components is really helpful. However i seem to be loading the > same form in all my sections. > yes you are right. taken from book it said (components) : build modular applications that minimize server load and maximize code reuse > Can you perhaps help me out if you have tried

[web2py] Re: How can I modify the login form with Bootstrap

2015-02-24 Thread Annet
Hi, To get you started, in the user function after form = auth() put something like: if request.args(0) == 'login': form.element('input[name=username]').update(_class='form-control', _placeholder='Gebruikersnaam') form.element('input[name=password]').update(_class='form-control', _pla

Re: [web2py] Re: rewrite the controller function for clarity

2015-02-24 Thread Ron Chatterjee
Thank u leonel n Anthony. That was very helpful. Nice to have so many experts on this site! On Feb 24, 2015 9:58 AM, "Leonel Câmara" wrote: > 1) > > db is your instance of the DAL class. A class in python can have a > __call__ method. If it does, instances of that class can be called like > func

Re: [web2py] Re: SQLFORM.grid without database IO

2015-02-24 Thread Richard Vézina
You may also, just create your own form instead of grid one. Richard On Tue, Feb 24, 2015 at 10:34 AM, Anthony wrote: > Not exactly, but the grid does take onvalidation, oncreate, and onupdate > callbacks. You can also intercept form submissions by checking for "new" or > "edit" in request.args

[web2py] Re: rewrite the controller function for clarity

2015-02-24 Thread Ron Chatterjee
Thanks a lot massimo. U r the man! On Feb 24, 2015 10:41 AM, "Massimo DiPierro" wrote: > the DAL has only these API: > > db(query).select(….) > db(query).update(…) > db(query).count() > db(query).delete() > table.insert(…) > > which map into the corresponding SQL SELECT, UPDATE, COUNT, DELETE an

[web2py] Re: rewrite the controller function for clarity

2015-02-24 Thread Massimo DiPierro
the DAL has only these API: db(query).select(….) db(query).update(…) db(query).count() db(query).delete() table.insert(…) which map into the corresponding SQL SELECT, UPDATE, COUNT, DELETE and INSERT. If you define a table with db.define_table(‘person’,Field(‘name’)) than you refer to it by d

[web2py] Re: Is it possible to rename a database without using csv export/import?

2015-02-24 Thread Lisandro
I figured it out. I could confirm that web2py uses a hash to create the files under "databases" folder. If you check that folder, you will see that every table file is prepended with a hash text. That hash is generated based on the connection string. So in my case, I get the new hash and rename

[web2py] Re: SQLFORM.grid without database IO

2015-02-24 Thread Anthony
Not exactly, but the grid does take onvalidation, oncreate, and onupdate callbacks. You can also intercept form submissions by checking for "new" or "edit" in request.args and processing those outside of the grid. Anthony On Tuesday, February 24, 2015 at 12:22:50 AM UTC-5, mweissen wrote: > > T

[web2py] Re: How to trap and display database's backend errors when using SQLFORM.smartgrid ?

2015-02-24 Thread Anthony
You could do something like: try: grid = SQLFORM.smartgrid(...) except (db._adapter.driver.IntegrityError, db._adapter.driver.OperationalError) as e: [handle the error] You can also define error handles for the db table: db.mytable._on_insert_error = my_insert_error_handler db.mytable._

[web2py] Re: rewrite the controller function for clarity

2015-02-24 Thread Leonel Câmara
1) db is your instance of the DAL class. A class in python can have a __call__ method. If it does, instances of that class can be called like functions. Which is what your doing here with db(...). In this case the DAL's *__call__ *takes a query or nothing and returns a *Set *(not a python set,

[web2py] Re: rewrite the controller function for clarity

2015-02-24 Thread Anthony
This is all DAL syntax. I suggest you read the chapter on the DAL, particularly this section and this section (f

[web2py] How can I modify the login form with Bootstrap

2015-02-24 Thread Sarbjit
Hi, First of all, I am very sorry for asking this stupid question, but I have been learning Bootstrap and I just wanted to try it with the default scaffolding appliance. I want to modify the default login form as per bootstrap style, so I used the following in my models :- auth.settings.forms

[web2py] rewrite the controller function for clarity

2015-02-24 Thread Abhijit Chatterjee
Hello, Does anyone know how to rewrite this two contoller line? After model and view, I am trying to get familiar with controller and I am finding when a code is summarized, its hard to understand at times. Wondering if someone can break it down for me a little? first def: (1) categories = db

[web2py] How to trap and display database's backend errors when using SQLFORM.smartgrid ?

2015-02-24 Thread HarryE
I use SQLFORM.smartgrid for database Web interface. The backend performs some business rules on inserts/updates and raises some errors on occasions. How can I nicely display the returned error text to the user ( as in form.errors) and let him correct the problem, instead of being redirercted to

Re: [web2py] PDF view - set printing page size

2015-02-24 Thread Pavel
Really thanks José, your "labels" app help me with understanding fpdf. My apps is working now. "Little" problem is unicode characters. I tried examples from fpdf wiki pages, but without success. Fortunately all dynamic fields on our ID cars is numbers and characters without accent. Thanks -- R

[web2py] Re: not web2py question - test timezone detection

2015-02-24 Thread Mirek Zvolský
>> niphlod/w2p_timezone_plugin Nice. But I was solving this for a customer in a Cherrypy application. That leads me to one thing. I see you realy use the plugin_... name convention. Do you think is it good idea to follow this recommendation? Does it not lead to problems? I understand that contro

[web2py] Is it possible to rename a database without using csv export/import?

2015-02-24 Thread Lisandro
I have a website running with a database, and I want to make an exact copy of the website (that is, copy all web2py folder with its applications and all the stuff), and I would like to assign that new site an exact copy of the database, but with another name. I'm using postgresql, and I already

[web2py] name 'auth' is not defined after upgrading web2py

2015-02-24 Thread Ivan
Hi, I have upgraded web2py from 2.5.1 to 2.9.12 but a compiled app stopped to work issuing the error: name 'auth' is not defined The line number showed in the ticket refers to: @auth.requires_login() The app works if compiling it again with 2.9.12. Is it required to recompile all the compiled

[web2py] Re: cache.disk stores mysql password in a path visible to all!

2015-02-24 Thread Leonel Câmara
This is definitely a bug in the DAL. Probably a very old one that was made evident by the new lockless cache implementation. Passwords should never have been saved in the cache in raw format as the cache is not supposed to be safe for that. BaseAdapter does this in the select (

[web2py] Re: Manual--image blog--groups--manager & members

2015-02-24 Thread dangnearhere
Thanks Dave, here is the solution. As you suggested, I created a new record in auth_group called "manager". Then in auth_membership I created a new record for each of my users and assigned them each to the manager group. Now they can each access the management screen with their user names and

[web2py] cache.disk stores mysql password in a path visible to all!

2015-02-24 Thread Robin Manoli
Hi! I have some different queries cached using cache.disk, and I noticed that one query creates a file system path (in linux) that contains the mysql password, such as myapp/cache/mysql:/user:pass@localhost/app/SELECT... and this path has the permissions drwxr-xr-x! Is web2py really supposed to

[web2py] Re: Create many similar forms on one page

2015-02-24 Thread niki
hi Stifan The LOad components is really helpful. However i seem to be loading the same form in all my sections. Can you perhaps help me out if you have tried this before. I can see that the database does not even assign the comments to a certain form. How can i ensure each comment is associated