[web2py] Re: Customizing Retrieve password process
Hi mdipierro, After setting auth.settings.reset_password_requires_verification to True, I got the mail with the below content "Click on the link http://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb to reset your password" however I am not able to load the link http://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb generated above. Also, is there any way to customize the content of the mail? I want to add something above and below the default generated content. Thanks a lot Rohan On Apr 19, 7:24 pm, mdipierro wrote: > Yes. > > auth.settings.reset_password_requires_verification = True > > On Apr 19, 5:10 am, Rohan wrote: > > > > > Hi All, > > > Currently my retrieve password application sends new password directly > > to user. Anyone can reset password of any other user as long as they > > know the email id. So I want to customize the process and want to send > > a mail to user asking user to verify email and reset password from > > some link provided in that page something like verification of email > > while registering. > > > Any pointers? > > > Thanks > > Rohan > > > -- > > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Customizing Retrieve password process
Followup question on this, After email is sent, user is navigated to the login page, but I want user to head back to homepage. Can you please share the settings for this? Thanks Rohan On Apr 20, 12:19 pm, Rohan wrote: > Hi mdipierro, > > After setting auth.settings.reset_password_requires_verification to > True, I got the mail with the below content > > "Click on the > linkhttp://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb > to reset your password" > > however I am not able to load the > linkhttp://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb > generated above. > > Also, is there any way to customize the content of the mail? I want to > add something above and below the default generated content. > > Thanks a lot > Rohan > > On Apr 19, 7:24 pm, mdipierro wrote: > > > > > Yes. > > > auth.settings.reset_password_requires_verification = True > > > On Apr 19, 5:10 am, Rohan wrote: > > > > Hi All, > > > > Currently my retrieve password application sends new password directly > > > to user. Anyone can reset password of any other user as long as they > > > know the email id. So I want to customize the process and want to send > > > a mail to user asking user to verify email and reset password from > > > some link provided in that page something like verification of email > > > while registering. > > > > Any pointers? > > > > Thanks > > > Rohan > > > > -- > > > Subscription > > > settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: storing sessions for auth users
well kind of ... the users should get their "old" customization back once they are logged in this is the easy part, I just have to load the pickled session from the db (I guess), but my question is how to store it properly if I store the session information on logout is not enough I would like to store it as soon as data is written to the session object, but I am not sure how to overwrite the session object for that I see a _try_store_in_db() and _try_store_on_disk() in the session object, are these function called when the session variables change? I guess this would be a nice addition to the session object in general e.g. session.auth_presist everything that is written to the auth_presist object of the session will be stored in the auth_user table along with the user information and whenever the user logges in the auth_presist object is recovered On Apr 19, 4:31 pm, Thadeus Burgess wrote: > Or have a "settings" table that is linked by user id? They only get > the site customizations if they are logged in? > > -- > Thadeus > > > > On Mon, Apr 19, 2010 at 8:01 AM, selecta wrote: > > that should work > > > On Apr 19, 1:06 pm, Jason Brower wrote: > >> On the same lines, I wonder if someone could simply pickle everything is > >> session and save it in teh database under there user id. > >> BR, > >> Jason > > >> On Mon, 2010-04-19 at 03:18 -0700, selecta wrote: > >> > I wonder what is the best way to store session of auth users > > >> > What I want is to retrieve an old session of a user when he loges in > >> > again (restoring all his customizations etc) > >> > To achieve this I could > >> > A) store the session in a table once the user loges out, but then I > >> > would loose changes if the session just expires because the user never > >> > logged out (right?) > >> > B) I could modify the session object to save itself in the database as > >> > soon as it is changed > > >> > B) sounds nicer, but how to do that, maybe somebody already did that? > >> > some help would be nice > > >> -- > >> Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Customizing Retrieve password process
Hi mdipierro, After setting auth.settings.reset_password_requires_verification to True, I got the mail with the below content "Click on the link http://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb to reset your password" however I am not able to load the link http://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb generated above. Thanks a lot Rohan On Apr 19, 7:24 pm, mdipierro wrote: > Yes. > > auth.settings.reset_password_requires_verification = True > > On Apr 19, 5:10 am, Rohan wrote: > > > > > Hi All, > > > Currently my retrieve password application sends new password directly > > to user. Anyone can reset password of any other user as long as they > > know the email id. So I want to customize the process and want to send > > a mail to user asking user to verify email and reset password from > > some link provided in that page something like verification of email > > while registering. > > > Any pointers? > > > Thanks > > Rohan > > > -- > > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Customizing Retrieve password process
Hi mdipierro, If i override the text of email by setting auth.messages.reset_password and replace "http://...reset_password/ 1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb" with "http:/// /default/user/reset_password/ 1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb", it works. Is this correct way of doing it? Also my "To" field in the email received by user, is showing ="?utf-8? q?com?=" any ideas? Thanks Rohan On Apr 20, 12:48 pm, Rohan wrote: > Hi mdipierro, > > After setting auth.settings.reset_password_requires_verification to > True, I got the mail with the below content > > "Click on the > linkhttp://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb > to reset your password" > > however I am not able to load the > linkhttp://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb > generated above. > > Thanks a lot > Rohan > > On Apr 19, 7:24 pm, mdipierro wrote: > > > > > Yes. > > > auth.settings.reset_password_requires_verification = True > > > On Apr 19, 5:10 am, Rohan wrote: > > > > Hi All, > > > > Currently my retrieve password application sends new password directly > > > to user. Anyone can reset password of any other user as long as they > > > know the email id. So I want to customize the process and want to send > > > a mail to user asking user to verify email and reset password from > > > some link provided in that page something like verification of email > > > while registering. > > > > Any pointers? > > > > Thanks > > > Rohan > > > > -- > > > Subscription > > > settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Auth bug when registration requires approval
In gluon/tools.py function register() starting from line 1246 must read: elif self.settings.registration_requires_approval: table_user[form.vars.id] = dict(registration_key='pending') Currently it is: elif self.settings.registration_requires_approval: user[form.vars.id] = dict(registration_key='pending') which gives an error 'Variable user is used before assignment'. -- Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Debian Packaging
Hello Massimo, I'm almost done with my exames, so i've a little sparetime left. What brings me back to webpy packaging. Well I'm fairly new to web2p development. And have no clue how the process goes. I read somewhere in the mailinglist that you approve changes. And publish them into a new version. My question is: How and where would you like to have the web2py packaging system developt? and How would you like to have the packaging system to work? Because if the above statement is right, then you would be the end user of the packaging system. I hope you can get me on the road. regards, Mark Breedveld, -- Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: recaptcha in LOAD not working
I found out that if the java scrip files (.js files) are loaded in the initial load of the page the embedded javascript of the ajax loaded pages is executed e.g. default.py def index(): response.files.append(URL(request.application,'static/jquery- autocomplete','jquery.autocomplete.pack.js')) response.files.append(URL(request.application,'static/jquery- autocomplete','jquery.autocomplete.css')) response.files.append(URL(request.application,'static/jquery- autocomplete','jquery.autocomplete.pack.js')) response.files.append(URL(request.application,'static/jquery- autocomplete/lib','jquery.bgiframe.min.js')) response.files.append(URL(request.application,'static/jquery- autocomplete/lib','jquery.dimensions.js')) return dict() def test(): form = form_factory(Field('myfield')) script = SCRIPT('''$(document).ready(function(){ $("#no_table_myfield").autocomplete(["a","b"]); });''') return TAG[''](form, script) default/index.html LOAD('default', 'test', ajax=True) this works in additioin to that I read that the ajax function can load javascrips ... this could mean that something along the lines of script = SCRIPT('''$(document).ready(function(){ jQuery.ajax(url: "%s") $("#no_table_myfield").autocomplete(["a","b"]); });'''%URL(request.application,'static/jquery- autocomplete','jquery.autocomplete.pack.js')) could fix some problems, I did not try it out yet since I spend too much time already figuring out the first issue On Apr 15, 2:34 pm, selecta wrote: > I guess one of these linked libs will help to solve the > problemhttp://ajaxpatterns.org/On-Demand_Javascript > I am hitting this border more often now since I develop everything > modular now and it is getting quite annoying > > On Apr 8, 3:02 pm, selecta wrote: > > > > > currently i'm quite buisy but i will send you a test app soon > > my data > > on Ubuntu 9.10 > > opera 10.10, google-chrome-beta 5.0.342.9-r43360, firefox 3.5.8 > > web2py 1.76.3 and whatever jquery version comes with it > > > On Apr 7, 12:24 pm, DenesL wrote: > > > > Hi selecta, can you send me a test app?. > > > I have been testing and documenting ajax in web2py 1.76.3 in my spare > > > time. > > > > Which jQuery, browser and web2py versions are you using?. > > > > On Apr 5, 5:05 pm, selecta wrote: > > > > > I tried to use Recaptcha in a LOAD div but I does not work > > > > > The problem is that the page stats reloading when it gets to the div > > > > loaded with LOAD where the recaptcha javascripts are in and gets stuck > > > > on reloading it > > > > > controller: > > > > ... > > > > form = SQLFORM.factory(Field('tag_name')) > > > > captcha = None > > > > if not auth.user: > > > > captcha = Recaptcha(request,'xxx','xxx') > > > > form[0].append(captcha) > > > > if request.vars.tag_name: > > > > > > > > if form.accepts(request.vars, session): > > > > ... > > > > return dict(form=form, captcha = captcha) > > > > > view tag.html: > > > > {{=form.custom.begin}} > > > > ... > > > > {{=captcha}} > > > > {{=form.custom.end}} > > > > {{pass}} > > > > > view default.html: > > > > LOAD('default','tag',args=(table_name,record_id),ajax=True) <- does > > > > not work > > > > > but with > > > > LOAD('default','tag',args=(table_name,record_id)) > > > > at least the page loads -- Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] ValueError: invalid literal for int() with base 10:
In db.py I defined the following tables: db.define_table('company', Field('company',length=54,default='',notnull=True), migrate=False) db.define_table('application', Field('application',length=24,default='',notnull=True,unique=True), migrate=False) db.define_table('companyapplication', Field('company',db.company,default='',notnull=True,ondelete='CASCADE'), Field('application',db.application,default='',notnull=True,ondelete='RESTRICT'), migrate=False) db.companyapplication.company.requires=[IS_IN_DB(db,db.company.id,'% (company)s'),IS_NOT_IN_DB(db(db.companyapplication.application==request.vars.application),db.companyapplication.company,error_message='combination of company en application already in database')] db.companyapplication.application.requires=IS_IN_DB(db,db.application.id,'% (application)s') In appadmin/insert/db/application I get the following error when I want to insert an application: Traceback (most recent call last): File "/Library/Python/2.5/site-packages/web2py/gluon/restricted.py", line 173, in restricted exec ccode in environment File "/Library/Python/2.5/site-packages/web2py/applications/base/ models/db.py", line 216, in db.companyapplication.company.requires=[IS_IN_DB(db,db.company.id,'% (company)s'),IS_NOT_IN_DB(db(db.companyapplication.application==request.vars.application),db.companyapplication.company,error_message='combination of company and application already in database')] File "/Library/Python/2.5/site-packages/web2py/gluon/sql.py", line 2424, in __eq__ return Query(self, '=', value) File "/Library/Python/2.5/site-packages/web2py/gluon/sql.py", line 2839, in __init__ right = sql_represent(right, left.type, left._db._dbname, left._db._db_codec) File "/Library/Python/2.5/site-packages/web2py/gluon/sql.py", line 510, in sql_represent return str(int(obj)) ValueError: invalid literal for int() with base 10: 'Supplier' I don't understand why I get an error on the validator of the companyapplication table whereas I want to insert a record into the application table. What's causing this error? How do I solve it? Kind regards, Annet. -- Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en
Re: [web2py] rocket performance
Thank you. It's always good to see the fruits of one's labor come out. On 4/19/2010 3:57 PM, elffikk wrote: a simple test loading one by one the same link, leaving concurrency and advanced testing to Tim and others :) just wanted to feel the improvement, and I have to say Tim did his job very well web2py 1.76.5 vs 1.77.1 load test 10 requests: 1.76.5 - 0.3016 seconds 1.77.1 - 0.2736 seconds 100 requests: 1.76.5 - 1.7729 seconds 1.77.1 - 1.4585 seconds 1000 requests: 1.76.5 - 16.6493 seconds 1.77.1 - 13.4033 seconds and here is the great test script :) import sys, urllib n = int((sys.argv[1:] or [10])[0]) s = 'http://127.0.0.1:8001/' # s = 'http://127.0.0.1:8002/' for i in xrange(n): urllib.urlopen(s).read() -- Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: getting started with fbconnect
Looks good to me. On Apr 20, 12:37 am, Rohan wrote: > I found some code onhttp://codepad.org/tadGosTd > > I want to know if below piece of code is sufficient for creating a > record in auth.user table and creating a session for a user connected > using facebook connect? > > logged_user = Users.find_by_fb_id(user['uid']) > user_id = db.users.insert(fb_id=user['uid'], name=user['name'], > age=user['age']) if not len(logged_user) else logged_user[0].id > > if not auth.is_logged_in(): > user_obj = > Storage(the_data._filter_fields(Users.find_by_id(user_id) > [0], id=True)) > session.auth = Storage(user=user_obj, last_visit=request.now, > expiration=2600) > auth.user = user_obj > > On Apr 20, 10:10 am, howesc wrote: > > > Rohan, > > > Someone pointed out gaema (http://code.google.com/p/gaema/) on the > > group a couple of weeks ago as a tool that integrates google, twitter, > > facebook, and others with google app engine. i'm in the process of > > adapting it to work with web2py auth (for GAE and non GAE apps). If > > all goes well look for an update from me in the next day or two with > > my progress. > > > christian > > > On Apr 19, 12:17 am, Rohan wrote: > > > > Hi All, > > > > I want to use fbconnect with web2py. I found couple of threads in this > > > group > > > 1.http://groups.google.com/group/web2py/browse_frm/thread/84f27e0a06312... > > > 2.http://groups.google.com/group/web2py/browse_frm/thread/31e9149ad7310... > > > > but I am not able to find any document to get started with using > > > fbconnect with web2py. I have already obtained API key from facebook. > > > Can someone please share any doc for using fbconnect with web2py? > > > > Thanks
[web2py] Re: Auth bug when registration requires approval
This is fixed in 1.77.x On Apr 20, 3:05 am, SergeyPo wrote: > In gluon/tools.py > function register() > starting from line 1246 > must read: > > elif self.settings.registration_requires_approval: > table_user[form.vars.id] = dict(registration_key='pending') > > Currently it is: > > elif self.settings.registration_requires_approval: > user[form.vars.id] = dict(registration_key='pending') > > which gives an error 'Variable user is used before assignment'. > > -- > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Customizing Retrieve password process
Look at the first code example in this page: http://docs.python.org/library/email.header.html Massimo On Apr 20, 3:00 am, Rohan wrote: > Hi mdipierro, > > If i override the text of email by setting > auth.messages.reset_password and replace "http://...reset_password/ > 1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb" with "http:/// > /default/user/reset_password/ > 1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb", it works. > > Is this correct way of doing it? > > Also my "To" field in the email received by user, is showing ="?utf-8? > q?com?=" any ideas? > > Thanks > Rohan > > On Apr 20, 12:48 pm, Rohan wrote: > > > Hi mdipierro, > > > After setting auth.settings.reset_password_requires_verification to > > True, I got the mail with the below content > > > "Click on the > > linkhttp://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb > > to reset your password" > > > however I am not able to load the > > linkhttp://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb > > generated above. > > > Thanks a lot > > Rohan > > > On Apr 19, 7:24 pm, mdipierro wrote: > > > > Yes. > > > > auth.settings.reset_password_requires_verification = True > > > > On Apr 19, 5:10 am, Rohan wrote: > > > > > Hi All, > > > > > Currently my retrieve password application sends new password directly > > > > to user. Anyone can reset password of any other user as long as they > > > > know the email id. So I want to customize the process and want to send > > > > a mail to user asking user to verify email and reset password from > > > > some link provided in that page something like verification of email > > > > while registering. > > > > > Any pointers? > > > > > Thanks > > > > Rohan > > > > > -- > > > > Subscription > > > > settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Debian Packaging
This is partially true. I approves changes in the web2py source code but I am not convinced that packaging for debian requires changing in the web2py source code. In fact, I hope it does not. If it does not, there is nothing for me to approve, although I will be happy to review your proposal and test it. Thanks for your help on this. Massimo On Apr 20, 3:15 am, Mark Breedveld wrote: > Hello Massimo, > > I'm almost done with my exames, so i've a little sparetime left. > What brings me back to webpy packaging. > > Well I'm fairly new to web2p development. > And have no clue how the process goes. > > I read somewhere in the mailinglist that you approve changes. > And publish them into a new version. > > My question is: > How and where would you like to have the web2py packaging system > developt? > and > How would you like to have the packaging system to work? > > Because if the above statement is right, then you would be the end > user of the packaging system. > > I hope you can get me on the road. > > regards, > > Mark Breedveld, > > -- > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: ValueError: invalid literal for int() with base 10:
The error refer to a field Supplier and I do not see it defined. Some other part of the code is causing the problem and I cannot help tell without look at it all. On Apr 20, 6:51 am, annet wrote: > In db.py I defined the following tables: > > db.define_table('company', > Field('company',length=54,default='',notnull=True), > migrate=False) > > db.define_table('application', > > Field('application',length=24,default='',notnull=True,unique=True), > migrate=False) > > db.define_table('companyapplication', > > Field('company',db.company,default='',notnull=True,ondelete='CASCADE'), > > Field('application',db.application,default='',notnull=True,ondelete='RESTRICT'), > migrate=False) > > db.companyapplication.company.requires=[IS_IN_DB(db,db.company.id,'% > (company)s'),IS_NOT_IN_DB(db(db.companyapplication.application==request.vars.application),db.companyapplication.company,error_message='combination > of company en application already in database')] > db.companyapplication.application.requires=IS_IN_DB(db,db.application.id,'% > (application)s') > > In appadmin/insert/db/application I get the following error when I > want to insert an application: > > Traceback (most recent call last): > File "/Library/Python/2.5/site-packages/web2py/gluon/restricted.py", > line 173, in restricted > exec ccode in environment > File "/Library/Python/2.5/site-packages/web2py/applications/base/ > models/db.py", line 216, in > > db.companyapplication.company.requires=[IS_IN_DB(db,db.company.id,'% > (company)s'),IS_NOT_IN_DB(db(db.companyapplication.application==request.vars.application),db.companyapplication.company,error_message='combination > of company and application already in database')] > File "/Library/Python/2.5/site-packages/web2py/gluon/sql.py", line > 2424, in __eq__ > return Query(self, '=', value) > File "/Library/Python/2.5/site-packages/web2py/gluon/sql.py", line > 2839, in __init__ > right = sql_represent(right, left.type, left._db._dbname, > left._db._db_codec) > File "/Library/Python/2.5/site-packages/web2py/gluon/sql.py", line > 510, in sql_represent > return str(int(obj)) > ValueError: invalid literal for int() with base 10: 'Supplier' > > I don't understand why I get an error on the validator of the > companyapplication table whereas I want to insert a record into the > application table. > > What's causing this error? How do I solve it? > > Kind regards, > > Annet. > > -- > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: can I hook my code to db.connect() ?
I think I understand better the problem. Oracle uses the same time for DATE and DATETIME, i.e. DATE. I made in trunk the change you suggested. Can you please check this does not break insert and select of Field('somename','date')? On Apr 20, 12:37 am, Alexey Nezhdanov wrote: > Oh, well. > May be that's an Oracle bug then. I use my custom 'console.py' script here, > but output should be clear enough: > > BTW - time_start column was created by web2py with this line: > Field('time_start','datetime'), > > sn...@nezhdanov:~/VTC/pinger/elixir$ ./console.py > select time_start from pinger_results where id=1; > [('TIME_START', , 23, 7, 0, 0, 1)] > select time_start from pinger_results where time_start='2010-04-20 > 15:16:17'; > ORA-01861: литерал не соответствует формату строки > ALTER SESSION set NLS_DATE_FORMAT = '-MM-DD HH24:MI:SS' > ok > select time_start from pinger_results where time_start='2010-04-20 > 15:16:17'; > [('TIME_START', , 23, 7, 0, 0, 1)] > == > no comments > > Alexey > > On Mon, Apr 19, 2010 at 8:27 PM, mdipierro wrote: > > taking a second look at the source code > > > self._execute("ALTER SESSION SET NLS_DATE_FORMAT = '- > > MM-DD';") > > self._execute("ALTER SESSION SET NLS_TIMESTAMP_FORMAT = > > '-MM-DD HH24:MI:SS';") > > > Now you propose adding: > > > self._execute("ALTER SESSION set NLS_DATE_FORMAT = '- > > MM-DD HH24:MI:SS';") > > > But date does not have HH224, MI, SS, only timestamp does. > > > On Apr 19, 11:19 am, Alexey Nezhdanov wrote: > > > No, I'm all for it. Actually it sounds more like bugfix since atm web2py > > > can't make datetime queries on Oracle. > > > > On Mon, Apr 19, 2010 at 6:16 PM, mdipierro > > wrote: > > > > There is no hook for this, but should this not be always the default? > > > > If so I am happy to add it to trunk. Any counterindication? > > > > > On Apr 19, 12:32 am, Alexey Nezhdanov wrote: > > > > > Hi. > > > > > Sometimes I have to execute this line prior to making a query: > > > > > oradb.executesql("ALTER SESSION set NLS_DATE_FORMAT = '-MM-DD > > > > > HH24:MI:SS';") > > > > > > That is because Oracle by default uses different date format that > > causes > > > > my > > > > > queries to fail. > > > > > The problem is that doing that in model is incorrect - this should be > > > > > executed just once for each db connection. > > > > > Doing that just prior to query is inconvenient and still incorrect - > > I am > > > > > probably reusing same connection. > > > > > Can I somehow tell web2py to execute this sql right after calling > > > > connect()? > > > > > > Regards > > > > > Alexey > > > > > > -- > > > > > Subscription settings: > > > >http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: rocket performance
I made a mistake. Left references to cherry in some of the pages in applications/example. Could you help me locate them and suggest changes? Massimo On Apr 20, 8:11 am, Timothy Farrell wrote: > Thank you. It's always good to see the fruits of one's labor come out. > > On 4/19/2010 3:57 PM, elffikk wrote: > > > > > a simple test loading one by one the same link, leaving concurrency > > and advanced testing to Tim and others :) > > just wanted to feel the improvement, and I have to say Tim did his job > > very well > > > web2py 1.76.5 vs 1.77.1 load test > > > 10 requests: > > 1.76.5 - 0.3016 seconds > > 1.77.1 - 0.2736 seconds > > > 100 requests: > > 1.76.5 - 1.7729 seconds > > 1.77.1 - 1.4585 seconds > > > 1000 requests: > > 1.76.5 - 16.6493 seconds > > 1.77.1 - 13.4033 seconds > > > and here is the great test script :) > > > import sys, urllib > > n = int((sys.argv[1:] or [10])[0]) > > s = 'http://127.0.0.1:8001/'# s = 'http://127.0.0.1:8002/' > > for i in xrange(n): > > urllib.urlopen(s).read() > > -- > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Debian Packaging
My excuses, that was not what I ment. I ment was. How do you package the application before publish it? Is there a repo? Do have a script to do that? It is a question about the process, not a technical web2py question. And my second question was how should we develop the deb package? Is there a repo that we could use for package code/script? Who approves or creates the debian packages for every release? And how should we use it? I'm new to the opensource, so any advice would be welcome. regards Mark, On Apr 20, 4:09 pm, mdipierro wrote: > This is partially true. I approves changes in the web2py source code > but I am not convinced that packaging fordebianrequires changing in > the web2py source code. In fact, I hope it does not. If it does not, > there is nothing for me to approve, although I will be happy to review > your proposal and test it. > > Thanks for your help on this. > > Massimo > > On Apr 20, 3:15 am, Mark Breedveld wrote: > > > Hello Massimo, > > > I'm almost done with my exames, so i've a little sparetime left. > > What brings me back to webpy packaging. > > > Well I'm fairly new to web2p development. > > And have no clue how the process goes. > > > I read somewhere in the mailinglist that you approve changes. > > And publish them into a new version. > > > My question is: > > How and where would you like to have the web2py packaging system > > developt? > > and > > How would you like to have the packaging system to work? > > > Because if the above statement is right, then you would be the end > > user of the packaging system. > > > I hope you can get me on the road. > > > regards, > > > Mark Breedveld, > > > -- > > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Debian Packaging
I have a script to make the binaries but for the source, I just zip the mercurial source. I do not have an answer to the second question. Massimo On Apr 20, 9:34 am, Mark Breedveld wrote: > My excuses, that was not what I ment. > > I ment was. > > How do you package the application before publish it? > Is there a repo? Do have a script to do that? > > It is a question about the process, not a technical web2py question. > > And my second question was how should we develop the deb package? Is > there a repo that we could use for package code/script? Who approves > or creates the debian packages for every release? And how should we > use it? > > I'm new to the opensource, so any advice would be welcome. > > regards Mark, > > On Apr 20, 4:09 pm, mdipierro wrote: > > > This is partially true. I approves changes in the web2py source code > > but I am not convinced that packaging fordebianrequires changing in > > the web2py source code. In fact, I hope it does not. If it does not, > > there is nothing for me to approve, although I will be happy to review > > your proposal and test it. > > > Thanks for your help on this. > > > Massimo > > > On Apr 20, 3:15 am, Mark Breedveld wrote: > > > > Hello Massimo, > > > > I'm almost done with my exames, so i've a little sparetime left. > > > What brings me back to webpy packaging. > > > > Well I'm fairly new to web2p development. > > > And have no clue how the process goes. > > > > I read somewhere in the mailinglist that you approve changes. > > > And publish them into a new version. > > > > My question is: > > > How and where would you like to have the web2py packaging system > > > developt? > > > and > > > How would you like to have the packaging system to work? > > > > Because if the above statement is right, then you would be the end > > > user of the packaging system. > > > > I hope you can get me on the road. > > > > regards, > > > > Mark Breedveld, > > > > -- > > > Subscription > > > settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: ValueError: invalid literal for int() with base 10:
Massimo, > The error refer to a field Supplier and I do not see it defined. 'Supplier is the value I enter for the Field application in the application table. > Some other part of the code is causing the problem and I cannot help tell > without look at it all. Yes, the validator defined after the companyapplication table: db.define_table('companyapplication', Field('company',db.company,), Field('application',db.application), migrate=False) db.companyapplication.company.requires=[IS_IN_DB(db,db.company.id,'% (company)s'),\ IS_NOT_IN_DB(db(db.companyapplication.application==request.vars.application), \ db.companyapplication.company,error_message='combination of company en application already in database')] That's all the information related to this problem. I hope it's enough to solve the problem, because it's a recurrent one. Kind regards, Annet. -- Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: ValueError: invalid literal for int() with base 10:
In this line: IS_NOT_IN_DB(db(db.companyapplication.application==request.vars.application), db.companyapplication.application is a reference field (i.e. an integer) request.vars.application is a string 'Supplier'. That is the problem. Please explain in words what these table represent and what you want to achieve. I am sure we can find a solution. Massimo On Apr 20, 10:19 am, annet wrote: > Massimo, > > > The error refer to a field Supplier and I do not see it defined. > > 'Supplier is the value I enter for the Field application in the > application table. > > > Some other part of the code is causing the problem and I cannot help tell > > without look at it all. > > Yes, the validator defined after the companyapplication table: > > db.define_table('companyapplication', > Field('company',db.company,), > Field('application',db.application), > migrate=False) > > db.companyapplication.company.requires=[IS_IN_DB(db,db.company.id,'% > (company)s'),\ > IS_NOT_IN_DB(db(db.companyapplication.application==request.vars.application), > \ > db.companyapplication.company,error_message='combination > of company en application already in database')] > > That's all the information related to this problem. I hope it's enough > to solve the problem, because it's a recurrent one. > > Kind regards, > > Annet. > > -- > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
Re: [web2py] Re: http://www.web2py.com doesnt load
You mean, I will finally have a way to run stable versions of web2py but easily update them !? w00t! -- Thadeus On Tue, Apr 20, 2010 at 12:26 AM, Yarko Tymciurak wrote: > heckings, so you can ALWAYS get the latest release from Goog -- Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Debian Packaging
On Apr 20, 9:34 am, Mark Breedveld wrote: > My excuses, that was not what I ment. > > I ment was. > > How do you package the application before publish it? > Is there a repo? Do have a script to do that? Mark - Perhaps this will help: - The repo is http://code.google.com/p/web2py/ - the application has a makefile for build / distribution (see http://code.google.com/p/web2py/source/browse/Makefile) it's not so much a production process, as a convenient collection of steps for Massimo to use when you prepares a release, but it should provide you some insight (there may be steps not captured in the makefile). - The packaged files (a source zip, a mac executable, a windows executable) are posted on www.web2py.com; See the makefile entries for these at "src", "app", "win". Since web2py (for development) requires "no installation" (caveat: if running source, you need to have python installed), you run web2py as shown in the Makefile entry: "run" > > It is a question about the process, not a technical web2py question. > > And my second question was how should we develop the deb package? Is > there a repo that we could use for package code/script? Who approves > or creates the debian packages for every release? And how should we > use it? Probably what you are asking is how you will add to the Makefile - and codify the deb packaging process: I think you would want to make a clone from the google-code repo, make your package commands, and submit for review; Massimo would have people from the list test the installation in various contexts, and it would go from there. I presume once a packaging process is created, understood, and accepted by all, Massimo would merge it (I expect Makefile entries) and begin to add it to his release process - so that a release would include packaging up for submittal to a debian repository. Some questions that come to mind: What would an acceptable release frequency be (Massimo releases relatively frequently)? Does a local-host install of web2py make sense? Is this the right mechanism for releasing web2py? There will be people more interested in configuration and deployment in a server environment, and the configurations (apache, etc.) and choices are beyond a package. A standard installation in a server environment may not make sense, as the web2py instance will have additions of application code - either it needs to be in user space, or (as on a slice) user has to have access to the installation area, to add to it (minmally, links to the web2py applications). For personal installation, for local development, a package doesn't make sense: unzip, run, develop --- that's the normal process (and you begin to insert your application code in the tree). I hope this was helpful, answered some of your questions. - Yarko > > I'm new to the opensource, so any advice would be welcome. > > regards Mark, > > On Apr 20, 4:09 pm, mdipierro wrote: > > > This is partially true. I approves changes in the web2py source code > > but I am not convinced that packaging fordebianrequires changing in > > the web2py source code. In fact, I hope it does not. If it does not, > > there is nothing for me to approve, although I will be happy to review > > your proposal and test it. > > > Thanks for your help on this. > > > Massimo > > > On Apr 20, 3:15 am, Mark Breedveld wrote: > > > > Hello Massimo, > > > > I'm almost done with my exames, so i've a little sparetime left. > > > What brings me back to webpy packaging. > > > > Well I'm fairly new to web2p development. > > > And have no clue how the process goes. > > > > I read somewhere in the mailinglist that you approve changes. > > > And publish them into a new version. > > > > My question is: > > > How and where would you like to have the web2py packaging system > > > developt? > > > and > > > How would you like to have the packaging system to work? > > > > Because if the above statement is right, then you would be the end > > > user of the packaging system. > > > > I hope you can get me on the road. > > > > regards, > > > > Mark Breedveld, > > > > -- > > > Subscription > > > settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: http://www.web2py.com doesnt load
This is easier than I thought. Thanks to yarko for insisting about this. Please make sure I do it properly. On Apr 20, 10:27 am, Thadeus Burgess wrote: > You mean, I will finally have a way to run stable versions of web2py > but easily update them !? w00t! > > -- > Thadeus > > On Tue, Apr 20, 2010 at 12:26 AM, Yarko Tymciurak > > wrote: > > heckings, so you can ALWAYS get the latest release from Goog > > -- > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Webfaction rocks
I just wanted to pass along how awesome webfaction rocks! I just signed up for an account with them. During the signup process they ask what software you will be using with the service. I specified OTHER->web2py. When I got the email of the server, I went to the URL and there was already a web2py instance up and running with the welcome application! I didn't have to do a thing! Go webfaction :) -- Thadeus -- Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Webfaction rocks
Nice. So no more slicehost or is this an additional account? On Apr 20, 11:47 am, Thadeus Burgess wrote: > I just wanted to pass along how awesome webfaction rocks! > > I just signed up for an account with them. During the signup process > they ask what software you will be using with the service. I specified > OTHER->web2py. When I got the email of the server, I went to the URL > and there was already a web2py instance up and running with the > welcome application! I didn't have to do a thing! > > Go webfaction :) > > -- > Thadeus > > -- > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Debian Packaging
Thank you very much, This are some of the answers I was looking for. I'll dive into it, tomorrow. But this gives me an idea about how the release cicle is done. And how we could implement the debian packages in it. Which has been discussed in an earlier. http://groups.google.com/group/web2py/browse_frm/thread/51b731d9abb5270d/7eb4e9f60e683e01?hl=en&lnk=gst&q=debian#7eb4e9f60e683e01 This might give an idea why we want to package web2py. And the reason I started this post was because I had the same questions as you. The frequent releases of Massimo etc. More than enough to discuss, but first I'll study the answer you give me and come up with an idea == more questions :p. regards Mark Breedveld,
Re: [web2py] Re: Webfaction rocks
This is an additional account for a client I am working with. I have heard the most success with webfaction and web2py so I wanted to try it out. So good so far. I would have preferred GAE for this project, but the client did not agree. I would still use slicehost hands down if cost/time is not an issue. -- Thadeus On Tue, Apr 20, 2010 at 12:02 PM, mr.freeze wrote: > Nice. So no more slicehost or is this an additional account? > > On Apr 20, 11:47 am, Thadeus Burgess wrote: >> I just wanted to pass along how awesome webfaction rocks! >> >> I just signed up for an account with them. During the signup process >> they ask what software you will be using with the service. I specified >> OTHER->web2py. When I got the email of the server, I went to the URL >> and there was already a web2py instance up and running with the >> welcome application! I didn't have to do a thing! >> >> Go webfaction :) >> >> -- >> Thadeus >> >> -- >> Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en >
[web2py] lighttpd + mod_rewrite question/issue
would like the following behavior: request = http://www.example.com/ to go to http://www.example.com/exampleapplication instead of what it would do normally which would be http://www.example.com/welcome/default/index But I would like this to be entirely unseen by the user. -- Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: GAE, parents, and row objects.
is parent a GAE thing? if not, then wouldn't parent be setup as a reference to book (in this example), and db.review.insert(parent = book.id, text = 'The book was great) would work? cfh On Apr 18, 9:15 pm, Matt wrote: > Thanks Massimo. > > Matt > > On Apr 19, 1:53 pm, mdipierro wrote: > > > No but there should. Will look into this. If anybody has come concrete > > proposals, let me know. > > > Massimo > > > On Apr 18, 7:30 pm, Matt wrote: > > > > Hi, > > > > Quick question when using web2py with GAE. > > > > I need to assign a model as the parent of another entity. > > > > How can I retrieve the GAE "model instance" from a web2py query...? > > > > book = db.book[request.args(0)] > > > > [The book is returned as a row] > > > > I'd like to do the following: > > > > db.review.insert(parent = book, text = 'The book was great) > > > > Is there an easy way to do this? > > > > Thanks in advance, > > > Matt > > > > -- > > > Subscription > > > settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: getting started with fbconnect
you are missing the creation of the default group when you create a new user (that is done for you in auth automagically), so if you want/ need those groups you would want to add a block like: if auth.settings.create_user_groups: group_id = auth.add_group("user_%s" % user_id) auth.add_membership(group_id, user_id) cfh On Apr 19, 10:37 pm, Rohan wrote: > I found some code onhttp://codepad.org/tadGosTd > > I want to know if below piece of code is sufficient for creating a > record in auth.user table and creating a session for a user connected > using facebook connect? > > logged_user = Users.find_by_fb_id(user['uid']) > user_id = db.users.insert(fb_id=user['uid'], name=user['name'], > age=user['age']) if not len(logged_user) else logged_user[0].id > > if not auth.is_logged_in(): > user_obj = > Storage(the_data._filter_fields(Users.find_by_id(user_id) > [0], id=True)) > session.auth = Storage(user=user_obj, last_visit=request.now, > expiration=2600) > auth.user = user_obj > > On Apr 20, 10:10 am, howesc wrote: > > > Rohan, > > > Someone pointed out gaema (http://code.google.com/p/gaema/) on the > > group a couple of weeks ago as a tool that integrates google, twitter, > > facebook, and others with google app engine. i'm in the process of > > adapting it to work with web2py auth (for GAE and non GAE apps). If > > all goes well look for an update from me in the next day or two with > > my progress. > > > christian > > > On Apr 19, 12:17 am, Rohan wrote: > > > > Hi All, > > > > I want to use fbconnect with web2py. I found couple of threads in this > > > group > > > 1.http://groups.google.com/group/web2py/browse_frm/thread/84f27e0a06312... > > > 2.http://groups.google.com/group/web2py/browse_frm/thread/31e9149ad7310... > > > > but I am not able to find any document to get started with using > > > fbconnect with web2py. I have already obtained API key from facebook. > > > Can someone please share any doc for using fbconnect with web2py? > > > > Thanks
[web2py] Re: Webfaction rocks
Hi Thadeus, You're right, WebFaction rocks. However, when you want to upload and install a packed application you will have to proceed as follows: 1. Log on to WebFaction via terminal/ssh 2. cd to your remote web2py/application directory 3. Make a directory by the name of the packed application 4. Upload and install the packed web2py application via the web interface and rename it to match the name of the directory you manually created. https://admin.domain_name.com/admin/default/site In the upload and install form browse to the directory where the packed application resides, rename it (required) packed_application_name and check the overwrite installed app check box. Click install. Thanks to Chris, who helped me solve this problem! Kind regards, Annet. -- Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Webfaction rocks
On Apr 20, 12:08 pm, Thadeus Burgess wrote: > This is an additional account for a client I am working with. I have > heard the most success with > webfaction and web2py so I wanted to try it out. So good so far. > > I would have preferred GAE for this project, but the client did not agree. > > I would still use slicehost hands down if cost/time is not an issue. I have a client _very_ adept at setting up slices, and talking about a cloud presence so as to be able to do large scale simulations, tests. I gave them a shell account so they could see their project space I was maintaining (I rsync updates regularly). They promptly got their own account. "Why", I asked. "I thought you were going to get a slice!" "We liked how this looked - this is much easier to setup and maintain things - gives us all sorts of useful stuff, without the bother of setting up and maintaining a slice." They made use within hours. Sure, they will use slices and cloud when needed - but for quick demos, simple setups, and low traffic - this is just too accessible, and convenient. I am sure other hosters have a similar environ, webfaction has a nice implementation of this kind of environment, accessible (i.e. easy to find) information * documentation, and a nicely responsive support team (always civil, pleasant, helpful, positive). - Yarko > -- > Thadeus > > On Tue, Apr 20, 2010 at 12:02 PM, mr.freeze wrote: > > Nice. So no more slicehost or is this an additional account? > > > On Apr 20, 11:47 am, Thadeus Burgess wrote: > >> I just wanted to pass along how awesome webfaction rocks! > > >> I just signed up for an account with them. During the signup process > >> they ask what software you will be using with the service. I specified > >> OTHER->web2py. When I got the email of the server, I went to the URL > >> and there was already a web2py instance up and running with the > >> welcome application! I didn't have to do a thing! > > >> Go webfaction :) > > >> -- > >> Thadeus > > >> -- > >> Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: ValueError: invalid literal for int() with base 10:
Companies in the company table can apply for one or more applications, therefore I defined the combination table companyapplication. The company table contains records like: 1 Butson Consultancy 2 Dreamwall 3 Preston Counselors The application table contains records like: 1 Supplier 2 Consultants 3 Counselors The companyapplication table contains records like: 1 2 2 1 2 2 3 3 I can insert companies without problems, however, when I want to insert an application, e.g. Supplier I get the error mentioned above. I hope I provided you with sufficient information. Annet. -- Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en
Re: [web2py] Re: http://www.web2py.com doesnt load
On Tue, Apr 20, 2010 at 13:27, mdipierro wrote: > This is easier than I thought. Thanks to yarko for insisting about > this. Please make sure I do it properly. > > On Apr 20, 10:27 am, Thadeus Burgess wrote: >> You mean, I will finally have a way to run stable versions of web2py >> but easily update them !? w00t! >> >> -- >> Thadeus >> >> On Tue, Apr 20, 2010 at 12:26 AM, Yarko Tymciurak >> >> wrote: >> > heckings, so you can ALWAYS get the latest release from Goog >> >> -- >> Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en > Why using the "R-" if we'll use RELEASE? I think that just "a.bc.d" (+ RELEASE) is fine. -- Álvaro Justen - Turicas http://blog.justen.eng.br/ 21 9898-0141
[web2py] Re: http://www.web2py.com doesnt load
RE: using R- as a prefix to release number (especially if adding "RELEASE" as a tag that always points to the LATEST RELEASE): Note that the "RELEASE" tag will move: it essentially will be re- tagging at each release. As relases move along, having a "R-" prefix will leave past releases marked conspicuously. If ONLY releases will be tagged, this might be superfluous - BUT is patches, or test posts are (at any point in the future) tagged, then a way to clearly, unambiguously be able to find Release tags will be important. There may be other ways to approach this, but this is common, simple, allows tagging a release as beta, release candidate, and (potentially) release, without the need to add any revisions, for example: B2-1.99.99, RC-1.99.99, and R-1.99.99 might all be different changesets - OR the same changeset that passed all these gates. The discussion of a tag format of the form: [Release state]-[Release number] is useful. It should not be mixed up with discussion of having ONE tag which always marks the latest release - these are separate concerns. Hope that helps clarify. Regards, - Yarko On Apr 20, 11:27 am, mdipierro wrote: > This is easier than I thought. Thanks to yarko for insisting about > this. Please make sure I do it properly. > > On Apr 20, 10:27 am, Thadeus Burgess wrote: > > > You mean, I will finally have a way to run stable versions of web2py > > but easily update them !? w00t! > > > -- > > Thadeus > > > On Tue, Apr 20, 2010 at 12:26 AM, Yarko Tymciurak > > > wrote: > > > heckings, so you can ALWAYS get the latest release from Goog > > > -- > > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: lighttpd + mod_rewrite question/issue
Took a bit of playing/searching but I've got it now. No worries. Love the framework Massimo! On Apr 20, 12:17 pm, zxynax wrote: > would like the following behavior: > request =http://www.example.com/ > to go tohttp://www.example.com/exampleapplication > instead of what it would do normally which would > behttp://www.example.com/welcome/default/index > > But I would like this to be entirely unseen by the user. > > -- > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
Re: [web2py] Re: Webfaction rocks
I did have trouble getting admin to work properly, it complains about request.env.http_host being a None type, so I was unable to use admin without patching its security checks. However I am comfortable enough with ssh to publish the app manually. -- Thadeus On Tue, Apr 20, 2010 at 1:24 PM, annet wrote: > Hi Thadeus, > > You're right, WebFaction rocks. However, when you want to upload and > install a packed application you will have to proceed as follows: > > 1. Log on to WebFaction via terminal/ssh > > 2. cd to your remote web2py/application directory > > 3. Make a directory by the name of the packed application > > 4. Upload and install the packed web2py application via the web > interface and rename it to match the name of the directory you > manually created. > > https://admin.domain_name.com/admin/default/site > > In the upload and install form browse to the directory where the > packed application resides, rename it (required) > packed_application_name and check the overwrite installed app check > box. Click install. > > > Thanks to Chris, who helped me solve this problem! > > > Kind regards, > > Annet. > > > -- > Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en >
[web2py] Re: recaptcha in LOAD not working
On Apr 20, 7:01 am, selecta wrote: > I found out that if the java scrip files (.js files) are loaded in the > initial load of the page the embedded javascript of the ajax loaded > pages is executed > e.g. > default.py > def index(): > response.files.append(URL(request.application,'static/jquery- > autocomplete','jquery.autocomplete.pack.js')) > response.files.append(URL(request.application,'static/jquery- > autocomplete','jquery.autocomplete.css')) > response.files.append(URL(request.application,'static/jquery- > autocomplete','jquery.autocomplete.pack.js')) > response.files.append(URL(request.application,'static/jquery- > autocomplete/lib','jquery.bgiframe.min.js')) > response.files.append(URL(request.application,'static/jquery- > autocomplete/lib','jquery.dimensions.js')) > return dict() > > def test(): > form = form_factory(Field('myfield')) > script = SCRIPT('''$(document).ready(function(){ > $("#no_table_myfield").autocomplete(["a","b"]);});''') > > return TAG[''](form, script) > > default/index.html > LOAD('default', 'test', ajax=True) > > this works It works but it will work only once, on initial load, which is fine for this case. If you need to run some JS every time then don't enclose it inside a $ ().ready function, that way it will be executed on every ajax call, at least it does in my tests with Firefox. Note that if you remove the ready function around the autocomplete selection code above it will still work. > in additioin to that I read that the ajax function can load > javascrips ... this could mean that something along the lines of > script = SCRIPT('''$(document).ready(function(){ > jQuery.ajax(url: "%s") > $("#no_table_myfield").autocomplete(["a","b"]);});'''%URL(request.application,'static/jquery- > > autocomplete','jquery.autocomplete.pack.js')) > > could fix some problems, I did not try it out yet since I spend too > much time already figuring out the first issue -- Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Webfaction rocks
On Apr 20, 3:43 pm, Thadeus Burgess wrote: > I did have trouble getting admin to work properly, it complains about > request.env.http_host being a None type, so I was unable to use admin > without patching its security checks. However I am comfortable enough > with ssh to publish the app manually. Oh? I got admin working: Does your appadmin.py controller have something like: if request.env.http_x_forwarded_for or request.env.wsgi_url_scheme\ in ['https', 'HTTPS']: session.secure() This works for me on webfaction (and, of course, you have to have SSL enabled on your site (from the webfaction panel). - Yarko > > -- > Thadeus > > On Tue, Apr 20, 2010 at 1:24 PM, annet wrote: > > Hi Thadeus, > > > You're right, WebFaction rocks. However, when you want to upload and > > install a packed application you will have to proceed as follows: > > > 1. Log on to WebFaction via terminal/ssh > > > 2. cd to your remote web2py/application directory > > > 3. Make a directory by the name of the packed application > > > 4. Upload and install the packed web2py application via the web > > interface and rename it to match the name of the directory you > > manually created. > > >https://admin.domain_name.com/admin/default/site > > > In the upload and install form browse to the directory where the > > packed application resides, rename it (required) > > packed_application_name and check the overwrite installed app check > > box. Click install. > > > Thanks to Chris, who helped me solve this problem! > > > Kind regards, > > > Annet. > > > -- > > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
Re: [web2py] Re: rocket performance
Ton's of references in epydoc. Those will be there as long as wsgiserver.py is in the distro. Otherwise, run epydoc and sphinx. Other than that, theres: \examples\views\default\index.html:line 35 - change link to http://launchpad.net/rocket \examples\views\default\who.html:line 77 - remove the reference so long as wsgiserver is not the default - add "Rocket Web Server developed by Timothy Farrell." On 4/20/2010 9:21 AM, mdipierro wrote: I made a mistake. Left references to cherry in some of the pages in applications/example. Could you help me locate them and suggest changes? Massimo On Apr 20, 8:11 am, Timothy Farrell wrote: Thank you. It's always good to see the fruits of one's labor come out. On 4/19/2010 3:57 PM, elffikk wrote: a simple test loading one by one the same link, leaving concurrency and advanced testing to Tim and others :) just wanted to feel the improvement, and I have to say Tim did his job very well web2py 1.76.5 vs 1.77.1 load test 10 requests: 1.76.5 - 0.3016 seconds 1.77.1 - 0.2736 seconds 100 requests: 1.76.5 - 1.7729 seconds 1.77.1 - 1.4585 seconds 1000 requests: 1.76.5 - 16.6493 seconds 1.77.1 - 13.4033 seconds and here is the great test script :) import sys, urllib n = int((sys.argv[1:] or [10])[0]) s = 'http://127.0.0.1:8001/'# s = 'http://127.0.0.1:8002/' for i in xrange(n): urllib.urlopen(s).read() -- Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
Re: [web2py] Re: Webfaction rocks
That might be it. I had not enabled SSL. However, since I will not be using admin, I do not have time to test if that fixes it. -- Thadeus On Tue, Apr 20, 2010 at 3:58 PM, Yarko Tymciurak wrote: > On Apr 20, 3:43 pm, Thadeus Burgess wrote: >> I did have trouble getting admin to work properly, it complains about >> request.env.http_host being a None type, so I was unable to use admin >> without patching its security checks. However I am comfortable enough >> with ssh to publish the app manually. > > Oh? I got admin working: > > Does your appadmin.py controller have something like: > > if request.env.http_x_forwarded_for or request.env.wsgi_url_scheme\ > in ['https', 'HTTPS']: > session.secure() > > This works for me on webfaction (and, of course, you have to have SSL > enabled on your site (from the webfaction panel). > > - Yarko >> >> -- >> Thadeus >> >> On Tue, Apr 20, 2010 at 1:24 PM, annet wrote: >> > Hi Thadeus, >> >> > You're right, WebFaction rocks. However, when you want to upload and >> > install a packed application you will have to proceed as follows: >> >> > 1. Log on to WebFaction via terminal/ssh >> >> > 2. cd to your remote web2py/application directory >> >> > 3. Make a directory by the name of the packed application >> >> > 4. Upload and install the packed web2py application via the web >> > interface and rename it to match the name of the directory you >> > manually created. >> >> >https://admin.domain_name.com/admin/default/site >> >> > In the upload and install form browse to the directory where the >> > packed application resides, rename it (required) >> > packed_application_name and check the overwrite installed app check >> > box. Click install. >> >> > Thanks to Chris, who helped me solve this problem! >> >> > Kind regards, >> >> > Annet. >> >> > -- >> > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en >
[web2py] Re: rocket performance
ok. will fix this soon. On Apr 20, 4:03 pm, Timothy Farrell wrote: > Ton's of references in epydoc. Those will be there as long as > wsgiserver.py is in the distro. Otherwise, run epydoc and sphinx. > > Other than that, theres: > \examples\views\default\index.html:line 35 > - change link tohttp://launchpad.net/rocket > > \examples\views\default\who.html:line 77 > - remove the reference so long as wsgiserver is not the default > - add "Rocket Web Server developed by Timothy Farrell." > > On 4/20/2010 9:21 AM, mdipierro wrote: > > > I made a mistake. Left references to cherry in some of the pages in > > applications/example. Could you help me locate them and suggest > > changes? > > > Massimo > > > On Apr 20, 8:11 am, Timothy Farrell wrote: > > >> Thank you. It's always good to see the fruits of one's labor come out. > > >> On 4/19/2010 3:57 PM, elffikk wrote: > > >>> a simple test loading one by one the same link, leaving concurrency > >>> and advanced testing to Tim and others :) > >>> just wanted to feel the improvement, and I have to say Tim did his job > >>> very well > > >>> web2py 1.76.5 vs 1.77.1 load test > > >>> 10 requests: > >>> 1.76.5 - 0.3016 seconds > >>> 1.77.1 - 0.2736 seconds > > >>> 100 requests: > >>> 1.76.5 - 1.7729 seconds > >>> 1.77.1 - 1.4585 seconds > > >>> 1000 requests: > >>> 1.76.5 - 16.6493 seconds > >>> 1.77.1 - 13.4033 seconds > > >>> and here is the great test script :) > > >>> import sys, urllib > >>> n = int((sys.argv[1:] or [10])[0]) > >>> s = 'http://127.0.0.1:8001/'#s = 'http://127.0.0.1:8002/' > >>> for i in xrange(n): > >>> urllib.urlopen(s).read() > > >> -- > >> Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Webfaction rocks
Hi Annet, np. The reason you might not want to create sites on your web faction account using the web interface is because you some day you might find yourself doing a merge from the command line on your "production server" (if you start doing versioning with hg or some other system) which can be a rather unpleasant and undesirable thing to be doing. If you still want to be able to do it, say in order to impress clients, I can help you out, just remember that I warned you ; ) Chris On Apr 20, 2:24 pm, annet wrote: > Hi Thadeus, > > You're right, WebFaction rocks. However, when you want to upload and > install a packed application you will have to proceed as follows: > > 1. Log on to WebFaction via terminal/ssh > > 2. cd to your remote web2py/application directory > > 3. Make a directory by the name of the packed application > > 4. Upload and install the packed web2py application via the web > interface and rename it to match the name of the directory you > manually created. > > https://admin.domain_name.com/admin/default/site > > In the upload and install form browse to the directory where the > packed application resides, rename it (required) > packed_application_name and check the overwrite installed app check > box. Click install. > > Thanks to Chris, who helped me solve this problem! > > Kind regards, > > Annet. > > -- > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: lighttpd + mod_rewrite question/issue
would you mind posting your solution here? On Apr 21, 6:02 am, zxynax wrote: > Took a bit of playing/searching but I've got it now. > > No worries. > Love the framework Massimo! > > On Apr 20, 12:17 pm, zxynax wrote: > > > would like the following behavior: > > request =http://www.example.com/ > > to go tohttp://www.example.com/exampleapplication > > instead of what it would do normally which would > > behttp://www.example.com/welcome/default/index > > > But I would like this to be entirely unseen by the user. > > > -- > > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Webfaction rocks
previously a webfaction admin said: "If we ever get enough interest in web2py to warrant an installer in our control panel, then we'll go ahead and add a forum for it." http://forum.webfaction.com/viewtopic.php?id=3216 Has that happened? On Apr 21, 9:10 am, Christopher Steel wrote: > Hi Annet, > > np. The reason you might not want to create sites on your web faction > account using the web interface is because you some day you might find > yourself doing a merge from the command line on your "production > server" (if you start doing versioning with hg or some other system) > which can be a rather unpleasant and undesirable thing to be doing. If > you still want to be able to do it, say in order to impress clients, I > can help you out, just remember that I warned you ; ) > > Chris > > On Apr 20, 2:24 pm, annet wrote: > > > Hi Thadeus, > > > You're right, WebFaction rocks. However, when you want to upload and > > install a packed application you will have to proceed as follows: > > > 1. Log on to WebFaction via terminal/ssh > > > 2. cd to your remote web2py/application directory > > > 3. Make a directory by the name of the packed application > > > 4. Upload and install the packed web2py application via the web > > interface and rename it to match the name of the directory you > > manually created. > > >https://admin.domain_name.com/admin/default/site > > > In the upload and install form browse to the directory where the > > packed application resides, rename it (required) > > packed_application_name and check the overwrite installed app check > > box. Click install. > > > Thanks to Chris, who helped me solve this problem! > > > Kind regards, > > > Annet. > > > -- > > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Webfaction rocks
how do you find webfaction speed? It has been slow for me lately, particularly ssh. On Apr 21, 3:08 am, Thadeus Burgess wrote: > This is an additional account for a client I am working with. I have > heard the most success with > webfaction and web2py so I wanted to try it out. So good so far. > > I would have preferred GAE for this project, but the client did not agree. > > I would still use slicehost hands down if cost/time is not an issue. > -- > Thadeus > > On Tue, Apr 20, 2010 at 12:02 PM, mr.freeze wrote: > > Nice. So no more slicehost or is this an additional account? > > > On Apr 20, 11:47 am, Thadeus Burgess wrote: > >> I just wanted to pass along how awesome webfaction rocks! > > >> I just signed up for an account with them. During the signup process > >> they ask what software you will be using with the service. I specified > >> OTHER->web2py. When I got the email of the server, I went to the URL > >> and there was already a web2py instance up and running with the > >> welcome application! I didn't have to do a thing! > > >> Go webfaction :) > > >> -- > >> Thadeus > > >> -- > >> Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en
Re: [web2py] Re: Webfaction rocks
It was ok... not as fast as my slicehost servers... but workable. They do not have a "installer" for it on their control panel, however if you tell them you want web2py while signing up, they will run the web2py installer script on file. Basically, it grabs the latest source of web2py_src.zip and installs it to a user instance of apache running that single web2py. The nice thing is, you get everything, cron, your own python, apache, etc directory. I just was not expecting that with shared hosting! -- Thadeus On Tue, Apr 20, 2010 at 8:35 PM, Richard wrote: > how do you find webfaction speed? It has been slow for me lately, > particularly ssh. > > > On Apr 21, 3:08 am, Thadeus Burgess wrote: >> This is an additional account for a client I am working with. I have >> heard the most success with >> webfaction and web2py so I wanted to try it out. So good so far. >> >> I would have preferred GAE for this project, but the client did not agree. >> >> I would still use slicehost hands down if cost/time is not an issue. >> -- >> Thadeus >> >> On Tue, Apr 20, 2010 at 12:02 PM, mr.freeze wrote: >> > Nice. So no more slicehost or is this an additional account? >> >> > On Apr 20, 11:47 am, Thadeus Burgess wrote: >> >> I just wanted to pass along how awesome webfaction rocks! >> >> >> I just signed up for an account with them. During the signup process >> >> they ask what software you will be using with the service. I specified >> >> OTHER->web2py. When I got the email of the server, I went to the URL >> >> and there was already a web2py instance up and running with the >> >> welcome application! I didn't have to do a thing! >> >> >> Go webfaction :) >> >> >> -- >> >> Thadeus >> >> >> -- >> >> Subscription >> >> settings:http://groups.google.com/group/web2py/subscribe?hl=en >
[web2py] Re: Webfaction rocks
FYI - this thread shows the discussion around the installer. You can have them do it, or you can grab it yourself from the wiki, and use it. http://forum.webfaction.com/viewtopic.php?pid=15862#p15862 The installers (for all sorts of applications on webfaction): http://wiki.webfaction.com/wiki/InstallScripts - Yarko On Apr 20, 8:50 pm, Thadeus Burgess wrote: > It was ok... not as fast as my slicehost servers... but workable. > > They do not have a "installer" for it on their control panel, however > if you tell them you want web2py while signing up, they will run the > web2py installer script on file. Basically, it grabs the latest source > of web2py_src.zip and installs it to a user instance of apache running > that single web2py. > > The nice thing is, you get everything, cron, your own python, apache, > etc directory. I just was not expecting that with shared hosting! > > -- > Thadeus > > On Tue, Apr 20, 2010 at 8:35 PM, Richard wrote: > > how do you find webfaction speed? It has been slow for me lately, > > particularly ssh. > > > On Apr 21, 3:08 am, Thadeus Burgess wrote: > >> This is an additional account for a client I am working with. I have > >> heard the most success with > >> webfaction and web2py so I wanted to try it out. So good so far. > > >> I would have preferred GAE for this project, but the client did not agree. > > >> I would still use slicehost hands down if cost/time is not an issue. > >> -- > >> Thadeus > > >> On Tue, Apr 20, 2010 at 12:02 PM, mr.freeze wrote: > >> > Nice. So no more slicehost or is this an additional account? > > >> > On Apr 20, 11:47 am, Thadeus Burgess wrote: > >> >> I just wanted to pass along how awesome webfaction rocks! > > >> >> I just signed up for an account with them. During the signup process > >> >> they ask what software you will be using with the service. I specified > >> >> OTHER->web2py. When I got the email of the server, I went to the URL > >> >> and there was already a web2py instance up and running with the > >> >> welcome application! I didn't have to do a thing! > > >> >> Go webfaction :) > > >> >> -- > >> >> Thadeus > > >> >> -- > >> >> Subscription > >> >> settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Webfaction rocks
I asked yesterday (it is the second time I ask): > I manage the web2py mailing list. There are 1750 members there are many of > them are interested in using > web2py on webfaction. I see you have explicit support for django, rails and > some other frameworks but not > web2py. If you are interested I can help you set this up (free of charge, I > would require a test account and some > email collaboration). Since web2py has PAM support and web based IDE you > could make it to work out of the box with new > accounts and users would login directly into the web based IDE. This would > attract lots of people. they responded: > Adding a new tool to our one-click installer is a big commitment for us > because it means we have to support it in the future, > add new versions when they come out, add security patches as soon as they > come out (and sometimes going through all the > sites we host and patching them for our customers if it's a really nasty > security hole), answering questions from our customers > about the tool etc.). > The other tools you refer to were added when WebFaction first started but > these days adding a new tool is not something we take lightly. I guess you have to make them know there are many of you using webfaction. Personally I am interested in collaboration with a hosting provider willing to provide one click web2py support and automatic setting of the admin password. So far VPS.net has shown some interest but I need to make TurnkeyLinux VM first. Massimo On Apr 20, 8:34 pm, Richard wrote: > previously a webfaction admin said: > "If we ever get enough interest in web2py to warrant an installer in > our control panel, then we'll go ahead and add a forum for > it."http://forum.webfaction.com/viewtopic.php?id=3216 > > Has that happened? > > On Apr 21, 9:10 am, Christopher Steel wrote: > > > Hi Annet, > > > np. The reason you might not want to create sites on your web faction > > account using the web interface is because you some day you might find > > yourself doing a merge from the command line on your "production > > server" (if you start doing versioning with hg or some other system) > > which can be a rather unpleasant and undesirable thing to be doing. If > > you still want to be able to do it, say in order to impress clients, I > > can help you out, just remember that I warned you ; ) > > > Chris > > > On Apr 20, 2:24 pm, annet wrote: > > > > Hi Thadeus, > > > > You're right, WebFaction rocks. However, when you want to upload and > > > install a packed application you will have to proceed as follows: > > > > 1. Log on to WebFaction via terminal/ssh > > > > 2. cd to your remote web2py/application directory > > > > 3. Make a directory by the name of the packed application > > > > 4. Upload and install the packed web2py application via the web > > > interface and rename it to match the name of the directory you > > > manually created. > > > >https://admin.domain_name.com/admin/default/site > > > > In the upload and install form browse to the directory where the > > > packed application resides, rename it (required) > > > packed_application_name and check the overwrite installed app check > > > box. Click install. > > > > Thanks to Chris, who helped me solve this problem! > > > > Kind regards, > > > > Annet. > > > > -- > > > Subscription > > > settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: Webfaction rocks
I saw - I think it is nice / good that they provide an installer for users to use; that's a nice plus. On Apr 20, 9:37 pm, mdipierro wrote: > I asked yesterday (it is the second time I ask): > > > I manage the web2py mailing list. There are 1750 members there are many of > > them are interested in using > > web2py on webfaction. I see you have explicit support for django, rails and > > some other frameworks but not > > web2py. If you are interested I can help you set this up (free of charge, I > > would require a test account and some > > email collaboration). Since web2py has PAM support and web based IDE you > > could make it to work out of the box with new > > accounts and users would login directly into the web based IDE. This would > > attract lots of people. > > they responded: > > > Adding a new tool to our one-click installer is a big commitment for us > > because it means we have to support it in the future, > > add new versions when they come out, add security patches as soon as they > > come out (and sometimes going through all the > > sites we host and patching them for our customers if it's a really nasty > > security hole), answering questions from our customers > > about the tool etc.). > > The other tools you refer to were added when WebFaction first started but > > these days adding a new tool is not something we take lightly. > > I guess you have to make them know there are many of you using > webfaction. > > Personally I am interested in collaboration with a hosting provider > willing to provide one click web2py support and automatic setting of > the admin password. So far VPS.net has shown some interest but I need > to make TurnkeyLinux VM first. > > Massimo > > On Apr 20, 8:34 pm, Richard wrote: > > > previously a webfaction admin said: > > "If we ever get enough interest in web2py to warrant an installer in > > our control panel, then we'll go ahead and add a forum for > > it."http://forum.webfaction.com/viewtopic.php?id=3216 > > > Has that happened? > > > On Apr 21, 9:10 am, Christopher Steel wrote: > > > > Hi Annet, > > > > np. The reason you might not want to create sites on your web faction > > > account using the web interface is because you some day you might find > > > yourself doing a merge from the command line on your "production > > > server" (if you start doing versioning with hg or some other system) > > > which can be a rather unpleasant and undesirable thing to be doing. If > > > you still want to be able to do it, say in order to impress clients, I > > > can help you out, just remember that I warned you ; ) > > > > Chris > > > > On Apr 20, 2:24 pm, annet wrote: > > > > > Hi Thadeus, > > > > > You're right, WebFaction rocks. However, when you want to upload and > > > > install a packed application you will have to proceed as follows: > > > > > 1. Log on to WebFaction via terminal/ssh > > > > > 2. cd to your remote web2py/application directory > > > > > 3. Make a directory by the name of the packed application > > > > > 4. Upload and install the packed web2py application via the web > > > > interface and rename it to match the name of the directory you > > > > manually created. > > > > >https://admin.domain_name.com/admin/default/site > > > > > In the upload and install form browse to the directory where the > > > > packed application resides, rename it (required) > > > > packed_application_name and check the overwrite installed app check > > > > box. Click install. > > > > > Thanks to Chris, who helped me solve this problem! > > > > > Kind regards, > > > > > Annet. > > > > > -- > > > > Subscription > > > > settings:http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: optgroup support
Massimo's answer makes sense but does not entirely solve the problem. Using SELECT(...) instead of TAG.SELECT(...) in my previous sample code, does not render proper html output. There are two unnecessary blank option with wrong value. I guess SELECT(...) need to be fixed to support TAG.OPTGROUP(...), perhaps a native OPTGROUP(...). Regards, Iceberg On Apr18, 3:04am, mdipierro wrote: > you must use SELECT and not TAG.SELECT. The former is derived from > INPUT an knows how to process options, tha latter is simply derived > from a DIV and does not. > > On Apr 17, 1:08 pm, Iceberg wrote: > > > > > Hi Denes and/or Massimo, > > > I just pick up this old post > > fromhttp://groups.google.com/group/web2py/browse_frm/thread/971433920541935a > > > I used the code suggested by Denes, e.g. using TAG.SELECT and > > TAG.OPTGROUP. > > > The code shows proper drop-down box but, after form.accepts(...) the > > form.vars.my_field seems always None. > > > def test_code(): > > OG=TAG.OPTGROUP > > g1=[ OPTION( r, _value=r ) for r in [23, 24, 25] ] > > g2=[ OPTION( r, _value=r ) for r in [32, 33, 34] ] > > ogs=[OG(_label='30 and under',*g1),OG(_label='over 30',*g2)] > > sel = TAG.SELECT(_name='person', *ogs) # DO NOT USE > > sel=SELECT(...) > > form=FORM( sel, INPUT(_type='submit') ) > > if form.accepts(request.vars,keepvalues=True): > > response.flash = 'got %s' % form.vars.person # Why always got > > none? > > return dict(form=form) > > > Question: What need I change to make form.vars.my_field work when > > using TAG.SELECT()? > > > By the way, in case some people might ask why bother, why not just use > > request.vars.my_field instead, well, it is just my personal best- > > practice because form.vars.my_field usually contains data qualified by > > validators, therefore more precisely than request.vars.my_field. Think > > about this: > > define_table('my_table',Field('my_field', requires=IS_UPPER())) > > form = SQLFORM(db.mytable) > > and input "hello world", then > > request.vars.my_field=="hello world" > > but > > form.vars.my_field=="HELLO WORLD" > > usually form.vars.my_field contains what I really need. > > > Regards, > > Iceberg > > > On Feb18, 12:48am, DenesL wrote: > > > > So for future reference: > > > > you can create OPTGROUPs with TAG.OPTGROUP > > > but do NOT use it with the SELECT helper, > > > you must use TAG.SELECT as in the following example: > > > > def index(): > > > OG=TAG.OPTGROUP > > > g1=[ OPTION( r.name, _value=r.id ) for r in > > > db(db.person.age<=30).select() ] > > > g2=[ OPTION( r.name, _value=r.id ) for r in > > > db(db.person.age>30).select() ] > > > ogs=[OG(_label='30 and under',*g1),OG(_label='over 30',*g2)] > > > sel = TAG.SELECT(_name='person', *ogs) > > > # DO NOT USE sel=SELECT(_name='person',*ogs ) > > > f=FORM( sel ) > > > return dict(f=f) > > > > Denes.
[web2py] Re: optgroup support
Now I see the problem: do this class MYSELECT(SELECT): def _fixup(self): pass and use MYSELECT On Apr 20, 10:41 pm, Iceberg wrote: > Massimo's answer makes sense but does not entirely solve the problem. > > Using SELECT(...) instead of TAG.SELECT(...) in my previous sample > code, does not render proper html output. There are two unnecessary > blank option with wrong value. > > I guess SELECT(...) need to be fixed to support TAG.OPTGROUP(...), > perhaps a native OPTGROUP(...). > > Regards, > Iceberg > > On Apr18, 3:04am, mdipierro wrote: > > > you must use SELECT and not TAG.SELECT. The former is derived from > > INPUT an knows how to process options, tha latter is simply derived > > from a DIV and does not. > > > On Apr 17, 1:08 pm, Iceberg wrote: > > > > Hi Denes and/or Massimo, > > > > I just pick up this old post > > > fromhttp://groups.google.com/group/web2py/browse_frm/thread/971433920541935a > > > > I used the code suggested by Denes, e.g. using TAG.SELECT and > > > TAG.OPTGROUP. > > > > The code shows proper drop-down box but, after form.accepts(...) the > > > form.vars.my_field seems always None. > > > > def test_code(): > > > OG=TAG.OPTGROUP > > > g1=[ OPTION( r, _value=r ) for r in [23, 24, 25] ] > > > g2=[ OPTION( r, _value=r ) for r in [32, 33, 34] ] > > > ogs=[OG(_label='30 and under',*g1),OG(_label='over 30',*g2)] > > > sel = TAG.SELECT(_name='person', *ogs) # DO NOT USE > > > sel=SELECT(...) > > > form=FORM( sel, INPUT(_type='submit') ) > > > if form.accepts(request.vars,keepvalues=True): > > > response.flash = 'got %s' % form.vars.person # Why always got > > > none? > > > return dict(form=form) > > > > Question: What need I change to make form.vars.my_field work when > > > using TAG.SELECT()? > > > > By the way, in case some people might ask why bother, why not just use > > > request.vars.my_field instead, well, it is just my personal best- > > > practice because form.vars.my_field usually contains data qualified by > > > validators, therefore more precisely than request.vars.my_field. Think > > > about this: > > > define_table('my_table',Field('my_field', requires=IS_UPPER())) > > > form = SQLFORM(db.mytable) > > > and input "hello world", then > > > request.vars.my_field=="hello world" > > > but > > > form.vars.my_field=="HELLO WORLD" > > > usually form.vars.my_field contains what I really need. > > > > Regards, > > > Iceberg > > > > On Feb18, 12:48am, DenesL wrote: > > > > > So for future reference: > > > > > you can create OPTGROUPs with TAG.OPTGROUP > > > > but do NOT use it with the SELECT helper, > > > > you must use TAG.SELECT as in the following example: > > > > > def index(): > > > > OG=TAG.OPTGROUP > > > > g1=[ OPTION( r.name, _value=r.id ) for r in > > > > db(db.person.age<=30).select() ] > > > > g2=[ OPTION( r.name, _value=r.id ) for r in > > > > db(db.person.age>30).select() ] > > > > ogs=[OG(_label='30 and under',*g1),OG(_label='over 30',*g2)] > > > > sel = TAG.SELECT(_name='person', *ogs) > > > > # DO NOT USE sel=SELECT(_name='person',*ogs ) > > > > f=FORM( sel ) > > > > return dict(f=f) > > > > > Denes.
[web2py] Multi-Auth integration with Web2py
I have adapted the GAEMA code to allow my applications to authenticate with Google, Facebook, and/or Twitter. Though lightly tested, I believe this to work with GAE and in a "normal" web2py install. Check out the details here: http://www.web2pyslices.com/main/slices/take_slice/77 Happy Authenticating! Christian -- Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en
[web2py] Re: MySQL server has gone away
Could you please post on this thread, once there's built-in solution for keeping pooled connections alive? For now, I've seen that you may end up with several dead connection in the pool, so slighly better solution might be as follows: for x in range(10): try: db = DAL(connection_string, pool_size=5) break except: import time time.sleep(1) On Mar 26, 6:04 pm, mdipierro wrote: > Eventually a fix at the web2py level would not be much different than > this. > > Massimo > > On Mar 26, 10:03 am, David Zejda wrote: > > > > > Thanks. The workaround works, even when keeping the pool. :) > > > D. > > > > try: > > > db=DAL("mysql://a:b...@localhost/c", pool_size=5) > > > except: > > > db=DAL("mysql://a:b...@localhost/c", pool_size=5) -- Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en