[web2py] Latest Trunk - problem with auth(session) and login using 'remember me'
I know there are some changes in session internals in trunk, so just reporting an issue I observed. When I login using 'Remember me' checked, I'm getting this error below. Without 'remember me' its working just fine. I tried to remove all session files but still the same consistent behaviour ... Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. Traceback (most recent call last): File C:\java\web2py\gluon\restricted.py, line 217, in restricted exec ccode in environment File C:/java/web2py/applications/gapps/models/03_db.py http://web2py2.tcl-digitrade.com/admin/default/edit/gapps/models/03_db.py, line 49, in module auth = Auth(db) File C:\java\web2py\gluon\tools.py, line 1229, in __init__ auth.expiration KeyError: 'session_id_gapps' Error snapshot [image: help]http://web2py2.tcl-digitrade.com/admin/default/ticket/gapps/127.0.0.1.2013-08-22.09-11-58.ff9c728c-27f4-4f34-bddc-23c433cef9fe# type 'exceptions.KeyError'('session_id_gapps') inspect attributes Frames - *File C:\java\web2py\gluon\restricted.py in restricted at line 217* code arguments variables - *File C:\java\web2py\applications\gapps\models\03_db.py in module at line 49* code arguments variables - *File C:\java\web2py\gluon\tools.py in __init__ at line 1229* code arguments variables Function argument list (self=gluon.tools.Auth object, environment=DAL uri=sqlite://storage.sqlite, db=DAL uri=sqlite://storage.sqlite, mailer=True, hmac_key=None, controller='default', function='user', cas_provider=None, signature=True, secure=False) Code listing 1224. 1225. 1226. 1227. 1228. 1229. 1230. 1231. 1232. 1233. # for remember me option response = current.response if auth and auth.remember: # when user wants to be logged in for longer response.cookies[response.session_id_name][expires] = \ auth.expiration if signature: self.define_signature() else: self.signature = None -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Latest Trunk - problem with auth(session) and login using 'remember me'
Updated from mercurial and its working for me now, thank you! ... I'm using default filesystem sessions ... Dne čtvrtek, 22. srpna 2013 9:37:22 UTC+2 Massimo Di Pierro napsal(a): I think it is solved in trunk (committed to googlecode only, github is down today). On Thursday, 22 August 2013 02:16:20 UTC-5, David Marko wrote: I know there are some changes in session internals in trunk, so just reporting an issue I observed. When I login using 'Remember me' checked, I'm getting this error below. Without 'remember me' its working just fine. I tried to remove all session files but still the same consistent behaviour ... Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. Traceback (most recent call last): File C:\java\web2py\gluon\restricted.py, line 217, in restricted exec ccode in environment File C:/java/web2py/applications/gapps/models/03_db.py http://web2py2.tcl-digitrade.com/admin/default/edit/gapps/models/03_db.py, line 49, in module auth = Auth(db) File C:\java\web2py\gluon\tools.py, line 1229, in __init__ auth.expiration KeyError: 'session_id_gapps' Error snapshot [image: help]http://web2py2.tcl-digitrade.com/admin/default/ticket/gapps/127.0.0.1.2013-08-22.09-11-58.ff9c728c-27f4-4f34-bddc-23c433cef9fe# type 'exceptions.KeyError'('session_id_gapps') inspect attributes Frames - *File C:\java\web2py\gluon\restricted.py in restricted at line 217* code arguments variables - *File C:\java\web2py\applications\gapps\models\03_db.py in module at line 49* code arguments variables - *File C:\java\web2py\gluon\tools.py in __init__ at line 1229* code arguments variables Function argument list (self=gluon.tools.Auth object, environment=DAL uri=sqlite://storage.sqlite, db=DAL uri=sqlite://storage.sqlite, mailer=True, hmac_key=None, controller='default', function='user', cas_provider=None, signature=True, secure=False) Code listing 1224. 1225. 1226. 1227. 1228. 1229. 1230. 1231. 1232. 1233. # for remember me option response = current.response if auth and auth.remember: # when user wants to be logged in for longer response.cookies[response.session_id_name][expires] = \ auth.expiration if signature: self.define_signature() else: self.signature = None -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: track_changes for modules stops working after some time - some observation
I have this problem for years. Working on Windows 7/8 , python 2.7.5 and latest web2py from trunk. The same behaviour observed when running rocket or mod_wsgi (under Apache). I'm always putting track_changes into model. Details of the behaviour are described in my initial post in this discussion thread -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] more buttons on the SQLFORM, how to add them into templates using form custom layout ...?
I would like to add more buttons to SQLFORM using the syntax below. How can I address these buttons on template when I render content manualy? For common submit filed I'm using {{=form.custom.submit}} ... how to address these additional buttons? form.add_button('Back', URL('other_page')) or buttons = [TAG.button('Back',_type=button,_onClick = parent.location='%s' % URL(...), TAG.button('Next',_type=submit)] -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] track_changes for modules stops working after some time - some observation
It has been reported a few times by different users. track_changes for modules stops working after several reloads of page in browser. I can see typical scenario ... I'm working with module and changes are detected correctly . After 6-7 changes and reloads cycle in browser during the coding process and testing web2py ... tracking stops detect the changes in module. When for example I try to debug some error and web2py stops reload the module I can see still the same source code snippet in error ticked even though my module contains updated code. When this occurs (and this occurs repeatedly for me /tested width rocket and mod_wsgi/) I observed that .pyc file is outdated comparing the timestamp on original .py file. I even tried to remove .pyc file but web2py(python) doesnt create a new one when I reload the page in browser. I have to restart the web2py and things get working for sometime once again. Any idea here please? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: track_changes for modules stops working after some time - some observation
Its in model ... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] viewScope variables implementation - your comments and ideas are welcome ...
I'm trying to implement the viewScope variables for web2py controller methods. Idea behind is to mimic a behaviour of JAVA frameworks like JSF or Spring that use the concept of viewScope variables. Such variables live during the all posts to same controller action / to the same form. This is very handy when one is doing some heavy form actions or wizard actions etc. that we do all the time in corporate development. Using the viewScope variable one can avoid using a hidden fields (which using is rather a security issue as user can easily change the value in browser using dev tools.) Now my idea expressed in code snippet below is to generate UUID value during the get request (the first request to controller action) and store it into hidden form field. This hidden UUID is used as a key for cache.ram value that expresses the viewScope variable. I use Storage() object as a viewScope object as it is very easy to use. Now everything is working as expected and during the all posts to same action (all posts of SQLFORM) the hidden key is available and I can access the the same cach.ram Storage() object, read and update values and everything is working fine. What is not fine is fact that cache expire_time is timeout counted from the first cache object creation time and expires in defined time. What I need here is to have the expire time but prolonged each time I access the cache so the expire time reflects users inactivity. Is there a way how to accomplish this idea using the cache.ram? Also is there anyone who tried to solve this already? I would appreciate your ideas / comments. BTW: Despite the fact that HTTP is not statefull .. the statefull framework features are very important during corporate development (during forking with large form that requires many post submits until saved finaly). I would really appreciate having some statefull ideas implemented in web2py core. But its completely separate topic. (Code below is just a proof of concept more than some final nice code. :-) ) class ViewState: @staticmethod def getStateObject(state_id=None): if state_id==None: state_id=ViewState.getStateId() from gluon.storage import Storage return cache.ram('form_'+state_id, lambda:Storage(), time_expire=10) @staticmethod def getStateId(state_field='state_id'): import uuid return (request.post_vars.state_id or str(uuid.uuid4())) def index(): state_id=ViewState.getStateId() sc=ViewState.getStateObject(state_id) form=SQLFORM.factory( Field('jmeno','string',requires=IS_NOT_EMPTY()), Field('prijmeni','string'), hidden=dict(state_id=state_id) ) -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: viewScope variables implementation - your comments and ideas are welcome ...
I tried to avoid serialize these data structures from different forms to disk (default session storage). But you are probably right, that is can be a good solution ... Dne pátek, 2. srpna 2013 21:19:26 UTC+2 Anthony napsal(a): Is there a reason this can't be done using the session? Anthony On Friday, August 2, 2013 3:10:55 PM UTC-4, David Marko wrote: I'm trying to implement the viewScope variables for web2py controller methods. Idea behind is to mimic a behaviour of JAVA frameworks like JSF or Spring that use the concept of viewScope variables. Such variables live during the all posts to same controller action / to the same form. This is very handy when one is doing some heavy form actions or wizard actions etc. that we do all the time in corporate development. Using the viewScope variable one can avoid using a hidden fields (which using is rather a security issue as user can easily change the value in browser using dev tools.) Now my idea expressed in code snippet below is to generate UUID value during the get request (the first request to controller action) and store it into hidden form field. This hidden UUID is used as a key for cache.ram value that expresses the viewScope variable. I use Storage() object as a viewScope object as it is very easy to use. Now everything is working as expected and during the all posts to same action (all posts of SQLFORM) the hidden key is available and I can access the the same cach.ram Storage() object, read and update values and everything is working fine. What is not fine is fact that cache expire_time is timeout counted from the first cache object creation time and expires in defined time. What I need here is to have the expire time but prolonged each time I access the cache so the expire time reflects users inactivity. Is there a way how to accomplish this idea using the cache.ram? Also is there anyone who tried to solve this already? I would appreciate your ideas / comments. BTW: Despite the fact that HTTP is not statefull .. the statefull framework features are very important during corporate development (during forking with large form that requires many post submits until saved finaly). I would really appreciate having some statefull ideas implemented in web2py core. But its completely separate topic. (Code below is just a proof of concept more than some final nice code. :-) ) class ViewState: @staticmethod def getStateObject(state_id=None): if state_id==None: state_id=ViewState.getStateId() from gluon.storage import Storage return cache.ram('form_'+state_id, lambda:Storage(), time_expire= 10) @staticmethod def getStateId(state_field='state_id'): import uuid return (request.post_vars.state_id or str(uuid.uuid4())) def index(): state_id=ViewState.getStateId() sc=ViewState.getStateObject(state_id) form=SQLFORM.factory( Field('jmeno','string',requires=IS_NOT_EMPTY()), Field('prijmeni','string'), hidden=dict(state_id=state_id) ) -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] {{include tmpNameVar }} with template name as a variable problem
I'm trying to use include in 'for' statement importing left navigation snippets from separate folders for particular modules. Code is very simple as below. But it fails on line with include saying that 'm' variable doesnt exist. I tried this and that and found out that include can see variables specified in models but cant see any variable defined in template ... What wrong I'm doing? {{ for m in app.modules.codes: }} {{include m+'/left_navig.html' }} {{pass}} -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Using grid on db.auth_user table switches me back with 'not authorized' flash message ...
I try to use SQLFORM.grid(db.auth_user) in my controller action. But this line simply redirects me back do default action with 'not authorized' flash message. Grid with my custom tables are working fine. Is there any restriction on auth tables? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] auth.user_groups are cached? Can't see changes beeing done in admin UI until user logout/login again
auth.user_groups are cached? Cant see changes beeing done in admin UI until user logout/login again . Any idea how to make this information to be fresh? I mean when I remove user from group, it should be working immediately ... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: auth.user_groups are cached? Can't see changes beeing done in admin UI until user logout/login again
But update_groups do update only for just login user so callbacks should do the work for every user, and this probably cant be done ... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Form errors list ... Is there a way how to get field labels?
I would like to disable inline form error messages and put these as a list above the form. Common errors list comtains the field name, which is rather technical term. Is there a way how to get a label name for each field name from form object? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Bug in SQLFORM.grid - interference between two grids openned in two browser tabs ...
I accidentlly found a strange thing / bug when I open two browser tabs of the same app with two different pages having different grids. Scenario: a) open page01 with grid (first browser tab) b) open page02 with another grid (another browser tab) c) go back to first tab and refresh/reload the page01 d) go to second tab with page02 and click on 'edit' on any row. Now the edit page 'back' button points to page01 and not to page02, from which the edit page came from Hopefully its not too messy. I tested many times, still the same ... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Bug in SQLFORM.grid - interference between two grids openned in two browser tabs ...
As a part of URL in 'edit' button link ? Do not know internals, how it is generated ... Dne pátek, 26. července 2013 21:17:10 UTC+2 Niphlod napsal(a): that's because the back link is saved into the session and session is shared between tabs. How would you handle it ? On Friday, July 26, 2013 9:11:38 PM UTC+2, David Marko wrote: I accidentlly found a strange thing / bug when I open two browser tabs of the same app with two different pages having different grids. Scenario: a) open page01 with grid (first browser tab) b) open page02 with another grid (another browser tab) c) go back to first tab and refresh/reload the page01 d) go to second tab with page02 and click on 'edit' on any row. Now the edit page 'back' button points to page01 and not to page02, from which the edit page came from Hopefully its not too messy. I tested many times, still the same ... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] How to show column from 1:N relation in SQLFORM.grid for child table ?
I have a simple 1:N relation (I think its very common scenatio) as you can see below. Now how can I create a query form SQLFORM.grid to show 'customer_person' table but view company_name in 'company' column instead of ID? I tried to put this query to grid 'db_companies.id == db_persons.company ' (inner join), it worked nice but 'show' button from grid viewed the 'customers_company' and not the 'customers_person' table. Is there a way how to accomplish this using e.g. left join? db_companies=db.define_table('customers_company', Field('company_name','string'), Field('city','string',label=T('Město')), ) db.define_table('customers_person', Field('company','reference customers_company', requires= IS_IN_DB(db,customers_company.id,customers_company.company_name)), Field('firstname','string'), Field('lastname','string'), ) -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] What is the import order for model files when using subfolders based on controller names ?
I'm using model subfolders for specific controllers based on docs here By default, this is set automatically to load /a/models/*.py, /a/models/c/*.py, and /a/models/c/f/*.py files when /a/c/f is requested. What is the import order for this? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] How can I protect the entire controller to be available only for logged in users?
How can I protect the entire controller to be available only for logged in users? Something like @auth.requires_login() but for the entire controller instead of each method ? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Problem with {{include some_page.html}} - its adding some empty line at the top of parsed template
I have a problem with {{include some_page.html}} on templates. Its adding some empty line at the top of parsed template. I have some html theme that requires precise html and I found out that when I use {{include}} its adding some strange char(s) at the top of parsed template. I simply try to decouple the large page html into smaller pieces ... so I take a html bock and put this into separate file and include back using {{include}}. Even if I include empty file with no lines its adding something to my html that causes visual problems in HTML (tested in Chrome, FF, IE). Screenshot below highlights the problem. The li class='grey' ... is part of included file and there is something added at the top. Any idea whats this? https://lh6.googleusercontent.com/-hqcvaCI7otY/Ue6FIyb8MyI/Cog/hbSHqlVxErs/s1600/include.gif -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Problem with {{include some_page.html}} - its adding some empty line at the top of parsed template
I just found it was IDE issue. I'm using PyScripter and when I oppened the HTML templates in another editor and resaved it simply disapeared ... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: can't compare datetime.date to Field
I think this is because '=' are methods on field object ... Dne středa, 17. července 2013 4:57:02 UTC+2 lucas napsal(a): omg, that is amazing. strange syntax. why not interchangeable? lucas -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Anyone having experience with web2py and ChromeLogger?
Anyone having experience with web2py and ChromeLogger? http://craig.is/writing/chrome-logger https://github.com/ccampbell/chromelogger-python -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: ChromeLogger for web2py
Very nice :-) -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: web2py roadmap
Is there a way how to add something to wishlist? Dne neděle, 14. července 2013 22:30:05 UTC+2 Niphlod napsal(a): web2py's developers work often behind the curtain and users are not able to see what they're working on. Historically we tracked down feature-requests and todo-lists on google code, but it's a nightmare to track them and work with it efficiently. On a nice tip received by a power web2py user, we (developers) decided to create something more readable to give us (developers AND users) a nice representation on what's going on. Please welcome the official trello board for web2py's roadmap : https://trello.com/b/d3aqBbBl -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: this talk...
Hi Massimo, can you elaborate more on how it is relevant to this community? Do you have some ideas that come from this presentation? Dne neděle, 14. července 2013 18:03:06 UTC+2 Massimo Di Pierro napsal(a): https://vimeo.com/2723800 I think this talk is really relevant to our community, and it gets really funny after the first 19 minute. Massimo -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: New Auth and general database management functionality in appadmin
Hi Anthony, can you help me to make it alive in my app, please? I'm using the latest trunk web2py version. I did necessary setup as described above but when I enter the following URL: http://localhost/test_app/appadmin/manage/auth I'm just getting this in browser 'invalid function (appadmin/manage)' . Is the URL wrong for my 'test_app' application? Is it working for existing applications or only for newly created after this feature has been introduced? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: New Auth and general database management functionality in appadmin
Just got it to work, I copied only appadmin.py controller, but also the appadmin.html and current web2py.js is required ... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Anyone here as former PHP developer? Help me with 'pro-web2py' arguments please ...
The talks raised in our company about the shifting to PHP world as a more widespread ... and even some people has PHP experience already here. Symfony2 and Laravel PHP frameworks are in consideration. Is there anyone that switched from some PHP web framework to web2py? Can you share some experiences and reasons for this shift please ... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Why is compiled application slower than the one without compilation?
I just tested my web2py installation using Apache Benchmark and found strange thing. When I benchmarked common examples app, that is available in web2py core (this url: /examples/simple_examples/hello5 ) I found that compiled app gives me around 100 req/sec but uncompiled 155 req/sec which is much more. The same app on the same computer. Tried several times just to avoid some issues. Why is it? I would expect the compiled version to be faster and not just opposite. Environment: 2.6.0-development+timestamp.2013.06.27.07.20.48 (Running on Apache/2.2.21 (Win32) mod_wsgi/3.5-BRANCH Python/2.7.5 -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Article: How fast can we make interpreted Python?
http://www.phi-node.com/2013/06/how-fast-can-we-make-interpreted-python.html https://github.com/rjpower/falcon -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Anyone got working python-dateutil in web2py app?
I have to use 'rrule' part of python-dateutil library see here http://labix.org/python-dateutilhttp://labix.org/python-dateutil#head-470fa22b2db72000d7abe698a5783a46b0731b57 But I cant get it to work under web2py. It freezes the Rocket server. Its working fine as standalone in Python, but in web2py app the rrule() method freezes the server. I found the 'import thread' at the beginning of this library, but its not used with default parameters. So I even commented this import but still doesnt work under web2py. Anyone there have been successfull with this? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Anyone got working python-dateutil in web2py app?
timedeltas are fine, but I need rrules, which contains great functionality ... Dne pátek, 21. června 2013 22:12:53 UTC+2 Jim S napsal(a): I use dateutil extensively but not rrule(). -Jim On Friday, June 21, 2013 1:52:16 PM UTC-5, David Marko wrote: I have to use 'rrule' part of python-dateutil library see here http://labix.org/python-dateutilhttp://labix.org/python-dateutil#head-470fa22b2db72000d7abe698a5783a46b0731b57 But I cant get it to work under web2py. It freezes the Rocket server. Its working fine as standalone in Python, but in web2py app the rrule() method freezes the server. I found the 'import thread' at the beginning of this library, but its not used with default parameters. So I even commented this import but still doesnt work under web2py. Anyone there have been successfull with this? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Anyone got working python-dateutil in web2py app?
Thanks a lot for testing !!! I just got it. When I use : return dict(message=Testing RRule, recur = recur) ... its working fine, but when I returned (just for testing) 'return recur' only, it freezed the Rocket ... Thanks again! Dne sobota, 22. června 2013 4:17:29 UTC+2 Brian M napsal(a): I too use relativedelta a lot but hadn't tried rrule() before. However, I just gave it a try and it appeared to work OK. (Tested with current web2py trunk running via rocket) def index(): from dateutil.rrule import * from dateutil.parser import * from datetime import * recur = list(rrule(MONTHLY, count=10, dtstart=parse('2013-6-21'))) return dict(message=Testing RRule, recur = recur) This is the rrule/index.html template message:Testing RRulerecur:datetime.datetime(2013, 6, 21, 0, 0)datetime.datetime(2013, 7, 21, 0, 0)datetime.datetime(2013, 8, 21, 0, 0)datetime.datetime(2013, 9, 21, 0, 0)datetime.datetime(2013, 10, 21, 0, 0)datetime.datetime(2013, 11, 21, 0, 0)datetime.datetime(2013, 12, 21, 0, 0)datetime.datetime(2014, 1, 21, 0, 0)datetime.datetime(2014, 2, 21, 0, 0)datetime.datetime(2014, 3, 21, 0, 0) On Friday, June 21, 2013 3:16:06 PM UTC-5, David Marko wrote: timedeltas are fine, but I need rrules, which contains great functionality ... Dne pátek, 21. června 2013 22:12:53 UTC+2 Jim S napsal(a): I use dateutil extensively but not rrule(). -Jim On Friday, June 21, 2013 1:52:16 PM UTC-5, David Marko wrote: I have to use 'rrule' part of python-dateutil library see here http://labix.org/python-dateutilhttp://labix.org/python-dateutil#head-470fa22b2db72000d7abe698a5783a46b0731b57 But I cant get it to work under web2py. It freezes the Rocket server. Its working fine as standalone in Python, but in web2py app the rrule() method freezes the server. I found the 'import thread' at the beginning of this library, but its not used with default parameters. So I even commented this import but still doesnt work under web2py. Anyone there have been successfull with this? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] How to create a custom helper that accepts body as long multiline html?
How to create a custom helper that accepts body as long multiline html? For example helper that can create a div like the one below, as parameters I can provide header as simple text and content body as html, which can be quite long/complete. I can't use common pattern e.g. {{=DIV(B(I(hello , world))), _class=myclass)}} becuase I can't send body as long html. I need something more like {{block fancy_div}} body text {{end}} but have to be able to send aditional parameters. The purpose of this is to create a set of helpers/widgets, that can help me to work with this page layout http://easy-themes.tk/themes/preview/ace/elements.html ... so for each component of this layout I could be able to create some widget/helper. div class='fancy-box' div class='header' header /div div class='body' html body /div /div -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: How to create a custom helper that accepts body as long multiline html?
Problem is not in HTML but how to send large html into widget/helper. For example if you would like to use DIV() helper, you have a problemwhen having a large content, which must be editable/visible in html editor, you cant pass it into helper as a string. Here my note about {{block }} command as an example. Dne čtvrtek, 13. června 2013 12:14:03 UTC+2 villas napsal(a): Did you try to use the XML() helper to use raw html in your views? On Thursday, 13 June 2013 08:40:31 UTC+1, David Marko wrote: How to create a custom helper that accepts body as long multiline html? For example helper that can create a div like the one below, as parameters I can provide header as simple text and content body as html, which can be quite long/complete. I can't use common pattern e.g. {{=DIV(B(I(hello , world))), _class=myclass)}} becuase I can't send body as long html. I need something more like {{block fancy_div}} body text {{end}} but have to be able to send aditional parameters. The purpose of this is to create a set of helpers/widgets, that can help me to work with this page layout http://easy-themes.tk/themes/preview/ace/elements.html ... so for each component of this layout I could be able to create some widget/helper. div class='fancy-box' div class='header' header /div div class='body' html body /div /div -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: How to create a custom helper that accepts body as long multiline html?
HTML can be passed as string of course, but I cant imagine how to do it for html, which is large html block with table, links etc. cca. 300 lines which is created and maintained by our designer. Dne čtvrtek, 13. června 2013 13:53:43 UTC+2 villas napsal(a): I don't understand: - why html cannot be passed as a large string; generally speaking, html is a large string :) - why you need to use a new widget or helper to make the correct markup Hopefully someone else will know what you mean and help you directly. If not, please post a more specific example of what your original data looks like and what you would like to achieve. On Thursday, 13 June 2013 11:37:42 UTC+1, David Marko wrote: Problem is not in HTML but how to send large html into widget/helper. For example if you would like to use DIV() helper, you have a problemwhen having a large content, which must be editable/visible in html editor, you cant pass it into helper as a string. Here my note about {{block }} command as an example. Dne čtvrtek, 13. června 2013 12:14:03 UTC+2 villas napsal(a): Did you try to use the XML() helper to use raw html in your views? On Thursday, 13 June 2013 08:40:31 UTC+1, David Marko wrote: How to create a custom helper that accepts body as long multiline html? For example helper that can create a div like the one below, as parameters I can provide header as simple text and content body as html, which can be quite long/complete. I can't use common pattern e.g. {{=DIV(B(I(hello , world))), _class=myclass)}} becuase I can't send body as long html. I need something more like {{block fancy_div}} body text {{end}} but have to be able to send aditional parameters. The purpose of this is to create a set of helpers/widgets, that can help me to work with this page layout http://easy-themes.tk/themes/preview/ace/elements.html ... so for each component of this layout I could be able to create some widget/helper. div class='fancy-box' div class='header' header /div div class='body' html body /div /div -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: How to create a custom helper that accepts body as long multiline html?
My bad that I cant explain it better :-( Going to try to explain with this simple example: I need to generalize/convert this html in helper: div class='fancy-box' div class='header' id='fancy-header' **header simple text** /div div class='body' id='fancy-body' **body html with web2py codes like URL() etc. ** /div div class='footer' id='fancy-footer' **footer simple text** /div /div All ** text ** are variables so I have to send it to helper. I need some syntax like this (I know that it doesnt exist but how to accomplish it using web2py tools?? ): {{block-fancy header=header text footer='Footer text' }} table... /table a href='{{=URL()}}' textlink /a {{end}} ... so header and footer parameters are placed into particular div tags in template above and block content is used as body html in template above ... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] SQLFORM.grid run too many queries from database ...
I have a following table definition in my app. The table contains one filed that references another table called 'category' and then 3 fields that references auth_user table. task_type=db.define_table('scheduled_task_type', Field('category','reference category', label='Kategorie', requires=IS_IN_DB (db,db.category.id,'%(name)s')), Field('name', label='Název', requires=IS_NOT_EMPTY()), Field('description', 'text', label='Popis'), Field('period', label='Periodicita',requires=IS_IN_SET(PERIODICITA)), Field('start_date','date',label='Počáteční datum',requires=IS_DATE( format='%d.%m.%Y')), Field('responsible_1','reference auth_user', label='Odpovědná osoba',requires =IS_IN_DB(db,db.auth_user.id,'%(username)s')), Field('responsible_1_time','time',default='09:00', label='Reakční doba' ), Field('responsible_2','reference auth_user', label='Zástupce', requires= IS_IN_DB(db,db.auth_user.id,'%(username)s')), Field('responsible_2_time','time',default='10:00', label='Reakční doba' ), Field('responsible_3','reference auth_user', label='Osoba pro informování', requires=IS_IN_DB(db,db.auth_user.id,'%(username)s')), Field('responsible_3_time','time',default='17:00', label='Reakční doba' ), ) Now when I use grid in controller like this: grid = SQLFORM.grid(db.scheduled_task_type.id0, fields=[task_type.category ,task_type.name,task_type.description]) ... I can see this huge set of database queries in response.toolbar() SELECT category.name, category.id FROM category WHERE (category.id IS NOT NULL) ORDER BY category.name, category.id; 1.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 1.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT category.name, category.id FROM category WHERE (category.id IS NOT NULL) ORDER BY category.name, category.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT category.name, category.id FROM category WHERE (category.id IS NOT NULL) ORDER BY category.name, category.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 1.00ms SELECT count(*) FROM scheduled_task_type LEFT JOIN category ON ( scheduled_task_type.category = category.id) LEFT JOIN auth_user ON ( scheduled_task_type.responsible_1 = auth_user.id) WHERE (scheduled_task_type .id 0); 0.00ms SELECT scheduled_task_type.category, scheduled_task_type.name,scheduled_task_type .description, scheduled_task_type.id FROM scheduled_task_type LEFT JOIN category ON (scheduled_task_type.category = category.id) LEFT JOIN auth_user ON (scheduled_task_type.responsible_1 = auth_user.id) WHERE ( scheduled_task_type.id 0); 0.00ms SELECT category.id, category.name, category.description FROM category WHERE (category.id = 1) LIMIT 1 OFFSET 0; 0.00ms When I remove grid, this SQL queries disappears, so all are related to GRID component. What is this? Why so many redundant queries? Please help me understand how to optimise it ... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: SQLFORM.grid run too many queries from database ...
I thought so but it is from table with one record only and one record reference category and three users. But I can see many queries to auth_user table with WHERE (auth_user.id IS NOT NULL) clause which is quite strange. Whats more, as you can see from my example I dont list user name columns at all in grid see fields=[task_type.category,task_type.name,task_type. description] Dne středa, 12. června 2013 14:08:46 UTC+2 Anthony napsal(a): All the reference fields generate queries in order to display the values from their referenced table instead of displaying the raw ID stored in the reference field itself. Separate queries are done for each row in the table, so this can get expensive. It would be more efficient to do a single query with joins to get all the data, but that is not how the grid works -- instead it just relies on the represent attribute of each field, which requires a query per field per record. Anthony On Wednesday, June 12, 2013 7:47:08 AM UTC-4, David Marko wrote: I have a following table definition in my app. The table contains one filed that references another table called 'category' and then 3 fields that references auth_user table. task_type=db.define_table('scheduled_task_type', Field('category','reference category', label='Kategorie', requires= IS_IN_DB(db,db.category.id,'%(name)s')), Field('name', label='Název', requires=IS_NOT_EMPTY()), Field('description', 'text', label='Popis'), Field('period', label='Periodicita',requires=IS_IN_SET(PERIODICITA)), Field('start_date','date',label='Počáteční datum',requires=IS_DATE( format='%d.%m.%Y')), Field('responsible_1','reference auth_user', label='Odpovědná osoba',requires =IS_IN_DB(db,db.auth_user.id,'%(username)s')), Field('responsible_1_time','time',default='09:00', label='Reakční doba'), Field('responsible_2','reference auth_user', label='Zástupce',requires =IS_IN_DB(db,db.auth_user.id,'%(username)s')), Field('responsible_2_time','time',default='10:00', label='Reakční doba'), Field('responsible_3','reference auth_user', label='Osoba pro informování', requires=IS_IN_DB(db,db.auth_user.id,'%(username)s')), Field('responsible_3_time','time',default='17:00', label='Reakční doba'), ) Now when I use grid in controller like this: grid = SQLFORM.grid(db.scheduled_task_type.id0, fields=[task_type. category,task_type.name,task_type.description]) ... I can see this huge set of database queries in response.toolbar() SELECT category.name, category.id FROM category WHERE (category.id IS NOT NULL) ORDER BY category.name, category.id; 1.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 1.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT category.name, category.id FROM category WHERE (category.id IS NOT NULL) ORDER BY category.name, category.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT category.name, category.id FROM category WHERE (category.id IS NOT NULL) ORDER BY category.name, category.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 1.00ms SELECT count(*) FROM scheduled_task_type LEFT JOIN category ON ( scheduled_task_type.category = category.id) LEFT JOIN auth_user ON ( scheduled_task_type.responsible_1 = auth_user.id) WHERE ( scheduled_task_type.id 0); 0.00ms SELECT scheduled_task_type.category, scheduled_task_type.name,scheduled_task_type .description, scheduled_task_type.id FROM scheduled_task_type LEFT JOIN category ON (scheduled_task_type.category = category.id) LEFT JOIN auth_user ON (scheduled_task_type.responsible_1 = auth_user.id) WHERE ( scheduled_task_type.id 0); 0.00ms SELECT category.id, category.name, category.description FROM category WHERE (category.id = 1) LIMIT 1 OFFSET 0; 0.00ms When I remove grid, this SQL queries disappears, so all are related to GRID component. What
[web2py] Re: SQLFORM.grid run too many queries from database ...
Its grid doing this definitely. Removing the grid and all queries disapear. I also have had one left join in grid definition, which causes some additional queries to auth_user database. I have striped my code to simplest one, now when fetching one record from my database, I'm getting queries as below: a) query to category table, my record reference category table b) 3 queries to auth_table, but I dont have any username column in grid and also see the strange where clause ... c) count quersy, chis is fine d) the main query itself, which is fine Strange are the queries to category and auth_user tables(the first 4 queries), particulary the where clause which is just checking id 'IS NOT NULL'. I don't use represent for this fields, so in category column I can see ID instead of name. When I add represent to this category Field, additional query appears like this one, which fetches that category name for this particular category id, which is fine. SELECT category.id, category.name, category.description FROM category WHERE (category.id = 1) LIMIT 1 OFFSET 0; SELECT category.name, category.id FROM category WHERE (category.id IS NOT NULL) ORDER BY category.name, category.id; 1.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 1.00ms SELECT count(*) FROM scheduled_task_type WHERE (scheduled_task_type.id 0); 0.00ms SELECT scheduled_task_type.category, scheduled_task_type.name,scheduled_task_type .description, scheduled_task_type.id FROM scheduled_task_type WHERE ( scheduled_task_type.id 0) ORDER BY scheduled_task_type.id LIMIT 1 OFFSET 0 ; -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: SQLFORM.grid run too many queries from database ...
Thanks Anthony, searchable=False did the trick and removed the first 4 queries. Things got clear for me now ... Dne středa, 12. června 2013 16:17:11 UTC+2 Anthony napsal(a): Sorry, didn't look to closely at the queries. In this case, most of those queries are for the search widget. The default search widget includes dropdowns for all the reference fields that have requires attributes with IS_IN_DB validators -- the IS NOT NULL queries for db.category and db.auth_user are for populating those dropdowns. If you don't want that, in the call to .grid(), you can set searchable=False, or you can specify search_widget=[your custom widget] (or you can temporarily set the requires attributes of the reference fields to None). I'm not sure why each of those queries appears three times, though -- are there multiple calls to .grid() in the request? Also, is that your exact .grid() call? I see left joins in the queries, but you don't have a left argument in your .grid() call. Anthony On Wednesday, June 12, 2013 8:18:59 AM UTC-4, David Marko wrote: I thought so but it is from table with one record only and one record reference category and three users. But I can see many queries to auth_user table with WHERE (auth_user.id IS NOT NULL) clause which is quite strange. Whats more, as you can see from my example I dont list user name columns at all in grid see fields=[task_type.category,task_type.name, task_type.description] Dne středa, 12. června 2013 14:08:46 UTC+2 Anthony napsal(a): All the reference fields generate queries in order to display the values from their referenced table instead of displaying the raw ID stored in the reference field itself. Separate queries are done for each row in the table, so this can get expensive. It would be more efficient to do a single query with joins to get all the data, but that is not how the grid works -- instead it just relies on the represent attribute of each field, which requires a query per field per record. Anthony On Wednesday, June 12, 2013 7:47:08 AM UTC-4, David Marko wrote: I have a following table definition in my app. The table contains one filed that references another table called 'category' and then 3 fields that references auth_user table. task_type=db.define_table('scheduled_task_type', Field('category','reference category', label='Kategorie', requires= IS_IN_DB(db,db.category.id,'%(name)s')), Field('name', label='Název', requires=IS_NOT_EMPTY()), Field('description', 'text', label='Popis'), Field('period', label='Periodicita',requires=IS_IN_SET(PERIODICITA )), Field('start_date','date',label='Počáteční datum',requires=IS_DATE( format='%d.%m.%Y')), Field('responsible_1','reference auth_user', label='Odpovědná osoba', requires=IS_IN_DB(db,db.auth_user.id,'%(username)s')), Field('responsible_1_time','time',default='09:00', label='Reakční doba'), Field('responsible_2','reference auth_user', label='Zástupce',requires =IS_IN_DB(db,db.auth_user.id,'%(username)s')), Field('responsible_2_time','time',default='10:00', label='Reakční doba'), Field('responsible_3','reference auth_user', label='Osoba pro informování', requires=IS_IN_DB(db,db.auth_user.id,'%(username)s')), Field('responsible_3_time','time',default='17:00', label='Reakční doba'), ) Now when I use grid in controller like this: grid = SQLFORM.grid(db.scheduled_task_type.id0, fields=[task_type. category,task_type.name,task_type.description]) ... I can see this huge set of database queries in response.toolbar() SELECT category.name, category.id FROM category WHERE (category.id IS NOT NULL) ORDER BY category.name, category.id; 1.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE ( auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 1.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE ( auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE ( auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT category.name, category.id FROM category WHERE (category.id IS NOT NULL) ORDER BY category.name, category.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE ( auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE ( auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE ( auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id; 0.00ms SELECT category.name, category.id FROM category WHERE (category.id IS NOT NULL) ORDER BY category.name, category.id; 0.00ms SELECT auth_user.username, auth_user.id FROM auth_user WHERE ( auth_user.id IS NOT NULL) ORDER BY auth_user.username, auth_user.id
[web2py] Very nice DataGrid for Twitter Boostrap ...
http://o5.github.io/grido-sandbox/ live example is here http://grido.bugyik.cz/example/ -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: request.get_vars
I think that request.get_vars return the reference to Storage object not its copy. So adding something to your variable de-facto adds items to former Storage. Dne čtvrtek, 23. května 2013 11:00:40 UTC+2 Domagoj Kovač napsal(a): {{export_get_vars = request.get_vars}} {{export_get_vars.export_format = csv}} {{export_get_vars.export_format = xls}} {{=request.get_vars}} I have a code like this, i dont understand what is going on. I assign request.get_vars to export_get_vars, when i add seomething to export_get_vars request.get_vars is also changed, How is this possible? Example above outputs: Storage {'export_format': 'xls'} Althought my url is: http://127.0.0.1:8000/init/entry_value/grid/13 -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Upload field and SQLFORM.grid problem / bug?
I have a table with upload field defined as follows: Field('file', 'upload', uploadseparate=True) . When I create some items using database administration, the image is displayed correctly. When I involve SQLFORM.grid in my controller, the link to file is not correct. See two links below: OK - this URL is produced by database administration interface http://localhost:8000/periodicke_cinnosti/appadmin/download/db/item.file.8f5a1d4f8f222113.6e61747572616c6c5f30332e706e67.png BAD - this URL is produced by SQLFORM.grid http://localhost:8000/periodicke_cinnosti/default/form/download/item.file.8f5a1d4f8f222113.6e61747572616c6c5f30332e706e67.png The difference is 'db' just after '/download/' in path. I'm running latest web2py trunk version. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Is there a way how to use a viewScope on conversationScope like variable?
Is there a way how to use/crrate a viewScope on conversationScope like variable in web2py? In JAVA based frameworks (e.g. JSF, Spring Framework) there are scoped environments available. In web2py we have requestScope, and sessionScope (if I use this naming) but cant figure out how to create a viewSope(or conversationScope) which is like session but bound to one page(its instance.) only. So when user submits page without redirect the viewScope variable is still available. This is very nice scenario e.g. how to create nice wizards within a one page as viewScope holds position 'securely' . And there are other use casesas well. (btw. applicationScope would be very ncie as well but I know we can use cache here, but these scope are more transparent). David -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Is there a way how to use a viewScope on conversationScope like variable?
Such a great piece of code!! Thanks. Its very close but page scope should be bound to specific instance of page so it works also in situation when you open the same page in several browser tabs. It must be independent. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Is there a way how to use a viewScope on conversationScope like variable?
I understand that scope idea is based on statefullness of these mentioned frameworks. I can see the statefullness important (and useful) when you work on intranet applications that require a more complicated logic etc. The viewScope starts on first page GET and lives for all POSTs to server and disappears on next GET to this page. If possible, it should be implemented with cache in web2py (IMHO) as it requires separate expiracy. With session and uniques keys for each page instance it would 'fill' session quickly. But I think its rather more general idea ... I mean if we can get some statefull nature in web2py it woul be great. . In JAVA world (where I come from) there are frameworks like Apache Wicket or Spring (marked as statefull) and those like Play! (marked as stateless). What is important that statefull frameworks can usualy run in stateless mode when required, but can operate with states when needed. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Cheatsheet available?
http://www.web2py.com/examples/static/web2py_cheatsheet.pdf Dne pondělí, 15. dubna 2013 14:03:18 UTC+2 Karl Thomas Schmidt napsal(a): Hi@all, is there anywhere a cheatsheet for all reserved words with one or two lines of explanation? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Anyone have experience with SSO between web2py and Wordpress (or some PHP framework)?
Anyone have experience with SSO between web2py and Wordpress? We have to run Wordpress site for the one of our customers but would like to develop apps in web2py. To avoid duplicate login and having seamless integration we would like to integrate it somehow so when user is logged into Wordpress, the web2py would know about him. Any hint on this? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: iOS + web2py
What do you use for creating iOS application? Do you use xcode directly or some framework like Titanium? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Pypy 2.0 beta2 - is there anyone testing this with web2py?
Is there anyone testing Pyp with web2py. Is it usable now or in future as faster plarfotm? http://morepypy.blogspot.cz/2013/04/pypy-20-beta-2-released.html -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Article: Frameworks Round 2
http://www.techempower.com/blog/2013/04/05/frameworks-round-2/ -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: EmberJS is the web2py of the client! :)
This scenario of one-page application is quite important for mobile hybrid applications. In this case you need standalone app running in device and consuming data from server. The server provides JSON coomunication with app. We have a great experience with http://trigger.io http://angularjs.org/ ... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: EmberJS is the web2py of the client! :)
Meteor is different beast as it is also serverside platform based on node.js ... But development of this framework is quite slow ... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: EmberJS is the web2py of the client! :)
AngularJS is well designed ... and usefull ... Dne úterý, 2. dubna 2013 19:13:20 UTC+2 Ramos napsal(a): Backbone anyone? 2013/4/2 Massimo Di Pierro massimo@gmail.com javascript: Thanks for the good writing. We should make an example of integrating the two. On Tuesday, 2 April 2013 05:01:10 UTC-5, Arnon Marcus wrote: EmberJS is one of the most comprehensive MVC frameworks of the day - it's batteries included (like web2py). It is inspired by Ruby-on-Rails, in terms of preferring convention-over- **configuration (like web2py). It has sane defaults for the high-level architecture, so it could require minimal code for standard stuff (like web2py). The MVC naming-structure is somewhat different, but essentially the same components exist as in web2py. *The Router:* Like in web2py, there is a convention for mapping controllers to views, but unlike web2py, routing (the mapping of URLs to code) is done explicitly. It is analogous to web2py's routs.py file. The router is doing client-side routing, translating code to URL and vice-versa. *The Model:* * * Firstly, there is an extension called EmberData that works holistically with EmberJS (but can be used without it) that does all the front-end/back-end synchronization. It is analogues to web2py's database-abstraction-layer (DAL) architecture, for supporting multiple optional back-ends, and converting data to an ORM (object-relation-model). As in RoR (ruby-on-rails), the conversion is done via Adapters which are like web2py's DAL-drivers. In RoR it outputs what's known as Active-Records - essentially, objects that map to the back-end, and know how to save/update data back. In EmberData you would write: model = DS.Store.create() Where in web2py you would write: db = DAL(connection-string) The data received from the backend, after being converted to ORM objects, is known as Records. What is called Record in EmberData is essentially like a Row object in web2py, and similarly a RecordArray in EmberData is analogous to a Rows object in web2py. *The View:* In EmberJS, a view is somewhat different from what a view in web2py, as it deals with user-interaction event-handeling. However, EmberJS uses Templates which are essentially what web2py's views are. It even uses very similar templating language with a squirrely-brackets ({{somthing}}). It has similar uses, so where in web2py, a controller passes data to the view, in EmberJS a controller binds data to a template. The difference here is that because it is all client-side, EmberJS can do data-binding - whenever a controller's bound-data changes, the template automatically updates itself in the UI. Additionally, in EmberJS there are special names that do special things inside a template. For example: Where in web2py, the layout may have something like: ... header.../header ... {{include}} ... footer.../footer ... In ember it would be: ... header.../header ... {{outlet}} ... footer.../footer ... Essentially meaning everything else inside this template, put here... Similarly, where in web2py you would write: ... {{if someBoolean}} div{{someBoolean}}/div {{pass}} ... ol {{for a in someArray}} li{{a}}/li ** {{pass}} /ol ... In EmberJS it would look something like this: ... {{#if someBoolean}} div{{someBoolean}}/div {{/if}} ... ol {{#each a in someArray}} li{{a}}/li ** {{/each}} /ol ... Also, where in web2py the mapping of views to controllers is done via folder-structure + file-naming, in EmberJS it is done via name-mapping of controller-object-name and template-object-name. *The Controller:* * * In web2py a controller automatically maps to a sub-set of the URL, and may have many functions called Actions, which each is mapped to a view. In EmberJS this is further generalized in the Router, which can contain many nested Routs, each mapped to a single controller via the router and/or naming-convention. So an EmberJS Rout is analogous to a web2py Controller, and an EmberJS Controller is analogous to a web2py Controller-Action. This is offers a more flexible hierarchy
Re: [web2py] Re: [OT] uWSGI quickstart for Web2Py (works on windows too)
Can you share uwsgi binary please? Dne sobota, 16. března 2013 10:21:15 UTC+1 Niphlod napsal(a): oh. That took nearly 2 seconds (and was nice to know, thanks Roberto). Although I feel dirty in the process (guess being among the first ones kinda leads to dirtyness), now web2py is running on windows under uwsgi just fine! The second someone more skilled in cygwin related businesses publishes an how-to to build uwsgi, I'm sure a lot will follow my procedure is kinda ... make -- see errors -- relaunch setup of cygwin -- install missing libraries -- reiterate ^_^ -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: [OT] uWSGI quickstart for Web2Py (works on windows too)
Are there issues with using(on Windows) Apache HTTP + mod_wsgi see the windows builds here http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi ? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: [OT] uWSGI quickstart for Web2Py (works on windows too)
Yes nginx is my favourite too, being from czech republic, we are closer to russia :-) ... but it really requires stable build of uwsgi for windows not only some home-made. Would appreciate hearing any results ... Dne pátek, 15. března 2013 14:27:03 UTC+1 Niphlod napsal(a): I assume there aren't, but that is not a setup I'd put up for an intranet to publish an app used by 50 users. Apache on unix is somewhat fatty , on windows it gets really soon to unbereable. Config directives are a sysadmin thing (I'm not against it, it just doesn't feel natural). That being said, we're all happy with apache because it's battle tested and sooner or later someone had to wrestle with it, and became a familiar tool in our belt. But, the burden of maintenance started to be too heavy, and that's why I switched some time ago from apache to nginx (ease of maintenance + lighter on resources) and adopted uwsgi as soon as it got out (with more and more features added at every release). Now that uwsgi is getting stronger on being directly on the public face of things (i.e. has a own http mode, it eventually serves static files, has HTTPS, etc etc etc), I'd go for uwsgi on Windows all the times, and on Unix I'll keep putting it behind nginx just when the traffic hits sky-rocket limits. Of course, it's just a matter or personal preference. On Friday, March 15, 2013 1:20:36 PM UTC+1, David Marko wrote: Are there issues with using(on Windows) Apache HTTP + mod_wsgi see the windows builds here http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi ? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Howto Multi file uploader
You should look at the web2pyslices, there are a few posts on upload topic ... e.g. here http://www.web2pyslices.com/slice/show/1576/html5-file-uploads-with-jquery David Dne středa, 30. ledna 2013 10:48:57 UTC+1 Ramos napsal(a): Hello, what is the best way to add multi file upload functionality. This is very important for me. I have many apps that can be converted to web2py but i have a lot of fields that need to upload multiple files. I want to use it inside company in a lot of colaborative apps. I would love to see this functionality out of the box in web2py. Thank you António -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Set up of db.py takes too long time
It really runs these validators during table definition, and not just in time when used? So its better to define this requires= ... in controller where this is used? David Dne úterý, 15. ledna 2013 9:23:43 UTC+1 rochacbruno napsal(a): On Tue, Jan 15, 2013 at 6:20 AM, Daniel Gonzalez gonv...@gmail.comjavascript: wrote: IS_NOT_IN_DB(db, '%s.email' % (web2py_user_table)) If you too many records on user table, the above code will take a long time, because on every request it will select email from auth_user --
Re: [web2py] Re: Sending mail to groups
Hi Ramos, I can see here Lotus Notes roots :-) But defnitely some auth based functions would be nice as part of web2py as they are generaly usefull. They could be even part of auth object. Someting like auth.my_groups(), auth.my_roles(), auth.emails_for_group(group_name), auth.find_by_email(email) etc ... David Dne pátek, 11. ledna 2013 13:16:21 UTC+1 Ramos napsal(a): Web2py has html helpers for some reason rigth? Its the same principle. I know its not a priority. 99,99% dont need it but could be added to that document that compares web2py to others, showing less code in web2py. I just dont link my keyboard!! Thank you 2013/1/11 Niphlod nip...@gmail.com javascript: It's hardly a feature when you can do it in less than 10 lines of code. You want to send it in a to list, another one could want to do a cc, another one a cc with a ccn of the 1 user registered and so on.. Let's try to not blow web2py up with those shortcuts. def send_to_groupname(groupname, **kwargs): send mail to all peoples in a group rtn = db( (db.auth_group.role == groupname) (db.auth_membership.group_id == db.auth_group.id) (db.auth_user.id == db.auth_membership.user_id) ).select(db.auth_user.email, distinct=True) tolist = [] for row in rtn: tolist.append(row.email) return mail.send(to=tolist, **kwargs) so, you can do send_to_group_name('administrator') On Friday, January 11, 2013 12:30:13 PM UTC+1, Ramos wrote: But it would be nice to do it like mail.send('[administrators]','Message subject','Plain text body of the message') It would be much simpler for people developing apps that sends a lot of email between users and groups like workflow apps. Can you put it in the wish list? 2013/1/11 Niphlod nip...@gmail.com no, you need to pass a list of email addresses. It's not difficult to retrieve that info given the name of the group, you must only do a query to do that. On Friday, January 11, 2013 12:15:14 PM UTC+1, Ramos wrote: Hello,can i send an email to a group like mail.send('[administrators]','Message subject','Plain text body of the message') Thank you -- -- --
[web2py] Re: How to track page visits
If this has to be persistent among server restarts, you should store it into database ... Dne středa, 9. ledna 2013 9:38:34 UTC+1 sasogeek napsal(a): what code will I put in controllers/views to track the number of times users visit a particular page such that anyone anywhere can see how many times that page has been viewed by anyone anywhere? Eg. If I view page A 5 times, and you view page A 3 times, and another person views page A 7 times, someone else who visits that page should see something like Viewed 15 times... i was reading about session but if my understanding serves me right, that isn't a global variable, that is it's ip specific? and should the user delete their sessions and cookies, it resets? but that aside, what are my options? --
[web2py] Re: Help with multi tenancy
Here is feature description in docs: http://web2py.com/books/default/chapter/29/06?search=tenancy#Common-fields-and-multi-tenancy Dne středa, 9. ledna 2013 13:31:59 UTC+1 Fabiano Faver napsal(a): Its my first time dealing with multi tenancy and I'm still a bit confused how i could implement it with my scenario. I've built a app and want to allow that each 'company' access only their data. Each company have their user admin that can register products,things,etc and other users and their groups inside it company. Will i need to put a request tenant in auth_user like said in this topic: https://groups.google.com/d/msg/web2py/izyKtM-nWPU/G6EDqyWYuOQJ ? I want to separate data by company_id How can i start this? --
[web2py] How can I prevent MARKMIN to escape HTML tags from my text ?
How can I prevent MARKMIN to escape HTML tags from my text ? I have a markmin text with br / tags but MARKMIN escapes all these tags. I tried XML(MARKMIN()) but it doesnt help as MARKMIN itself escapes the html (seems like). Is there a way how to avoid this? David --
[web2py] How do you manage db migrations in application running in production?
How do you manage db migrations in application running in production? I mean situation you have a importnant application running in production and then you make further development that requires changes in database. I dont think its safe to enable migrations for DAL but not sure how to maintain database changes properly in web2py for this? Can you share with your real life experience? David --
[web2py] Re: How do you manage db migrations in application running in production?
Hi Donatas, so you are creating all alter table commands manualy and run them? Dne pondělí, 12. listopadu 2012 17:25:09 UTC+1 Donatas Burba napsal(a): I have a folder called 'migrations' inside app, where all required db (structure and data) changes are placed. After source update and apache restart, application checks if any migration is needed (by checking version saved in database and available migration versions). If so, every required migration is executed, current version number is written to database. That's all :) --
[web2py] How do you deal with obsolete uploaded files?
How do you deal with obsolete uploaded files? I have a table definition with upload file field. When user uploads the file to document and later reedit the document and upload the different file then the former file is left in uploads folder. Is there a way how to delete this obsolete file when new one is being uploaded? David --
[web2py] Re: track_changes
Having the problem with this as well. Sometimes its works for 5-10 reloads and then stops until I restart web2py server. Dne středa, 7. listopadu 2012 11:47:13 UTC+1 Massimiliano napsal(a): Version 2.2.1 (2012-11-06 14:26:21) stable It's just me or it doesn't work anymore? -- Massimiliano --
[web2py] Re: Anyone using Sunburnt for Apache SOLR access from web2py?
Hi yes, I'm using Apache SOLR ... its really proven stable solution with enough documentation. In python I have used mySolr http://mysolr.redtuna.org/en/latest/ which is actively developed and has enough features, developers respond in github discussion etc. ... and plays well with web2py. (I had some problems with sunburnt compatibility with latest Apache SOLR versions and development rather slowed down if not stopped seems to me ...) In db.py I'm using this simple way how to keep shared connection def __make_solr_connection(): from mysolr import Solr connection = Solr('http://localhost:/solr',version=4) print(Apache SOLR Connection established on port: ... ) return connection solr = cache.ram('solr',__make_solr_connection,None) David Dne úterý, 6. listopadu 2012 9:49:41 UTC+1 andrej burja napsal(a): Hi Did you implement this? After trying Whoosh (and finding dificult to implement stemmer/lematization for my language) i'm looking for another solution. Is sunburnt the best solution to use solr with python/web2py? Did you try solrpy? Andrej On Friday, July 6, 2012 8:45:21 PM UTC+2, David Marko wrote: Anyone using Sunburnt for Apache SOLR access from web2py? ( http://opensource.timetric.com/sunburnt ) Any caveats I should expect or no problems on the path? (I mean sunburt vs./in web2py) Thank you ... David --
[web2py] Current trunk breaks in validators.py
Traceback (most recent call last): File c:\java\web2py\gluon\restricted.py, line 212, in restricted exec ccode in environment File c:/java/web2py/applications/tp/controllers/default.py http://localhost:8000/admin/default/edit/tp/controllers/default.py, line 315, in module File c:\java\web2py\gluon\globals.py, line 190, in lambda self._caller = lambda f: f() File c:/java/web2py/applications/tp/controllers/default.py http://localhost:8000/admin/default/edit/tp/controllers/default.py, line 294, in user return dict(form=auth()) File c:\java\web2py\gluon\tools.py, line 1235, in __call__ return getattr(self, args[0])() File c:\java\web2py\gluon\tools.py, line 2201, in register separator=self.settings.label_separator File c:\java\web2py\gluon\sqlhtml.py, line 1046, in __init__ inp = field.formatter(default) File c:\java\web2py\gluon\dal.py, line 8667, in formatter value = item.formatter(value) File c:\java\web2py\gluon\validators.py, line 2553, in formatter return self.other.formatter(value) File c:\java\web2py\gluon\validators.py, line 781, in formatter if values is None: NameError: global name 'values' is not defined --
[web2py] Re: Current trunk breaks in validators.py
Confirm, its working now again ... --
[web2py] Re: Showing a fixed URL for a web2py application
Simply use one frame, and entire application inside Dne pondělí, 29. října 2012 10:47:25 UTC+1 Daniel Gonzalez napsal(a): Hi, In my application, I would like the URL being shown to the user to be always the same (http://www.myapp.com), no matter what page the user is currently browsing. The idea is that the user should not be confused about the internal structure of my application. The links in the page would remain as they are, but the browser would show always the same address. Is this at all possible with web2py? What side-effects could this have? Thanks, Daniel --
[web2py] Re: an editor ...
Eclipse + Pydev Dne čtvrtek, 25. října 2012 15:49:57 UTC+2 apps in tables napsal(a): Hi, Pls, don't laugh... Does any one know of an editor that collapse and expand the functions within the controller? Regards, Ashraf --
[web2py] Re: help me test sessions in cookies
Java PlayFramework! has this as the only default. Using client side cookie based sessions help create distributed environment easily, as there are no sessions specific to one server node. They use both client side cookies for sessions and caches for keeping serverside data. David Dne úterý, 16. října 2012 18:39:02 UTC+2 Massimo Di Pierro napsal(a): Right now you can have or the other. To me it does not make sense to store anything client side if you already have to access a pickle object locally. You only add overhead and risk of exposing data. On Tuesday, 16 October 2012 10:59:20 UTC-5, VP wrote: I think cookie-based sessions is great for many cases. But in some cases, it might not be desirable as clients can see what might be secret information. Why not both?Maybe, two types of sessions, client-side and server-side sessions. Although both client and server side sessions are meant to maintain states, they are appropriate for different things. --
[web2py] Re: web2py 2.1.1 is OUT!
very nice Massimo! Dne pondělí, 15. října 2012 13:55:39 UTC+2 Massimo Di Pierro napsal(a): Changelog: - overall faster web2py - when apps are deleted, a w2p copy left in deposit folder - change in cron (it is now disabled by default). removed -N option and introdu\ ced -Y. - faster web2py_uuid() and request initialization logic, thanks Michele - static asset management, thanks Niphlod - improved mobile admin - request.requires_https and Auth(secure=True), thanks Yarin and Niphlod - better custom_import (works per app and is faster), thanks Michele - redis_sesssion.py, thanks Niphlod - allow entropy computation in IS_STRONG and web2py.js, thanks Jonathan and Nip\ hlod - fixed many aith.wiki problems - support for auth.wiki(render='html') - better welcome layout, thanks Paolo - db.define_table(...,redefine=True) - DAL, Row, and Rows object can now be pickled/unpickled, thanks to zombie DAL. - admin uses codemirror - allow syntax auth = Auth(db).define_tables() - better auth.wiki with preview, thanks Alan - better auth.impersonate, thanks Alan - upgraded jQuery 1.8 - upgraded Bootstrap 2.1 - fixed problems with dropbox_account.py - many fixes to cache.ram, cache.disk, memcache and gae_memcache - cache.with_prefix(cache.ram,'prefix') - db.table.field.epoch() counts seconds from epoch - DAL support for SQL CASE, example: db().select(...query.case('true','false)) - DAL(...,do_connect=False) allows faking connections - DAL(...,auto_import=True) now retieves some fiel attributes - mail can specify a sender: mail.send(...,sender='Mr X %(sender)s') - renamed gluon/contrib/comet_messaging.py - gluon/contrib/websocket_messaging.py Please check it and report any problem. As usual, thanks to the many people who have contributed, in particular Michele and Niphlod. Massimo --
[web2py] Reloading modules stops working after some time ...
I have a module in my app that i was working on extensively today. I realised that web2py doesnt reload it correctly when change tracking enabled. I did some changes to module, after some 4 or 5 save/reload cycles wbe2py stopped reloading the module so old code runned. I could see old messages printed on console. After web2py restarted things went fine but after some time the same behaviour reappeared ... Module reloading stopped or i had to resave module 3-4 times to reflect in browser. Entire behaviour is rather weird as one is not sure with version of my code is actualy running ... David --
[web2py] Re: Reloading modules stops working after some time ...
Using the latest trunk ... Updated today --
[web2py] Fitching Data From json
Use excelent requests library ... http://docs.python-requests.org/en/latest/ to get json data. Processing is simple then in python. --
[web2py] Whats your experience with memory leaks in web2py apps?
I recently benchmarked my two apps with apache benchmark just to see 'req/s' and found out(accidently) in task manager, that both leak memory somehow. e.g. in one of my app python interpreter has grown from 70kB to 110kB just after 10K requests. Second app was sightly better but still it eats memory constantly. I tested on latest web2py trunk version. I bechmarked just app home page, its was common page with some text and login form. Migration was set off for both. My common observation was that more leaks were in app with more models. Are there any best practices to avoid memory leaks in web2py apps? Any experience? David --
[web2py] Re: Whats your experience with memory leaks in web2py apps?
Latest web2py trunk version from this morning, win7, python 2.7.3 . No special settings in app, but model tried to be lazy, so everything is defined in Field methods. --
[web2py] Re: Whats your experience with memory leaks in web2py apps?
Its interal app so I cant provide the source. But I realised the app still contains 'local_import' so I have replaced with 'import' but no effect. Then I benchmarked both compiled and non compiled version ... each 2x and non-compiled is fine, but compiled leaks memory ... a) non-compiled version: web2py started at 37MB, increased to 56MB and oscilated +-2MB during the test with no significant increase at the end b) compiled version: web2py started at 37MB and memory was increasing during entire test up to 95MB ### ab -n 1 -c 6 (app is using lazy tables/models, migration off) David --
[web2py] Re: Scheduler and heartbeat stopped under certain condition ...
Not sure about the logging config, I setup this: # generic app handler [logger_app] level=DEBUG qualname=web2py.app handlers=consoleHandler,rotatingFileHandler propagate=0 and run scheduler with -D 0, but nothing on console ... just exits silently. I will try to isolate it somehome so I could be able to send you test app --
[web2py] Re: Scheduler and heartbeat stopped under certain condition ...
logging.conf looks like this: [logger_root] level=DEBUG handlers=consoleHandler,rotatingFileHandler And nothing ... c:\web2pyc:\python27\python.exe web2py.py -K enterprise_search -D 0 web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2012 Version 2.1.0 (2012-10-10 15:15:45) dev Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL( pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), CouchDB(couchdb), MongoDB(pymongo), IMAP(imaplib) starting single-scheduler for enterprise_search... c:\web2py No error, but also no other debugging messages where I would expect some... --
[web2py] Re: Scheduler and heartbeat stopped under certain condition ...
Ok, seems the setup is correct for now. Here is the full report c:\java\web2pyc:\python27\python.exe web2py.py -K enterprise_search -D 0 web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2012 Version 2.1.0 (2012-10-10 15:15:45) dev Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL( pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), CouchDB(couchdb), MongoDB(pymongo), IMAP(imaplib) starting single-scheduler for enterprise_search... Apache SOLR Connection established on port: ... 2012-10-11 11:01:52,385 - root - DEBUG - defining tables (migrate=True) 2012-10-11 11:01:52,388 - root - DEBUG - thread building own DAL object 2012-10-11 11:01:52,388 - root - DEBUG - looping... 2012-10-11 11:01:52,390 - root - DEBUG - defining tables (migrate=False) 2012-10-11 11:01:52,391 - root - DEBUG - nothing to do 2012-10-11 11:01:52,394 - root - DEBUG - sleeping... 2012-10-11 11:01:52,394 - root - DEBUG - freeing workers that have notsent heartbeat 2012-10-11 11:01:52,400 - root - INFO - TICKER: I'm a ticker (dmhp#7904) 2012-10-11 11:01:55,397 - root - DEBUG - looping... 2012-10-11 11:01:55,414 - root - DEBUG - recording heartbeat 2012-10-11 11:01:55,426 - root - INFO - TICKER: workers are 1 2012-10-11 11:01:55,427 - root - INFO - TICKER: tasks are 1 2012-10-11 11:01:55,430 - root - DEBUG - sleeping... 2012-10-11 11:01:58,430 - root - DEBUG - looping... 2012-10-11 11:01:58,437 - root - DEBUG - recording heartbeat 2012-10-11 11:01:58,467 - root - DEBUG -work to do 1 2012-10-11 11:01:58,467 - root - DEBUG - new scheduler_run record 2012-10-11 11:01:58,483 - root - INFO - new task 1 Import dat enterprise_search/appadmin.import_json 2012-10-11 11:01:58,484 - root - DEBUG - new task allocated: enterprise_search/appadmin.import_json 2012-10-11 11:01:58,529 - root - DEBUG -task starting 2012-10-11 11:02:00,000 - root - DEBUG - task started 2012-10-11 11:02:00,184 - requests.packages.urllib3.connectionpool - INFO - Starting new HTTP connection (1): localhost 2012-10-11 11:02:00,204 - requests.packages.urllib3.connectionpool - DEBUG - GET /enterprise_search/import/tmp_data_provider.json HTTP/1.1 200 1579 2012-10-11 11:02:00,209 - requests.packages.urllib3.connectionpool - INFO - Starting new HTTP connection (1): localhost 2012-10-11 11:02:00,224 - requests.packages.urllib3.connectionpool - DEBUG - POST /solr/update/json HTTP/1.1 200 None 2012-10-11 11:02:00,226 - requests.packages.urllib3.connectionpool - INFO - Starting new HTTP connection (1): localhost 2012-10-11 11:02:00,315 - requests.packages.urllib3.connectionpool - DEBUG - POST /solr/update HTTP/1.1 200 None 2012-10-11 11:02:00,319 - root - DEBUG - new task report: COMPLETED 2012-10-11 11:02:00,323 - root - DEBUG -result: 1 2012-10-11 11:02:00,336 - root - DEBUG - task stopped by general exception 2012-10-11 11:02:00,336 - root - DEBUG - new task report: STOPPED 2012-10-11 11:02:00,338 - root - DEBUG -result: None 2012-10-11 11:02:00,339 - root - DEBUG - recording task report in db (STOPPED) 2012-10-11 11:02:00,348 - root - INFO - task completed (STOPPED) c:\java\web2py --
[web2py] Scheduler and succesfully completed tasks not showing in scheduler_run table
I can see the following note in WEB2py Book: NB: scheduler_run records will be created as before for *FAILED*, * TIMEOUT* and *STOPPED* tasks's statuses. Is there a way how to force to log(create scheduler_run entry) even for succesfull run? Sometimes one need to gather some information using simple print statement about the run and would be nice to see it in this run entry. Thanks for any hint . --
[web2py] Scheduler and heartbeat stopped under certain condition ...
I just encountered strange behaviour with scheduler. I'm using the latest trunk web2py version on windows 7 with TK window, so I start scheduler from TK scheduler menu. I had a code that run fine and during some monitoring I have added the following line to this working code: print(x.get('companyname',)) Suddently I noticed that next scheduler_run entry is created with status 'STOPPED' and with no error traceback. Also the worker heartbeat stopped and there was no last hearbeat datetime refresh anymore. Worker stopped working. Removing this line and restarting scheduler worker enabled scheduler and things were working correctly once again. So I have experimented and found out that x.get('...') returns utf8 value so I have changed the print line to print(x.get('companyname',).encode('utf8')) and things are working fine now ... but not sure why, without the encode('utf-8'), the worked failes ... --
[web2py] Re: Scheduler and heartbeat stopped under certain condition ...
Tried with standalone scheduler(without TK widget), and this silently stops scheduler process with no traceback ... completely nothing. I cant create some simple demo as I load data from JSON service using requests library, then when I print a complete data as JSON, it works, when I iterate JSON data and print just one field without utf8 encoding, it failes this way ... I looked to data comming as JSON and those look OK, strings have 'u' at the beggining so its interpreted correctly e.g. {u'city_t': u'Bohum\xedn 1200'} . I'm sending the data to Apache SOLR server and UTF8 encoding is fine there as well. --
[web2py] Re: Send emails using my own domain
Do you see any error message in web2py or it seems like it has been sent out but you cant see message delivered? You should definitely look into postfix log ... David Dne úterý, 9. října 2012 13:18:29 UTC+2 lyn2py napsal(a): I have postfix installed and followed Massimo's instructions, which are: mail.settings.sender = 'y...@anywhere.comhttps://groups.google.com/forum/?fromgroups= ' mail.settings.server = 'localhost' mail.settings.login = None But the system doesn't send email? (I tested using Lost Password / Reset Password feature) It says Email Sent. but I checked my mailbox, and nothing. ???Puzzled??? The Postfix setup seems simple enough: Internet Site, and then, anywhere.com If it helps, I'm on Ubuntu 12 + nginx + uwsgi. Appreciate any assistance or pointers on how to make it work. Thanks! On Tuesday, October 9, 2012 1:00:26 AM UTC+8, Massimo Di Pierro wrote: On Linux, if you have postfix, you can just spoof your domain: mail.settings.sender = 'y...@anywhere.com' mail.settings.server = 'localhost' mail.settings.login = None On Monday, 8 October 2012 11:22:25 UTC-5, LightDot wrote: Well, if your domain is hosted somewhere, the provider usually gives you access to a mail server too. The access information needed is pretty obvious, username and password, same as you need for regular SMTP access. Regards, Ales On Monday, October 8, 2012 1:40:19 PM UTC+2, Hassan Alnatour wrote: Dear ALL, i want to add my email in the db.py to use it to send email from the site , how can i make it using my own domain not gmail ? Best Regards, --
[web2py] Re: 2.1rc1 parse_version error
+1 ... it really doesnt start ... Dne pondělí, 8. října 2012 9:26:35 UTC+2 szimszon napsal(a): In 2.1.0rc1 admin do not work. S'Traceback (most recent call last):\n File /home/gyszabolcs/fejlesztes/web2py/gluon/main.py, line 616, in wsgibase\nBaseAdapter. close_all_instances(\'rollback\')\n File /home/gyszabolcs/fejlesztes/web2py/gluon/dal.py, line 529, in close_all_instances\nTHREA D_LOCAL.db_instances.clear()\nAttributeError: \'thread._local\' object has no attribute \'db_instances\'\n' p4570 If you just do http://127.0.0.1:8000/admin you got error. 2012. október 8., hétfő 9:23:03 UTC+2 időpontban szimszon a következőt írta: parse_version can handle only numbers... and not rc1 :( fileutils.py line 46: re_version = re.compile('[^\d]+ (\d+)\.(\d+)\.(\d+)\s*\((?Pdatetime.+?)\)\s*(?Ptype[a-z]+)?') --
[web2py] Running the latest trunk and admin doesnt show tables in database administration ...
Running the latest trunk and admin doesnt show tables in database administration ... for any application ... --
Re: [web2py] Re: framework benchmarks - web2py surprisingly slow?
The speed difference is huge! Dne středa, 3. října 2012 11:35:06 UTC+2 Niphlod napsal(a): Well, seems to work. I'd need to know if there is some way to test if all web2py framework works on on this, but a normal app seems to do pretty fine. Windows Vista (aaargh!), PortablePython 2.7.3 32-bit, T8100 2.10Ghz, 3 GB RAM, adjusted softcron in anyserver.py (to allow removal) in order to keep things smooth, removed logging of every request in the console of tornado (commented out line 2214 of motor.py) Performance-wise, same app started with anyserver, one loads cherrypy and the other tornado, 2 concurrent benches (one for static files, the other for the hello world app) no memory leaks for either. ab -c 100 -n 1000 (it is windows after all, bumping to -c 1000 -n 100 at this point is unuseful) /app/default/index rps cherrypy 14.90 , tornado 132 /app/static/test.css rps cherrypy 23.71, tornado 174 --
Re: [web2py] Layout for forms
It comes from following settings ... its time out for login session ... auth.settings.long_expiration = 3600*24*30 # one month auth.settings.remember_me_form = True See here: http://web2py.com/books/default/chapter/29/09?search=remember+me Dne čtvrtek, 20. září 2012 9:44:48 UTC+2 Alec Taylor napsal(a): That's in gluon\tools.py On Thu, Sep 20, 2012 at 5:44 PM, Kevin Bethke kevin@gmail.comjavascript: wrote: I'm using the standard auth_user. there is a checkbox remember me for 30 days. I can't find anything like that in the db. On Thu, Sep 20, 2012 at 9:09 AM, Johann Spies johann...@gmail.comjavascript: wrote: On 19 September 2012 19:54, BlueShadow kevin@gmail.comjavascript: wrote: Hi, I like to change the layout of a couple forms for example for the login form. in my default/user.html the form is just called by {{=form}} I found this on the webtopy site: {{=form.custom.begin}} Image name: div{{=form.custom.widget.name}}/div Image file: div{{=form.custom.widget.file}}/div Click here to upload: {{=form.custom.submit}} {{=form.custom.end}} but I got no idea how to view the checkbox etc. Is there a more comprehensible example The 'checkbox etc' will be part of the Field definition of the form as in this example 'name' and 'file'. So if you have a field using a checkbox widget (say 'your_preference') you will see the checkbox when you put {{=form.custom.widget.your_preference}} in the above example. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- -- --
[web2py] Re: multiple controllers under linux environment
Check following: a) linux is case sensitife on files - check filenames and their references in web2py b) check correct os level permissions on files ... so web2py can see read them ... Dne pondělí, 17. září 2012 6:01:09 UTC+2 Vladimir Makarov napsal(a): I use different controller files: + clients.py for some code + contracts.py for another code + ... And I created subdirrectories in view with required html files. If I work under Windows it's OK and works perfectly but if I use my Ubuntu or LinuxMint stations it seams that view files don't work. Controller's code works well, I receive all my local vars but I see only standart layout instead required view files. How to change this behaviour? Thanks. --
[web2py] WSDL Web service in web2py
Regarding the SOAP web services see e.g. here: http://code.google.com/p/pysimplesoap/wiki/Web2Py --
Re: [web2py] Re: Web2py. for a minimalist app, it feels bloated. Do it I need it?
+1 --
[web2py] Re: Dealing with UTC and converting to local time
Hi, what client side api/library do you use to to talk to OrientDB from web2py? --
Re: [web2py] Example for supporting multiple oauth?
+1 for sanction https://github.com/demianbrecht/sanction Dne neděle, 9. září 2012 19:45:51 UTC+2 Alec Taylor napsal(a): I'm pretty sure in the next version of web2py sanction (or similar) will be integrated into web2py to simplify OAuth setup https://github.com/demianbrecht/sanction Just remind the devs :) [I'm not a dev, trying to increase popularity of web2py through advocating at usergroups + open-sourcing projects built with it] On Mon, Sep 10, 2012 at 3:29 AM, Dave dave@gmail.com javascript: wrote: I have a project that I need to support authentication from multiple oauth providers. In addition I want to allow the user to link their account to multiples. Initially I need to support: LinkedIn Facebook Twitter In the future we will likely add google and perhaps others (pinterest, etc). I really do not care much for the way Janrain works, although I am using it for my proof or concept. I like how web2pyslices works with the facebook google sign-in widgets. Does anybody have sample code similar to what is being done on the slices site for integrating these providers with auth? Thanks! -- --
[web2py] How to use sheduler when running web2py in apache + mod_wsgi scenario ?
How to use sheduler when running web2py in apache + mod_wsgi scenario ? Is it ok to run it as ussual I mean start it separately from apache-wsgi' python web2py.py -K myapp:group1:group2,myotherapp:group1' ? No problem with this? --
[web2py] Re: How to use sheduler when running web2py in apache + mod_wsgi scenario ?
Thanks! also in one of other threads you mentioned NSSM for runnig programs as services on Windows. Does is also work for scheduler worker? Do you have experience with this as an scheduler author :-) ? David Dne pátek, 7. září 2012 16:40:26 UTC+2 Niphlod napsal(a): Perfectly fine.it's the recommended way! Apache co. kill processes that hang up (usually a certain timeout) because normally a page should return something in a small timeframe. This feature is useful to free up resources if the code to generate your webpage is too heavy on the machine, and to let the webserver serve other requests. A scheduler instead is a never-ending process (it's sort of the apache process) that manages other processes to do your tasks, in a totally separate environment from apache itself (so apache is free, and your users happy). Having a scheduler managed by apache is infact killing the purpose of the scheduler. Il giorno venerdì 7 settembre 2012 14:32:09 UTC+2, David Marko ha scritto: How to use sheduler when running web2py in apache + mod_wsgi scenario ? Is it ok to run it as ussual I mean start it separately from apache-wsgi' python web2py.py -K myapp:group1:group2,myotherapp:group1' ? No problem with this? --
[web2py] Re: web2pyslices for Android
Very nice. Just curisous, what did you use, is it completely native, or hybrid using PhoneGap, Trigger.io or something? David Dne úterý, 4. září 2012 1:46:16 UTC+2 rochacbruno napsal(a): Hi, I just published a beta version of web2pyslices reader for Android: https://play.google.com/store/apps/details?id=com.webpyslices (do not expect too much, it just allow you to favorite some slices and notify when a new slice is posted) *Bruno Cezar Rocha** - @rochacbruno* rocha...@gmail.com javascript: | Mobile: +55 (11) 99210-8821 www.CursoDePython.com.br | www.rochacbruno.com.br Blog: Using Python to get all the external links from a webpagehttp://rochacbruno.com.br/using-python-to-get-all-the-external-links-from-a-webpage/ Get a signature like this. http://r1.wisestamp.com/r/landing?promo=18dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18 Click here.http://r1.wisestamp.com/r/landing?promo=18dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18 --