[web2py] Re: Query with postgres

2012-10-17 Thread Paolo
Hi Cliff, I got the reasons of postgres, but I don't know how to fix it. The query is actually very simple, I have several post, I want to group them by s, and get the number of post for each s. Where s is: s=db.club.created_on.year() | db.club.created_on.month() | db.club.created_on.day() In

[web2py] Re: lock table possible?

2012-10-17 Thread vince
well, i think i did some test before and update from other connect was allowed in between the query and update. i will test it again with a time.sleep in between. On Wednesday, October 17, 2012 3:19:42 AM UTC+8, Niphlod wrote: Disclaimer: I may be wrong Reading your example code, you are

[web2py] Re: Odd behavior with domain routes. Can't undo them.

2012-10-17 Thread Anthony
Yes, if you change routes.py, you must either reload routes (which you can do from the admin interface) or restart the webserver. Anthony On Wednesday, October 17, 2012 12:09:51 AM UTC-4, HittingSmoke wrote: I set up my Webfaction hosting with a single web2py install that I intend to use

[web2py] Re: IS_STRONG and CRYPT

2012-10-17 Thread piero crisci
Sorry but i never opened a ticket before. Do you mean open a ticket in google groups or there is a Ticket Request System dedicated for the request?. Thank again Richard and Massimo for the support. Il giorno mercoledì 17 ottobre 2012 00:20:54 UTC+2, Massimo Di Pierro ha scritto: Can you

[web2py] Web2py 2.1.1 csv import bug or ?

2012-10-17 Thread martzi
Hello all, I have being trying to import a csv data to a DAL database and this is what i get: Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Traceback (most recent call last): File /home/xxx/Documents/web2py211/gluon/restricted.py, line 209, in restricted exec ccode in environment

[web2py] link to sqlform.factory

2012-10-17 Thread andrej burja
hi i have one page with links (in view1) {{=A(tag.f_name,_href=URL('games_with_tags_show',vars=dict(tags=tag.f_name )))}} and i have search form (in function2/view2): form = SQLFORM.factory( Field('tags_ava','list:string',label=T('Tags'), requires =

[web2py] Re: URL requests always aiming to default controller...

2012-10-17 Thread apinho
I'm using Version 1.99.7 (2012-03-04 22:12:08) stable If I try, from the example app : https://myserver/examples/session-examples/counter I get : Invalid request This is weird. Meanwhile, as you told me that declaring a default_application on models.py was ineffective, I removed

[web2py] tags and speed

2012-10-17 Thread andrej burja
hi i have table games and they have tags i followed the example in the book and put tags in separate table now i want to show all games with all tags in the view: game.title, games.instruction, game.tags in fuction i have for game in games: equipment =[tag.name for tag in

[web2py] Re: about constraints on fields of table

2012-10-17 Thread dantuluri jaganadha raju
when writing Field('two','time',requires=IS_TIME(format='%H:%M')) I am getting error type 'exceptions.TypeError' __init__() got an unexpected keyword argument 'format' So, please reply as soon as possible. On Friday, October 12, 2012 10:44:23 AM UTC+5:30, dantuluri jaganadha raju wrote: Hi,

Re: [web2py] Re: help me test sessions in cookies

2012-10-17 Thread Michele Comitini
+1 Massimo, is it compressing data also? mic 2012/10/17 Massimo Di Pierro massimo.dipie...@gmail.com On Tuesday, 16 October 2012 17:39:36 UTC-5, Niphlod wrote: BTW, encrypting and decrypting (on the worst case scenario, 4KB of data) takes 4,7 seconds for 1 million iterations. I'd

Re: [web2py] access a configuration file into web2py

2012-10-17 Thread Bruno Rocha
you need to use a dynamic path import os path = os.path.join(request.folder, 'private', 'conf.ini') then place the file in private folder and use the 'path' to read it. Bruno Rocha http://rochacbruno.com.br mobile Em 16/10/2012 19:19, deepak shanky...@gmail.com escreveu: Hi, I have a

[web2py] Re: proposal: change SQLFORM delete checkbox handling

2012-10-17 Thread Mandar Vaze
On Tuesday, March 23, 2010 10:32:19 AM UTC+5:30, Jonathan Lundell wrote: no loss of functionality), but more important it allows us to have an option to SQLFORM.__init__() to override the text associated with the confirmation. 'Sure you want to delete this object?' is somewhat

[web2py] Re: web2py/gluon/compileapp.py throwing ticket

2012-10-17 Thread Massimo Di Pierro
Do you have a file called html.py in myapp/modules/? On Tuesday, 16 October 2012 23:54:55 UTC-5, weheh wrote: I'm getting the following ticket after upgrading from web2py 1.99.x to 2.1.1 source: Traceback (most recent call last): File N:\web2py\gluon\restricted.py, line 209, in

[web2py] Re: Query with postgres

2012-10-17 Thread Massimo Di Pierro
s=db.club.created_on.year(),db.club.created_on.month(),db.club.created_on.day() def join(s): return reduce(lambda a,b:a|b,s) dates = db(query).select(*s,count,orderby=~join(s), limitby=limitby, groupby=join(s)) On Wednesday, 17 October 2012 01:31:55 UTC-5, Paolo wrote: Hi Cliff, I got the

Re: [web2py] Re: help me test sessions in cookies

2012-10-17 Thread Niphlod
patch along the way for that, and some other optimization too. On Wednesday, October 17, 2012 11:24:26 AM UTC+2, Michele Comitini wrote: +1 Massimo, is it compressing data also? mic 2012/10/17 Massimo Di Pierro massimo@gmail.com javascript: On Tuesday, 16 October 2012 17:39:36

[web2py] Re: IS_STRONG and CRYPT

2012-10-17 Thread Massimo Di Pierro
http://code.google.com/p/web2py/issues/list On Wednesday, 17 October 2012 02:12:31 UTC-5, piero crisci wrote: Sorry but i never opened a ticket before. Do you mean open a ticket in google groups or there is a Ticket Request System dedicated for the request?. Thank again Richard and Massimo

[web2py] Re: about constraints on fields of table

2012-10-17 Thread Massimo Di Pierro
I was wrong. My example works for IS_DATE but not IS_TIME. Let me look more into this.. On Wednesday, 17 October 2012 04:17:54 UTC-5, dantuluri jaganadha raju wrote: when writing Field('two','time',requires=IS_TIME(format='%H:%M')) I am getting error type 'exceptions.TypeError' __init__()

[web2py] Re: web2py/gluon/compileapp.py throwing ticket

2012-10-17 Thread weheh
Uh, yes. --

Re: [web2py] Re: URL requests always aiming to default controller...

2012-10-17 Thread Jonathan Lundell
On 17 Oct 2012, at 2:07 AM, apinho jaapi...@sapo.pt wrote: I'm using Version 1.99.7 (2012-03-04 22:12:08) stable If I try, from the example app : https://myserver/examples/session-examples/counter I get : Invalid request This is weird. Meanwhile, as you told me that

Re: [web2py] Re: IS_STRONG and CRYPT

2012-10-17 Thread Richard Vézina
I open the issue! http://code.google.com/p/web2py/issues/detail?id=1098 Richard On Wed, Oct 17, 2012 at 8:36 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: http://code.google.com/p/web2py/issues/list On Wednesday, 17 October 2012 02:12:31 UTC-5, piero crisci wrote: Sorry but i

[web2py] Re: Auth Wiki functionality?

2012-10-17 Thread Bill Thayer
Cool! Thanks. I did not understand what ,load was for. This morning I'm thinking that I'll have to add a See Also field of type 'list:reference wiki_page' to the wiki_page table to handle my many to many relationships. Plus also add a wiki_page_id filed to my parts tables. Thanks for the

Re: [web2py] Re: cannot upgrade to 2.1.1 from GUI on Pythonanywhere

2012-10-17 Thread Hansel Dunlop
Hi Nico, Glad you got it working! I'm one of the PythonAnywhere developers. Would you mind sharing the changes you made to the gui upgrade check? We should have the latest version by default next time we deploy. It's currently running through our integration tests now. Cheers Hansel On

[web2py] Re: Query with postgres

2012-10-17 Thread Paolo
Hi Massimo, thanks for the suggested query but unfortunately I got this error: Traceback (most recent call last): File /home/paolo/Dropbox/git/web2py/gluon/restricted.py, line 208, in restricted ccode = compile2(code,layer) File /home/paolo/Dropbox/git/web2py/gluon/restricted.py, line

[web2py] Re: conditionally process form

2012-10-17 Thread Annet
I tried: form=SQLFORM.factory(...) if form.process(onvalidation=validate_create_node,keepvalues=True).accepted: processForm(form) elif form.errors: response.flash=responseFlash('formerror',session) elif not response.flash: response.flash=responseFlash('form',session) return

[web2py] Changing subject line of email verification email

2012-10-17 Thread Yarin
I'd like to change the subject line of the email verification sent on registration- is that possible? --

[web2py] Re: conditionally process form

2012-10-17 Thread Anthony
First, you can't set session.allow_duplicate to False until you've first checked its value. Second, you have to actually check its value somewhere. Maybe something like this: allow_duplicate = session.allow_duplicate del session.allow_duplicate if not allow_duplicate: if

[web2py] Re: web2py/gluon/compileapp.py throwing ticket [CLOSED]

2012-10-17 Thread Massimo Di Pierro
LOL. The only thing that changed that could have made this work is actually making custom_import work as intended. On Wednesday, 17 October 2012 08:36:15 UTC-5, weheh wrote: Uh, yes. How did you guess? I feel like the kid caught with his hand in the cookie jar by a mind-reading parent.

Re: [web2py] Re: proposal: change SQLFORM delete checkbox handling

2012-10-17 Thread Richard Vézina
Adding a attributes to SQLFORM would be better... The way you do it, mean that you will need to include your little script in every view. Richard On Wed, Oct 17, 2012 at 8:18 AM, Mandar Vaze mandarv...@gmail.com wrote: On Tuesday, March 23, 2010 10:32:19 AM UTC+5:30, Jonathan Lundell wrote:

Re: [web2py] Re: cannot upgrade to 2.1.1 from GUI on Pythonanywhere

2012-10-17 Thread Massimo Di Pierro
I am releasing 2.2.1 tomorrow. It will have support for encrypted sessions in cookie. :-) On Wednesday, 17 October 2012 11:22:09 UTC-5, Hansel Dunlop wrote: Hi Nico, Glad you got it working! I'm one of the PythonAnywhere developers. Would you mind sharing the changes you made to the gui

[web2py] Re: Query with postgres

2012-10-17 Thread Massimo Di Pierro
It should work with python 2.7 but not previous version. You can also do: s=db.club.created_on.year() | db.club.created_on.month() | db.club.created_on.day() dates = db(query).select(db.club.created_on.year(),db.club.created_on.month(),db.club.created_on.day() ,

[web2py] Re: Changing subject line of email verification email

2012-10-17 Thread Massimo Di Pierro
Yes. You can see all the settings below: auth.settings = Storage(dict( login_button = 'Login', register_button = 'Register', password_reset_button = 'Request reset password', password_change_button = 'Change password', profile_save_button = 'Save profile',

[web2py] Re: help test codemirrorw

2012-10-17 Thread Ivan Brkanac
On osx chrome ctrl+f11 full screen is to big there is no end off editor on screen. Also on default view only about 40% is usable for editing rest is mostly waist, key bindings hase same size as usable editor, can this be changed somewhere ? Ivan On Sunday, September 9, 2012 6:26:40 AM UTC+2,

[web2py] unable to submit auth forms

2012-10-17 Thread Rohan Malhotra
Version 2.1.1 (2012-10-15 12:44:40) stable Hi, I am not able to submit an auth form. I am using default auth code. On submitting the form, password is shown as invalid and 'enter from 0 to 512 characters' error is thrown. Input td class=w2p_fw input class=password invalidinput

[web2py] Re: Problem with adding Grids in book

2012-10-17 Thread mikech
Im not seeing the auth user table only db.image and db.comment On Tuesday, October 16, 2012 5:28:24 PM UTC-7, Bill Thayer wrote: Hello Mike, I'm not an expert but i think you need to go to http://127.0.0.1:8000/myapp/appadmin/index then click on the auth user table and add a user, then

Re: [web2py] easy way to validate a list of emails?

2012-10-17 Thread Adi
Thank you Bruno for this! Exactly what I was looking for. Maybe it would be a good idea to add it as a multiple parameter to standard IS_EMAIL(multiple=True, ...) In any case, thanks :) On Wednesday, July 6, 2011 4:39:39 AM UTC-4, rochacbruno wrote: forget the latest, I wrote directly here

[web2py] Re: about constraints on fields of table

2012-10-17 Thread dantuluri jaganadha raju
I kept field('aaa', requires=IS_DATE(format='%H:%M')) . and when I try to open database administration and that particular table I am getting error str' object has no attribute 'year'. Thank in advance. On Friday, October 12, 2012 10:44:23 AM

[web2py] Re: conditionally process form

2012-10-17 Thread Annet
Hi Anthony, Thanks for your reply, problem solved. I have been struggling with an other problem for days, and I have no idea why the function doesn't do what I expect it do do. I have a database containing nodes being organizations and people. These organizations and people can register for

[web2py] how to count() when joining

2012-10-17 Thread Richard
Hello, The book is not clear about counting in context of join : Grouping and counting When doing joins, sometimes you want to group rows according to certain criteria and count them. For example, count the number of things owned by every person. web2py allows this as well. First, you need a

[web2py] Error on OpenShift deploy

2012-10-17 Thread Relsi Hur
Hello, I try to deploy a app int the OpenShift using this option in the admin, but I have a error. Someone has the inside track for this operation? The error is: Traceback (most recent call last): File /home/locatto/Downloads/site-locatto/gluon/restricted.py, line 209, in restricted

Re: [web2py] easy way to validate a list of emails?

2012-10-17 Thread villas
For more unstructured addresses, I also find this useful: http://docs.python.org/library/email.util.html I use parseaddr. --

[web2py] executesql - referring to fields in result?

2012-10-17 Thread Simon Carr
When I run a query using executesql, what is the object that is returned? is it a dictionary? The reason I ask is that I am starting to think that the order of fields being returned to me is not the order that I put them in the SQL statement. As an example, I am running this code. def

[web2py] Re: executesql - referring to fields in result?

2012-10-17 Thread Massimo Di Pierro
You get a list of tuples unless you pass the fields or columns argument. In that case you get a Rows object. On Wednesday, 17 October 2012 16:13:20 UTC-5, Simon Carr wrote: When I run a query using executesql, what is the object that is returned? is it a dictionary? The reason I ask is

[web2py] Re: unable to submit auth forms

2012-10-17 Thread Massimo Di Pierro
What is the code? Is this something that worked before? using a custom form? On Wednesday, 17 October 2012 09:17:57 UTC-5, Rohan Malhotra wrote: Version 2.1.1 (2012-10-15 12:44:40) stable Hi, I am not able to submit an auth form. I am using default auth code. On submitting the form,

[web2py] Putting modified files into a separate directory?

2012-10-17 Thread Csillag
Hi, I am learning web2py. I have a simple web2py application, which consists of ~90 files. I have modified only about 5-10 of them, the rest comes from the 'welcome' app. When managing the project, if possible, I would like to avoid putting all the unmodified files under version control. Is

[web2py] File download permission

2012-10-17 Thread Hanyo
Hi, i want to build a kind of web shop for file download. What I need is individual permission for each uploaded file vs. each user. So far I see two ways of doing that: The first way is to create auth_group for each user and add a permission tot hat group for each file whixh was bought by

[web2py] Re: powerTable AttributeError: 'DAL' object has no attribute 'virtual'

2012-10-17 Thread Jacinto Parga Fernández
Thanks so much!! El lunes, 8 de octubre de 2012 22:15:58 UTC+2, Massimo Di Pierro escribió: :-) On Monday, 8 October 2012 12:53:27 UTC-5, Don_X wrote: BINGO ! - IT WORKS LIKE A CHARM MASSIMO !!! ... Thank you ... now I can study this properly so I can adapt it to my app ! On Monday,

Re: [web2py] Re: cannot upgrade to 2.1.1 from GUI on Pythonanywhere

2012-10-17 Thread Nico Zanferrari
Hi Hansel. I've just changed a single line of code in the default PA installation, following rochacbruno suggestion on https://groups.google.com/forum/#!msg/web2py/glJjRw-TLKU/AkmktM7XExYJ . This allows everyone to simply upgrade by themselves to the latest version from the web2py administrative

[web2py] Re: File download permission

2012-10-17 Thread Massimo Di Pierro
For example only uploader can download: db.define_table('stuff',Field('file','upload'),auth.signature) db.stuff.file.authorize = lambda row: row.created_by==auth.user_id You should be able to extend this to other policies. The policy will be enforced automatically by the download action. On

[web2py] Re: web2py 2.1.1 is OUT!

2012-10-17 Thread Massimo Di Pierro
The line is: from distutils import dir_util I think you need to install distutils separately. On Tuesday, 16 October 2012 09:14:47 UTC-5, apps in tables wrote: when i click on deploy to openshift , I get the error : cannot import name dir_util On Tuesday, October 16, 2012

[web2py] pythondiary

2012-10-17 Thread Massimo Di Pierro
http://www.pythondiary.com/reviews/web2pyV2.0.html --

Re: [web2py] Re: Reloading modules stops working after some time ...

2012-10-17 Thread Richard Vézina
I do notice the same problem here and it drive me crazy... I suspect that, but since it seems to be intermittent, I wasn't sure... I did what you ask and I get True all the time, but the change I had made to module never been applied when page render. Richard On Mon, Oct 15, 2012 at 4:58 PM,

[web2py] delete on GAE

2012-10-17 Thread howesc
Hi all, I'm trying to clean up old expired sessions.but i waited a long time to get to this and now my GAE delete is just timing out. Reading the GAE docs, there appears to be some improvements that we can make to the query delete method on GAE that will make it faster and cheaper. what

[web2py] Re: executesql - referring to fields in result?

2012-10-17 Thread Simon Carr
many thanks Massimo, I had not upgraded (still on 1.x) so the fields option was not available. I just did the upgrade and everything now works fine. On Wednesday, 17 October 2012 22:16:51 UTC+1, Massimo Di Pierro wrote: You get a list of tuples unless you pass the fields or columns argument.

[web2py] Re: proposal: change SQLFORM delete checkbox handling

2012-10-17 Thread howesc
i don't mind the functionality change, though i'll admit that i often forget to update web2py_ajax.html and web2py.js on upgrade. if you add a note to the release that contains this to help remind me that would be helpful. :) On Tuesday, March 23, 2010 6:30:10 AM UTC-7, mdipierro wrote: The

[web2py] Re: pythondiary

2012-10-17 Thread Luther Goh Lu Feng
Great and balanced review imho. Submitted to HN http://news.ycombinator.com/item?id=4666756 On Thursday, October 18, 2012 5:58:24 AM UTC+8, Massimo Di Pierro wrote: http://www.pythondiary.com/reviews/web2pyV2.0.html --

[web2py] Re: tags and speed

2012-10-17 Thread howesc
what database are you using? you might need to add a custom index to your database. try using db._lastsql to see the SQL that web2py executed, and then use the explain query plan feature of your database to look for possible index(es) to add. cfh On Wednesday, October 17, 2012 2:09:17 AM

[web2py] Passing pyodbc timeout argument for a specific request.

2012-10-17 Thread chris_g
I'm using SQL Server with pyodbc on Linux. ( Web2py 1.99.7 ) I have been trying to force a database timeout in certain methods in my controller. I added the following conditional to models/db.py db_connection_string='mssql://dbuser:pwd@dbserver/DB?DRIVER=FreeTDS' if request.function

[web2py] Re: Odd behavior with domain routes. Can't undo them.

2012-10-17 Thread HittingSmoke
Thanks! For whatever reason Reload Routes won't work, but restarting the server did. On Tuesday, October 16, 2012 11:49:14 PM UTC-7, Anthony wrote: Yes, if you change routes.py, you must either reload routes (which you can do from the admin interface) or restart the webserver. Anthony On

[web2py] How to access the auth tables in appadmin?

2012-10-17 Thread mikech
I'm working thru the book again, and when I get to the image tutorial it mentions adding a manager group to the auth tables in appadmin: Using appadmin create a group manager and make some users members of the group. They will not be able to access I cannot find where this is, when I bring

[web2py] Looking for a tutor

2012-10-17 Thread mikech
I would be interested in hooking up with someone for some tutoring online for pay of course. Anyone interested? I'm in California so a similiar time zone would be best. Mike --

[web2py] response.flash during login - backward compatibility issue

2012-10-17 Thread weheh
I use a non-standard login where I user auth.settings.login_onaccept to complete the login process. Prior to upgrading to web2py 2.1.1, my login response.flash would display Welcome so and so. now, it displays Welcome%20so%20and%20so I think something downstream in web2py changed because I

Re: [web2py] easy way to validate a list of emails?

2012-10-17 Thread Adnan Smajlovic
thank you villas. that one is good too! On Wed, Oct 17, 2012 at 3:13 PM, villas villa...@gmail.com wrote: For more unstructured addresses, I also find this useful: http://docs.python.org/library/email.util.html I use parseaddr. -- --

[web2py] Re: response.flash during login - backward compatibility issue

2012-10-17 Thread weheh
I'm now seeing this in other cases, so it's not isolated to login. --

[web2py] Re: tags and speed

2012-10-17 Thread Massimo Di Pierro
You do 1000 selects in that code. I would use a join. What is the purpose of that code? I am sure there is a better way. On Wednesday, 17 October 2012 04:09:17 UTC-5, andrej burja wrote: hi i have table games and they have tags i followed the example in the book and put tags in separate

Re: [web2py] Re: tags and speed

2012-10-17 Thread Bruno Rocha
I am using list:string for tags and it is working very well for my needs. --

[web2py] Re: How to access the auth tables in appadmin?

2012-10-17 Thread Bill Thayer
Try this: In db.py: from gluon.tools import Auth, Crud, Service, PluginManager, prettydate auth = Auth(db) crud, service, plugins = Crud(db), Service(), PluginManager() auth.define_tables(username=True) # arg makes it so you can use a username instead of email to login On Wednesday, October

Re: [web2py] Re: Reloading modules stops working after some time ...

2012-10-17 Thread weheh
I experienced this issue with the 1.99 series web2py. Not enough experience with 2.1.1 to say for sure if it's still there. However, with 2.1.1, when I insert print is_tracking_changes() I always see True. Will report any inconsistencies if I see them in the future. On Thursday, October 18,

[web2py] Re: Reloading modules stops working after some time ...

2012-10-17 Thread Donatas Burba
I have noticed another issue. With version 2.1.1 I can't use appy.pod anymore. It means I can generate only one pdf file, every other try gives me error (that I'm using python which can't access uno). I think that problem is in custom_import.py, so I was forced to return back to 2.0.9, where

Re: [web2py] Re: powerTable AttributeError: 'DAL' object has no attribute 'virtual'

2012-10-17 Thread tomt
After a little digging around on the web I found out why I was powertable was generating errors with the latest web2py. jquery version 1.8 requires jquery-ui-1.8.22 I went to http://jqueryui.com/ and downloaded legacy v1.8.24 which provided jquery-ui-1.8.24.custom.zip. This zip file included

[web2py] problem with logic in a function

2012-10-17 Thread Annet
I have a database containing nodes being either an organization or a person. These organizations and people can register for plan 1, 2, 3 or 4. When they register for plan 2 or 4, I have to enter a node being a hub before registering them as users. This is the function: def register(): #