[web2py] SASS experience
hi, Is anyone using SASS to manage their CSS definitions? http://sass-lang.com/ And if so, how have you managed web2py's css files? thanks
[web2py] Re: SASS experience
thanks for responding. how do you deal with Web2py upgrades: an upgrade that modifies its css. Have you split from Web2py's css files, do you handle them outside of CleverCSS or a third way? On May 4, 5:27 pm, Thadeus Burgess wrote: > I use clevercss for large projects, which is similar to SASS. > > However, for dynamic css I use it as a template. And for small apps I > just write css straight up in the static folder. > > -- > Thadeus > > > > On Tue, May 4, 2010 at 9:12 AM, Carl wrote: > > hi, > > > Is anyone using SASS to manage their CSS definitions? > >http://sass-lang.com/ > > > And if so, how have you managed web2py's css files? > > > thanks
[web2py] Re: SASS experience
perhaps it's time I dropped the css I've adopted from web2py! :) On May 4, 6:04 pm, Thadeus Burgess wrote: > I do not understand. I do not have any web2py css files. > > -- > Thadeus > > > > On Tue, May 4, 2010 at 11:58 AM, Carl wrote: > > thanks for responding. > > > how do you deal with Web2py upgrades: an upgrade that modifies its > > css. Have you split from Web2py's css files, do you handle them > > outside of CleverCSS or a third way? > > > On May 4, 5:27 pm, Thadeus Burgess wrote: > >> I use clevercss for large projects, which is similar to SASS. > > >> However, for dynamic css I use it as a template. And for small apps I > >> just write css straight up in the static folder. > > >> -- > >> Thadeus > > >> On Tue, May 4, 2010 at 9:12 AM, Carl wrote: > >> > hi, > > >> > Is anyone using SASS to manage their CSS definitions? > >> >http://sass-lang.com/ > > >> > And if so, how have you managed web2py's css files? > > >> > thanks
[web2py] applying multiple decorators in a/c/default.py
I'd like to use several decorators on a function e.g., @auth.requires_login() @service.jsonrpc def add_team(name, cap): #function uses auth.user.id In testing I've realised that service.jsonrpc is working but auth.requires_login isn't. ie if a user is not logged in then service.jsonrpc is called and it calls add_team() with its parameters. add_team then fails when it tries to use the auth instance. Is it my syntax? my understanding of decorators? or what? thanks
[web2py] flawed architecture creating race condition for database writes
the flaw is in my architecture not web2py. can you help with a better approach? Needs to be BigTable-friendly to boot. I have two user types: Agents and Candidates Agents invite Candidates to Parties. I keep a Party table recording all such Party invites. Candidates can be invited to the same Party by several Agents so I have an Invite table recording which Agents invited which Candidates to which Parties. 1. On a new Party invitation I check if the Candidate has already been invited by looking in the Party table. 2. If a party isn't found then I insert into the Party table 3. I insert the Agent into Invite table has a value pointing to the appropriate Party row. Here's the "race condition"... **Between** steps 1 and 2 above another party invite is sent and checked for pre-existance. it's not found because step 2 by the 1st agent's run through hasn't yet executed. Thus duplicate party invitations are inserted into the database. What's the better approach to employ?
[web2py] Re: flawed architecture creating race condition for database writes
thanks Iceberg. your approach is pretty much what I have right now. I'm looking for a bullet-proof approach. otherwise I'm running code with "fingers crossed two users don't use the system at the same time" and I want to encourage usage :) C On May 27, 6:09 pm, Iceberg wrote: > On May27, 11:32pm, Carl wrote: > > > > > > > the flaw is in my architecture not web2py. can you help with a better > > approach? Needs to be BigTable-friendly to boot. > > > I have two user types: Agents and Candidates > > Agents invite Candidates to Parties. > > > I keep a Party table recording all such Party invites. > > Candidates can be invited to the same Party by several Agents so I > > have an Invite table recording which Agents invited which Candidates > > to which Parties. > > > 1. On a new Party invitation I check if the Candidate has already been > > invited by looking in the Party table. > > 2. If a party isn't found then I insert into the Party table > > 3. I insert the Agent into Invite table has a value pointing to the > > appropriate Party row. > > > Here's the "race condition"... > > > **Between** steps 1 and 2 above another party invite is sent and > > checked for pre-existance. it's not found because step 2 by the 1st > > agent's run through hasn't yet executed. > > > Thus duplicate party invitations are inserted into the database. > > > What's the better approach to employ? > > Here is my attempt. Not a perfect one. > > db.define_table('Agent', Field('name', unique=True)) > db.define_table('Candidate', Field('name', unique=True)) > db.define_table('Party', Field('name', unique=True)) > db.define_table('Invitation', > Field('agent', db.Agent), > Field('candidate', db.Candidate), > Field('party', db.Party), > # Ideally, we should set up two fields, candidate and party, > # as combinated primary key in db level. But I don't know how. > ) > > # Then, in controller > def invite(): > def no_duplicate(form): > if db( (db.Invitation.candidate==form.vars.candidate) > & (db.Invitation.party==form.vars.party) ).count(): > form.errors.candidate = 'Already invited to this party' > form = SQLFORM(db.Invitation) > if form.accepts( ..., onvalidation=no_duplicate): > response.flash = 'ok' > # However, theoretically speaking there is still a slim time gap, > # maybe 0.2 second, between the onvalidation and the later > insertion. > return {'':form}
[web2py] Re: flawed architecture creating race condition for database writes
tricky. I'm deploying on GAE which may run my code across multiple servers so locking isn't going to be an option. I need to employ a completely different approach. I just need to find it :) On May 27, 7:00 pm, Iceberg wrote: > The bullet-proof solution should be setting twin-field primary key in > db level, I believe. Hope somebody can show us how to do that in > web2py db.define_table(...), if not using db.executesql('set up the > primary key blah blah'). > > On the other hand, in a non-db level, inside web2py, perhaps Massimo > will introduce a global ThreadLock so that developers can do: > > def invite(): > with web2py_lock: > form = ... > if form.accepts(...): > ... > > or maybe a syntactic sugar: > > @with_lock > def invite(): > all_the_original_code > > Wait and see what other may say. > > On May28, 1:44am, Carl wrote: > > > > > thanks Iceberg. > > > your approach is pretty much what I have right now. I'm looking for a > > bullet-proof approach. > > otherwise I'm running code with "fingers crossed two users don't use > > the system at the same time" > > > and I want to encourage usage :) > > > C > > > On May 27, 6:09 pm, Iceberg wrote: > > > > On May27, 11:32pm, Carl wrote: > > > > > the flaw is in my architecture not web2py. can you help with a better > > > > approach? Needs to be BigTable-friendly to boot. > > > > > I have two user types: Agents and Candidates > > > > Agents invite Candidates to Parties. > > > > > I keep a Party table recording all such Party invites. > > > > Candidates can be invited to the same Party by several Agents so I > > > > have an Invite table recording which Agents invited which Candidates > > > > to which Parties. > > > > > 1. On a new Party invitation I check if the Candidate has already been > > > > invited by looking in the Party table. > > > > 2. If a party isn't found then I insert into the Party table > > > > 3. I insert the Agent into Invite table has a value pointing to the > > > > appropriate Party row. > > > > > Here's the "race condition"... > > > > > **Between** steps 1 and 2 above another party invite is sent and > > > > checked for pre-existance. it's not found because step 2 by the 1st > > > > agent's run through hasn't yet executed. > > > > > Thus duplicate party invitations are inserted into the database. > > > > > What's the better approach to employ? > > > > Here is my attempt. Not a perfect one. > > > > db.define_table('Agent', Field('name', unique=True)) > > > db.define_table('Candidate', Field('name', unique=True)) > > > db.define_table('Party', Field('name', unique=True)) > > > db.define_table('Invitation', > > > Field('agent', db.Agent), > > > Field('candidate', db.Candidate), > > > Field('party', db.Party), > > > # Ideally, we should set up two fields, candidate and party, > > > # as combinated primary key in db level. But I don't know how. > > > ) > > > > # Then, in controller > > > def invite(): > > > def no_duplicate(form): > > > if db( (db.Invitation.candidate==form.vars.candidate) > > > & (db.Invitation.party==form.vars.party) ).count(): > > > form.errors.candidate = 'Already invited to this party' > > > form = SQLFORM(db.Invitation) > > > if form.accepts( ..., onvalidation=no_duplicate): > > > response.flash = 'ok' > > > # However, theoretically speaking there is still a slim time gap, > > > # maybe 0.2 second, between the onvalidation and the later > > > insertion. > > > return {'':form}
[web2py] Re: flawed architecture creating race condition for database writes
thanks Richard. I'm going to stick with a web2py solution and remodel my approach. Instead of creating the troublesome row at invite time I'm going to create it when a Candidate checks their invites. In the service I'm building each invite is unique to a Candidate so I won't have Candidates checking the same invite simultaneously. On Jun 2, 2:52 am, Richard wrote: > I am not sure how to do it through web2py, but if working directly > with the GAE API you can set the entities "key_name" to avoid > duplicates. > > On Jun 2, 1:21 am, Carl wrote: > > > > > tricky. > > I'm deploying on GAE which may run my code across multiple servers so > > locking isn't going to be an option. > > > I need to employ a completely different approach. I just need to find > > it :) > > > On May 27, 7:00 pm, Iceberg wrote: > > > > The bullet-proof solution should be setting twin-field primary key in > > > db level, I believe. Hope somebody can show us how to do that in > > > web2py db.define_table(...), if not using db.executesql('set up the > > > primary key blah blah'). > > > > On the other hand, in a non-db level, inside web2py, perhaps Massimo > > > will introduce a global ThreadLock so that developers can do: > > > > def invite(): > > > with web2py_lock: > > > form = ... > > > if form.accepts(...): > > > ... > > > > or maybe a syntactic sugar: > > > > @with_lock > > > def invite(): > > > all_the_original_code > > > > Wait and see what other may say. > > > > On May28, 1:44am, Carl wrote: > > > > > thanks Iceberg. > > > > > your approach is pretty much what I have right now. I'm looking for a > > > > bullet-proof approach. > > > > otherwise I'm running code with "fingers crossed two users don't use > > > > the system at the same time" > > > > > and I want to encourage usage :) > > > > > C > > > > > On May 27, 6:09 pm, Iceberg wrote: > > > > > > On May27, 11:32pm, Carl wrote: > > > > > > > the flaw is in my architecture not web2py. can you help with a > > > > > > better > > > > > > approach? Needs to be BigTable-friendly to boot. > > > > > > > I have two user types: Agents and Candidates > > > > > > Agents invite Candidates to Parties. > > > > > > > I keep a Party table recording all such Party invites. > > > > > > Candidates can be invited to the same Party by several Agents so I > > > > > > have an Invite table recording which Agents invited which Candidates > > > > > > to which Parties. > > > > > > > 1. On a new Party invitation I check if the Candidate has already > > > > > > been > > > > > > invited by looking in the Party table. > > > > > > 2. If a party isn't found then I insert into the Party table > > > > > > 3. I insert the Agent into Invite table has a value pointing to the > > > > > > appropriate Party row. > > > > > > > Here's the "race condition"... > > > > > > > **Between** steps 1 and 2 above another party invite is sent and > > > > > > checked for pre-existance. it's not found because step 2 by the 1st > > > > > > agent's run through hasn't yet executed. > > > > > > > Thus duplicate party invitations are inserted into the database. > > > > > > > What's the better approach to employ? > > > > > > Here is my attempt. Not a perfect one. > > > > > > db.define_table('Agent', Field('name', unique=True)) > > > > > db.define_table('Candidate', Field('name', unique=True)) > > > > > db.define_table('Party', Field('name', unique=True)) > > > > > db.define_table('Invitation', > > > > > Field('agent', db.Agent), > > > > > Field('candidate', db.Candidate), > > > > > Field('party', db.Party), > > > > > # Ideally, we should set up two fields, candidate and party, > > > > > # as combinated primary key in db level. But I don't know how. > > > > > ) > > > > > > # Then, in controller > > > > > def invite(): > > > > > def no_duplicate(form): > > > > > if db( (db.Invitation.candidate==form.vars.candidate) > > > > > & (db.Invitation.party==form.vars.party) ).count(): > > > > > form.errors.candidate = 'Already invited to this party' > > > > > form = SQLFORM(db.Invitation) > > > > > if form.accepts( ..., onvalidation=no_duplicate): > > > > > response.flash = 'ok' > > > > > # However, theoretically speaking there is still a slim time gap, > > > > > # maybe 0.2 second, between the onvalidation and the later > > > > > insertion. > > > > > return {'':form}
[web2py] LinkedIn OAuth example requested
hi Has anyone got a basic example project of using LinkedIn OAuth with the Web2py platform? Something based on Welcome for example. I've tried to integrate linkedin_account.py but haven't quiet gotten it working. It may be my local set-up rather than code. I'm also thinking a lot of potential web2py developers will want this feature and a working code example will help us all. all the best
[web2py] Re: Opera Browser
I don't use Web2py integrated code editor (I use Eclipse) but I had a look for you. However, on Windows 7 using Opera 10.53 the editor runs speedily. On Jun 18, 10:39 am, selecta wrote: > I use opera every day :) > For me everything is really fast ... since I changed to 10.5x > But I really don't know what you mean with the programming thing? Do > you mean Firefly, the debugger? That works really fast for me, even > though I am very annoyed that you cannot use it offline, that means no > debugging in Opera in the metro on my way home :( > > On Jun 18, 2:12 am, greenpoise wrote: > > > > > Anybody here using Opera to program? I have been a long time fan of > > Opera but I cant use it with web2py because where you do the > > programming (dunno the name of it) renders super slow. I was wondering > > if anybody else is experiencing the same thing??
[web2py] Re: Opera Browser
I don't use Web2py integrated code editor (I use Eclipse) but I had a look for you. On my Windows 7 box using Opera 10.53 the editor runs speedily. On Jun 18, 10:39 am, selecta wrote: > I use opera every day :) > For me everything is really fast ... since I changed to 10.5x > But I really don't know what you mean with the programming thing? Do > you mean Firefly, the debugger? That works really fast for me, even > though I am very annoyed that you cannot use it offline, that means no > debugging in Opera in the metro on my way home :( > > On Jun 18, 2:12 am, greenpoise wrote: > > > > > Anybody here using Opera to program? I have been a long time fan of > > Opera but I cant use it with web2py because where you do the > > programming (dunno the name of it) renders super slow. I was wondering > > if anybody else is experiencing the same thing??
[web2py] Re: LinkedIn OAuth example requested
I've looked at gluon/contrib/login_methods/linkedin_account.py (in web2py v1.77.3) Q1. It looks like it has syntax errors. i.e. Line 42 & 45. api is used instead of self.api Line 45 should profile = api.GetProfile(profile.public_url = "http:// www.linkedin.com/in/ozgurv") instead be profile = api.GetProfile(profile).public_url = "http:// www.linkedin.com/in/ozgurv" Q2. Conceptually how does Register an account then Login to an account work when using a LinkedIn account? thanks On Jun 18, 4:10 pm, mdipierro wrote: > I use this > gluon/contrib/login_methods/linkedin_account.py > in > web2py.com/linkedin > > On Jun 18, 6:56 am, Carl wrote: > > > > > hi > > > Has anyone got a basic example project of using LinkedIn OAuth with > > the Web2py platform? Something based on Welcome for example. > > > I've tried to integrate linkedin_account.py but haven't quiet gotten > > it working. It may be my local set-up rather than code. I'm also > > thinking a lot of potential web2py developers will want this feature > > and a working code example will help us all. > > > all the best
[web2py] Re: GAE update_record() has subtle difference compared to native Web2Py
I've traced right now to the exception and I get KeyError: 'name' This is referring to the definition in db.py of the compute function compute=lambda r:r['name'].lower()), I've removed both notnull=True & required=True from: Field('name', 'string', length=128, notnull=True, required=True), but I still get the exception thrown. I then remove all notnull and required and tested again... same exception thrown. however, as I said, if I include a name parameter in update_record all is well. I think this provides a value for the compute formula to use. I added this compute version recently and I think this is what's tripping gae. On Feb 3, 8:44 pm, mdipierro wrote: > Now the see this I understand the problem better. In this line: > > Field('mDate', 'datetime', required=True) > > required=True is not the same as requires=IS_NOT_EMPTY() and it is not > the same as notnull=True. > > required=True means you cannot do insert without providing a value for > this field and that is exactly what you tell me the problem is. > > On Feb 3, 12:22 pm, Carl wrote: > > > > > db.define_table('team', > > Field('name', 'string', length=128, notnull=True, > > required=True), > > Field('name_lower', compute=lambda r:r['name'].lower()), > > Field('owner_user_id', db.auth_user, required=True, > > requires=IS_IN_DB(db,db.auth_user.id,'%(id)s')), > > Field('credit_quota', 'integer', notnull=True, > > required=True), > > Field('live', 'boolean', notnull=True, > > required='True', default='True'), > > Field('cDate', 'datetime', required=True), > > Field('mDate', 'datetime', required=True)) > > > Did you mean to refer to mDate rather than name (because it is > > name_lower that is 'compute') ? > > > On 3 February 2010 17:06, mdipierro wrote: > > > > Can you show us the model and attributes of db.team. > > > I suspect db.team.mDate is missing a writable=False, readable=False > > > which you need since it is a computed field. > > > > On Feb 3, 10:59 am, Carl wrote: > > >> MainThread - pid4460_seq4 > > >> update [gql.py:696] > > >> update_record [sql.py:3232] > > >> [sql.py:3109] > > >> update [subscription.py:65] > > >> update_team [default.py:call:68] > > >> serve_jsonrpc [tools.py:2560] > > >> __call__ [tools.py:2646] > > >> call [default.py:call:594] > > >> [globals.py:96] > > >> [default.py:call:764] > > >> restricted [restricted.py:173] > > >> run_controller_in [compileapp.py:426] > > >> serve_controller [main.py:193] > > >> wsgibase [main.py:478] > > >> wsgiapp [gaehandler.py:71] > > >> newfun [gaehandler.py:51] > > >> run [handlers.py:92] > > >> main [gaehandler.py:85] > > >> ExecuteOrImportScript [dev_appserver.py:2187] > > >> ExecuteCGI [dev_appserver.py:2289] > > >> Dispatch [dev_appserver.py:2379] > > >> Dispatch [dev_appserver.py:515] > > >> _Dispatch [dev_appserver.py:3120] > > >> _HandleRequest [dev_appserver.py:3177] > > >> do_POST [dev_appserver.py:3069] > > >> handle_one_request [BaseHTTPServer.py:310] > > >> handle [BaseHTTPServer.py:316] > > >> __init__ [SocketServer.py:522] > > >> __init__ [dev_appserver.py:3057] > > >> finish_request [SocketServer.py:254] > > >> process_request [SocketServer.py:241] > > >> handle_request [SocketServer.py:222] > > >> serve_forever [SocketServer.py:201] > > >> main [dev_appserver_main.py:402] > > >> [dev_appserver_main.py:417] > > >> run_file [dev_appserver.py:63] > > >> [dev_appserver.py:67] > > >> run [pydevd.py:780] > > >> [pydevd.py:953] > > > >> #from a function in default.py > > >> (id, name, quota, users, usage) = team.update(auth.user.id, id, name) > > >> # Line68 > > > >> # from subscription.py
[web2py] GAE delete() has subtle difference compared to native Web2Py
This may be related to GAE update_record() has subtle difference compared to native Web2Py http://groups.google.com/group/web2py/browse_thread/thread/a69afded01d12d18/3f4f21acdff0c34b#3f4f21acdff0c34b but until shown otherwise, I've posed separately. I have this in db.py: db.define_table('team_user', Field('teamId', 'integer', notnull=True, required=True), Field('user_email', 'string', length=254, notnull=True, required=True, requires = [IS_LOWER(),IS_EMAIL()]), Field('live', 'boolean', notnull=True, required=True, default='True'), Field('cDate', 'datetime'), Field('mDate', 'datetime')) I make this call: self.db(self.db.team_user.id==memberId).delete() such a statement calls delete(self) in gql.py def delete(self): self._db['_lastsql'] = 'DELETE WHERE %s' % self.where (items, tablename, fields) = self._select() tableobj = self._db[tablename]._tableobj counter = items.count() gae.delete(items) return counter - items.count() When the interpreter exectutes "counter = items.count()" an exception is thrown stating "TypeError: count() takes exactly one argument (0 given)" Have I something in my db.py definition that native web2py is happy with but dev_appserver chokes on? -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: GAE update_record() has subtle difference compared to native Web2Py
ah... you are right; I don't get this information from a web2py form. I added in readable and writable but still get the exception: KeyError: 'name' On Feb 4, 1:16 am, mdipierro wrote: > required is not really required for anything. > > For debugging try: > > Field('name_lower', compute=lambda > r:r['name'].lower(),readable=False,writable=False) > > Perhaps you do not display the field name in the form? > > On Feb 3, 5:57 pm, Carl wrote: > > > > > I've traced right now to the exception and I get KeyError: 'name' > > > This is referring to the definition in db.py of the compute function > > compute=lambda r:r['name'].lower()), > > > I've removed both notnull=True & required=True from: > > Field('name', 'string', length=128, notnull=True, required=True), > > > but I still get the exception thrown. > > I then remove all notnull and required and tested again... same > > exception thrown. > > > however, as I said, if I include a name parameter in update_record all > > is well. I think this provides a value for the compute formula to use. > > I added this compute version recently and I think this is what's > > tripping gae. > > > On Feb 3, 8:44 pm, mdipierro wrote: > > > > Now the see this I understand the problem better. In this line: > > > > Field('mDate', 'datetime', required=True) > > > > required=True is not the same as requires=IS_NOT_EMPTY() and it is not > > > the same as notnull=True. > > > > required=True means you cannot do insert without providing a value for > > > this field and that is exactly what you tell me the problem is. > > > > On Feb 3, 12:22 pm, Carl wrote: > > > > > db.define_table('team', > > > > Field('name', 'string', length=128, notnull=True, > > > > required=True), > > > > Field('name_lower', compute=lambda r:r['name'].lower()), > > > > Field('owner_user_id', db.auth_user, required=True, > > > > requires=IS_IN_DB(db,db.auth_user.id,'%(id)s')), > > > > Field('credit_quota', 'integer', notnull=True, > > > > required=True), > > > > Field('live', 'boolean', notnull=True, > > > > required='True', default='True'), > > > > Field('cDate', 'datetime', required=True), > > > > Field('mDate', 'datetime', required=True)) > > > > > Did you mean to refer to mDate rather than name (because it is > > > > name_lower that is 'compute') ? > > > > > On 3 February 2010 17:06, mdipierro wrote: > > > > > > Can you show us the model and attributes of db.team. > > > > > I suspect db.team.mDate is missing a writable=False, readable=False > > > > > which you need since it is a computed field. > > > > > > On Feb 3, 10:59 am, Carl wrote: > > > > >> MainThread - pid4460_seq4 > > > > >> update [gql.py:696] > > > > >> update_record [sql.py:3232] > > > > >> [sql.py:3109] > > > > >> update [subscription.py:65] > > > > >> update_team [default.py:call:68] > > > > >> serve_jsonrpc [tools.py:2560] > > > > >> __call__ [tools.py:2646] > > > > >> call [default.py:call:594] > > > > >> [globals.py:96] > > > > >> [default.py:call:764] > > > > >> restricted [restricted.py:173] > > > > >> run_controller_in [compileapp.py:426] > > > > >> serve_controller [main.py:193] > > > > >> wsgibase [main.py:478] > > > > >> wsgiapp [gaehandler.py:71] > > > > >> newfun [gaehandler.py:51] > > > > >> run [handlers.py:92] > > > > >> main [gaehandler.py:85] > > > > >> ExecuteOrImportScript [dev_appserver.py:2187] > > > > >> ExecuteCGI [dev_appserver.py:2289] > > > > >> Dispatch [dev_appserver.py:2379] > > > > >> Dispatch [dev_appserver.py:515] > > > > >> _Dispatch [
[web2py] storing a Python list
I have a Python list that I want to store and retrieve from the data store. The individual items of the list are of no use unless used with the items of the complete list and there are no use-cases requiring searching for a specified list item. The number of items in the list is between one and fifteen (any more is beyond end users to manage). I'd like to store and retrieve the list in a single field. On retrieval the data would be in a Python list object. What's an approach I can use? -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: storing a Python list
thanks Jorge; most helpful in pointing me in the right direction. The python to pickle is simply; for example: import pickle flat_retort = pickle.dumps(retort) and to unpickle; for example: import pickle options = pickle.loads(rows[0].retort) On Feb 17, 3:57 pm, JorgeRpo wrote: > On Feb 17, 10:47 am, Carl wrote: > > > I have a Python list that I want to store and retrieve from the data > > store. > > > The individual items of the list are of no use unless used with the > > items of the complete list and there are no use-cases requiring > > searching for a specified list item. The number of items in the list > > is between one and fifteen (any more is beyond end users to manage). > > > I'd like to store and retrieve the list in a single field. On > > retrieval the data would be in a Python list object. > > > What's an approach I can use? > > serialize > -- > sig text -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Difference between dev_appserver and local web2py/sqlite: Field "string" containing '\n'
Tested the latest changes locally on dev_appserver. All went smoothly in that only one difference from local Web2py tripped up the process. Pickling lists into strings and storing them in the database: dev_appserver barked when a pickled string contained '\n' was inserted into a field of type 'string' into the database. "strings can't be multi-line" Changing the db field definition from string to text sorted it out. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] datetime's sub-second information: query about its handling for different databases
Following Dan's posting last year about the loss of microseconds when storing Python DateTime instances in SQLite http://groups.google.com/group/web2py/browse_thread/thread/f9b8cbb6601a9f58/d45f7d737f4e7932?lnk=gst&q=datetime+precision#d45f7d737f4e7932 I've got to this area too :) Dan suggests a work-around for SQLite users based on SQLCustomType. A few of questions popped up: 1. is Dan' post the last on this subject (I searched Groups but one is never sure) 2. is Dan's work-around the recommended approach for developers needing to maintain Python DataTime objects in a non-gae database? 3. do you know if Web2py only maintains Python DataTime object's millisecond precision for gae? Or is it maintained for other database? 4. and related to #3... is the datepicker calendar code that needs the millisecond precision removed broken on gae? -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: storing a Python list
I decided to go ahead and move my pickling to db.py with the following additions: import pickle from gluon.sql import SQLCustomType serialise = SQLCustomType(type='text', native='text', encoder=(lambda x: pickle.dumps(x)), decoder=(lambda x: pickle.loads(x))) ... Field ('answer', serialise) When I try and insert a row I get the following error: File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line 1850, in insert self._db._execute(query) File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line 890, in self._execute = lambda *a, **b: self._cursor.execute(*a, **b) OperationalError: near "S": syntax error When I had the pickle.dumps/loads calls within a module all worked fine. Where I have gone wrong? On Feb 18, 4:42 am, mdipierro wrote: > You should do: > > from gluon.sql import SQLCustomType > > pickle = > SQLCustomType( > type > ='text', > native > ='text', > encoder = (lambda x:cPickle.dumps(s)), > decoder = (lambda x: cPikcle.loads(s)) > ) > > Field('mypickle',pickle) > > SQLCustomField may disappear in the new DAL in faviour of a more > customizable mechanism > > On Feb 17, 9:20 pm, spiffytech wrote: > > > > > That would work, calling MY_PICKLE functions everywhere seems like as > > much work as calling pickle functions. It would be nice if the > > pickling could be done transparently behind the scenes, so my > > controller code could be cleaner and less error-prone. > > > -Brian > > > On Feb 17, 2:34 pm, Thadeus Burgess wrote: > > > > Could you write a function that handles the inserts/selects instead? > > > > class MY_PICKLE(): > > > @classmethod > > > def get(keyname): > > > pkldump = db(db.pickle_table.keyname == keyname).select().first() > > > return pickle.loads(pkldump.value) > > > @classmethod > > > def save(keyname, value): > > > pkldump = db(db.pickle_table.keyname == keyname).select().first() > > > if pkldump: > > > pkldump.update_record(value=pickle.dumps(value)) > > > else: > > > > > > db.picke_table.insert(keyname=keyname,value=pickle.dumps(value)) > > > > a_list = MY_PICKLE.get("listkey") > > > > # do some stuff to list > > > > MY_PICKLE.save("listkey", a_list) > > > > -Thadeus > > > > On Wed, Feb 17, 2010 at 1:20 PM, spiffytech wrote: > > > > I'm serializing with Pickle in my app, but it's a hassle to dump/load > > > > the data every time I mess with it. Is there a way to make the > > > > serializing happen automatically with DB access? > > > > > -Brian > > > > > On Feb 17, 1:46 pm, Carl wrote: > > > >> thanks Jorge; most helpful in pointing me in the right direction. > > > > >> The python to pickle is simply; for example: > > > >> import pickle > > > >> flat_retort = pickle.dumps(retort) > > > > >> and to unpickle; for example: > > > >> import pickle > > > >> options = pickle.loads(rows[0].retort) > > > > >> On Feb 17, 3:57 pm, JorgeRpo wrote: > > > > >> > On Feb 17, 10:47 am, Carl wrote: > > > > >> > > I have a Python list that I want to store and retrieve from the > > > >> > > data > > > >> > > store. > > > > >> > > The individual items of the list are of no use unless used with the > > > >> > > items of the complete list and there are no use-cases requiring > > > >> > > searching for a specified list item. The number of items in the > > > >> > > list > > > >> > > is between one and fifteen (any more is beyond end users to > > > >> > > manage). > > > > >> > > I'd like to store and retrieve the list in a single field. On > > > >> > > retrieval the data would be in a Python list object. > > > > >> > > What's an approach I can use? > > > > >> > serialize > > > >> > -- > > > >> > sig text > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups "web2py-users" group. > > > > To post to this group, send email to web...@googlegroups.com. > > > > To unsubscribe from this group, send email to > > > > web2py+unsubscr...@googlegroups.com. > > > > For more options, visit this group > > > > athttp://groups.google.com/group/web2py?hl=en. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: storing a Python list
print _insert() gets this... INSERT INTO puzzle(assessment_ref, pia, pio, rung, score, answer, version, cDate, mDate) VALUES ('AP5P', 'Which of these lines is a *comment* in Python code? .= # a comment .- // a comment .- * a comment', 'Which of these lines is a *comment* in Python code? .- # a comment .- // a comment .- * a comment', 1, 1, (lp0 S'0' p1 a., 1, 1266919327.86, 1266919327.86); the S'0' p1 a. is the parameter causing the hiccup. It might be the single-quotes? or the carriage-returns? Perhaps I need to escape my parameter in encoder/decoder in db.py? On Feb 23, 9:50 am, mdipierro wrote: > before the > > ... insert() > > can you > > print ..._insert(...) > > this will tell us what is being sent to the db. > > On Feb 23, 3:29 am, Carl wrote: > > > > > I decided to go ahead and move my pickling to db.py with the following > > additions: > > > import pickle > > from gluon.sql import SQLCustomType > > serialise = SQLCustomType(type='text', > > native='text', > > encoder=(lambda x: pickle.dumps(x)), > > decoder=(lambda x: pickle.loads(x))) > > ... > > Field ('answer', serialise) > > > When I try and insert a row I get the following error: > > File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line > > 1850, in insert > > self._db._execute(query) > > File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line > > 890, in > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b) > > OperationalError: near "S": syntax error > > > When I had the pickle.dumps/loads calls within a module all worked > > fine. > > Where I have gone wrong? > > > On Feb 18, 4:42 am, mdipierro wrote: > > > > You should do: > > > > from gluon.sql import SQLCustomType > > > > pickle = > > > SQLCustomType( > > > type > > > ='text', > > > native > > > ='text', > > > encoder = (lambda x:cPickle.dumps(s)), > > > decoder = (lambda x: cPikcle.loads(s)) > > > ) > > > > Field('mypickle',pickle) > > > > SQLCustomField may disappear in the new DAL in faviour of a more > > > customizable mechanism > > > > On Feb 17, 9:20 pm, spiffytech wrote: > > > > > That would work, calling MY_PICKLE functions everywhere seems like as > > > > much work as calling pickle functions. It would be nice if the > > > > pickling could be done transparently behind the scenes, so my > > > > controller code could be cleaner and less error-prone. > > > > > -Brian > > > > > On Feb 17, 2:34 pm, Thadeus Burgess wrote: > > > > > > Could you write a function that handles the inserts/selects instead? > > > > > > class MY_PICKLE(): > > > > > @classmethod > > > > > def get(keyname): > > > > > pkldump = db(db.pickle_table.keyname == > > > > > keyname).select().first() > > > > > return pickle.loads(pkldump.value) > > > > > @classmethod > > > > > def save(keyname, value): > > > > > pkldump = db(db.pickle_table.keyname == > > > > > keyname).select().first() > > > > > if pkldump: > > > > > pkldump.update_record(value=pickle.dumps(value)) > > > > > else: > > > > > > > > > > db.picke_table.insert(keyname=keyname,value=pickle.dumps(value)) > > > > > > a_list = MY_PICKLE.get("listkey") > > > > > > # do some stuff to list > > > > > > MY_PICKLE.save("listkey", a_list) > > > > > > -Thadeus > > > > > > On Wed, Feb 17, 2010 at 1:20 PM, spiffytech > > > > > wrote: > > > > > > I'm serializing with Pickle in my app, but it's a hassle to > > > > > > dump/load > > > > > > the data every time I mess with it. Is there a way to make the > > > > > > serializing happen automatically with DB access? > > > > > > > -Brian > > > > > > > On Feb 17, 1:46 pm, Carl wrote: > > > > > >> thanks Jorge; most helpful in poin
[web2py] Re: storing a Python list
thanks for the turn of speed! I now have this in db.py and it works a treat... import pickle from gluon.sql import SQLCustomType serialize = SQLCustomType(type='text', native='text', encoder=(lambda x: '"%s"' % pickle.dumps(x).replace('""', '""')), decoder=(lambda x: pickle.loads(x))) ... Field('answer', serialize) On Feb 23, 10:22 am, mdipierro wrote: > My bad. The encoder should be not > > encoder = (lambda x:cPickle.dumps(s) > > but > > encoder = (lambda x: "'%s'" % cPickle.dumps(s).replace("'", "''")) > > This is why the SQLCustomType API needs to be rewritten. > > On Feb 23, 4:06 am, Carl wrote: > > > > > print _insert() gets this... > > > INSERT INTO puzzle(assessment_ref, pia, pio, rung, score, answer, > > version, cDate, mDate) VALUES ('AP5P', 'Which of these lines is a > > *comment* in Python code? > > > .= # a comment > > .- // a comment > > .- * a comment', 'Which of these lines is a *comment* in > > Python code? > > > .- # a comment > > .- // a comment > > .- * a comment', 1, 1, (lp0 > > S'0' > > p1 > > a., 1, 1266919327.86, 1266919327.86); > > > the S'0' > > p1 > > a. > > is the parameter causing the hiccup. It might be the single-quotes? or > > the carriage-returns? > > > Perhaps I need to escape my parameter in encoder/decoder in db.py? > > > On Feb 23, 9:50 am, mdipierro wrote: > > > > before the > > > > ... insert() > > > > can you > > > > print ..._insert(...) > > > > this will tell us what is being sent to the db. > > > > On Feb 23, 3:29 am, Carl wrote: > > > > > I decided to go ahead and move my pickling to db.py with the following > > > > additions: > > > > > import pickle > > > > from gluon.sql import SQLCustomType > > > > serialise = SQLCustomType(type='text', > > > > native='text', > > > > encoder=(lambda x: pickle.dumps(x)), > > > > decoder=(lambda x: pickle.loads(x))) > > > > ... > > > > Field ('answer', serialise) > > > > > When I try and insert a row I get the following error: > > > > File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line > > > > 1850, in insert > > > > self._db._execute(query) > > > > File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line > > > > 890, in > > > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b) > > > > OperationalError: near "S": syntax error > > > > > When I had the pickle.dumps/loads calls within a module all worked > > > > fine. > > > > Where I have gone wrong? > > > > > On Feb 18, 4:42 am, mdipierro wrote: > > > > > > You should do: > > > > > > from gluon.sql import SQLCustomType > > > > > > pickle = > > > > > SQLCustomType( > > > > > type > > > > > ='text', > > > > > native > > > > > ='text', > > > > > encoder = (lambda x:cPickle.dumps(s)), > > > > > decoder = (lambda x: cPikcle.loads(s)) > > > > > ) > > > > > > Field('mypickle',pickle) > > > > > > SQLCustomField may disappear in the new DAL in faviour of a more > > > > > customizable mechanism > > > > > > On Feb 17, 9:20 pm, spiffytech wrote: > > > > > > > That would work, calling MY_PICKLE functions everywhere seems like > > > > > > as > > > > > > much work as calling pickle functions. It would be nice if the > > > > > > pickling could be done transparently behind the scenes, so my > > > > > > controller code could be cleaner and less error-prone. > > > > > > > -Brian > > > > > > > On Feb 17, 2:34 pm, Thadeus Burgess wrote: > > > > > > > > Could you write a function that handles the inserts/selects > > > > > > > instead? > >
[web2py] Re: datetime's sub-second information: query about its handling for different databases
just a thought... if it turns out that datetime can't retain microseconds so as not to break Calendar (and presumably user code out there) could a new field type be added to Web2py? timestamp could store a full Python datetime definition. On Feb 21, 4:01 pm, mdipierro wrote: > forgot about the issue. will take a second look. > > On Feb 21, 5:48 am, Carl wrote: > > > > > Following Dan's posting last year about the loss of microseconds when > > storing PythonDateTimeinstances in > > SQLitehttp://groups.google.com/group/web2py/browse_thread/thread/f9b8cbb660... > > I've got to this area too :) > > > Dan suggests a work-around for SQLite users based on SQLCustomType. > > > A few of questions popped up: > > > 1. is Dan' post the last on this subject (I searched Groups but one is > > never sure) > > > 2. is Dan's work-around the recommended approach for developers > > needing to maintain Python DataTime objects in a non-gae database? > > > 3. do you know if Web2py only maintains Python DataTime object's > > millisecond precision for gae? Or is it maintained for other database? > > > 4. and related to #3... is the datepicker calendar code that needs the > > millisecond precision removed broken on gae? -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: storing a Python list
Sorry, not quite there. I can't see why for myself but when I pass a python list into this SQLCustom definition in db.py data is stored (and pickled) without complaint but when I unpickle the data, the data is returned as a python string (perhaps because the field it of native 'text') If I use a field of type 'text' and perform the pickling in my module code then I can put lists in and get lists out. Any idea why? it'd be real nice to define the pickling once in db.py On Feb 23, 10:30 am, Carl wrote: > thanks for the turn of speed! > > I now have this in db.py and it works a treat... > import pickle > from gluon.sql import SQLCustomType > serialize = SQLCustomType(type='text', > native='text', > encoder=(lambda x: '"%s"' % > pickle.dumps(x).replace('""', '""')), > decoder=(lambda x: pickle.loads(x))) > ... > Field('answer', serialize) > > On Feb 23, 10:22 am, mdipierro wrote: > > > > > My bad. The encoder should be not > > > encoder = (lambda x:cPickle.dumps(s) > > > but > > > encoder = (lambda x: "'%s'" % cPickle.dumps(s).replace("'", "''")) > > > This is why the SQLCustomType API needs to be rewritten. > > > On Feb 23, 4:06 am, Carl wrote: > > > > print _insert() gets this... > > > > INSERT INTO puzzle(assessment_ref, pia, pio, rung, score, answer, > > > version, cDate, mDate) VALUES ('AP5P', 'Which of these lines is a > > > *comment* in Python code? > > > > .= # a comment > > > .- // a comment > > > .- * a comment', 'Which of these lines is a *comment* in > > > Python code? > > > > .- # a comment > > > .- // a comment > > > .- * a comment', 1, 1, (lp0 > > > S'0' > > > p1 > > > a., 1, 1266919327.86, 1266919327.86); > > > > the S'0' > > > p1 > > > a. > > > is the parameter causing the hiccup. It might be the single-quotes? or > > > the carriage-returns? > > > > Perhaps I need to escape my parameter in encoder/decoder in db.py? > > > > On Feb 23, 9:50 am, mdipierro wrote: > > > > > before the > > > > > ... insert() > > > > > can you > > > > > print ..._insert(...) > > > > > this will tell us what is being sent to the db. > > > > > On Feb 23, 3:29 am, Carl wrote: > > > > > > I decided to go ahead and move my pickling to db.py with the following > > > > > additions: > > > > > > import pickle > > > > > from gluon.sql import SQLCustomType > > > > > serialise = SQLCustomType(type='text', > > > > > native='text', > > > > > encoder=(lambda x: pickle.dumps(x)), > > > > > decoder=(lambda x: pickle.loads(x))) > > > > > ... > > > > > Field ('answer', serialise) > > > > > > When I try and insert a row I get the following error: > > > > > File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line > > > > > 1850, in insert > > > > > self._db._execute(query) > > > > > File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line > > > > > 890, in > > > > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b) > > > > > OperationalError: near "S": syntax error > > > > > > When I had the pickle.dumps/loads calls within a module all worked > > > > > fine. > > > > > Where I have gone wrong? > > > > > > On Feb 18, 4:42 am, mdipierro wrote: > > > > > > > You should do: > > > > > > > from gluon.sql import SQLCustomType > > > > > > > pickle = > > > > > > SQLCustomType( > > > > > > type > > > > > > ='text', > > > > > > native > > > > > > ='text', > > > > > > encoder = (lambda x:cPickle.dumps(s)), > > > > > > decoder = (lambda x: cPikcle.loads(s)) > > > > > > ) > > > > > &g
[web2py] Where to install Linked library under Web2py?
I aim to use web2py\gluon\contrib\login_methods\linkedin_account.py along with http://code.google.com/p/python-linkedin/ I'm deploying on GAE so I was hoping someone had a suggestion of where I should install the library (http://code.google.com/p/python- linkedin/) within Web2py? Should it be within my applications/app direction (thereby ensuring it's easier to install Web2py upgrades?) is there anything to watch out for so ensure the files work under dev_appserver and the GAE cloud? thanks -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Where to install Linked library under Web2py?
thanks M for the help in 8 minutes! I'll keep it in login_methods for now and get into implementation. On Mar 25, 2:26 pm, mdipierro wrote: > You only need a single > file:http://code.google.com/p/python-linkedin/source/browse/trunk/python-l... > so the easyest solution is to drop in the login_methods folder. > > The proper way would be to install the module in web2py/site-packages > and make sure that, on gae, site-packages is added to sys.path > > On Mar 25, 9:18 am, Carl wrote: > > > > > I aim to use web2py\gluon\contrib\login_methods\linkedin_account.py > > along withhttp://code.google.com/p/python-linkedin/ > > > I'm deploying on GAE so I was hoping someone had a suggestion of where > > I should install the library (http://code.google.com/p/python- > > linkedin/) within Web2py? > > > Should it be within my applications/app direction (thereby ensuring > > it's easier to install Web2py upgrades?) > > > is there anything to watch out for so ensure the files work under > > dev_appserver and the GAE cloud? > > > thanks -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Web2py & LinkedIn/OAuth and dev_appserver too
hi all, I'm using http://code.google.com/p/python-linkedin/ from contrib/ login_methods/linkedin_account.py In db.py I've added: KEY = 'my key' SECRET = 'associated secret' RETURN_URL = http://localhost:8080/a/c/f auth.settings.login_form=LinkedInAccount(request, KEY, SECRET, RETURN_URL) In linkedin_account.py LinkedInAccount.__init__(), the called to self.api.requestToken() is failing with 'invalid_signature'. The same code, when run locally with web2py.py (with RETURN_URL set to 127.0.0.1:8000/a/c/f) successfully calls self.api.requestToken()... it only fails when Linkedin tries to redirect to 127.0.0.1:8000 Has anyone got LinkedIn OAuth working a) on web2py.py? b) on dev_appserver? c) live on GAE? -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Web2py & LinkedIn/OAuth and dev_appserver too
This page http://code.google.com/p/python-linkedin/ claims "can use http://localhost as your RETURN URL" under the Usage section. And I could certainly get some calls working on 127.0.0.1 (just not the RETURN_URL and so couldn't convince Web2py that the user had logged in and I was simply redirected again back to Linkedin's login page) But when running on dev_appserver I can't even get requestToken() to work. I don't follow your http://web2py.com/linkedin example. Clicking the login link doesn't take me to Linkedin. On Mar 25, 6:00 pm, mdipierro wrote: > I do not think it works from localhost. It must run from a public url. > I have it running here:http://web2py.com/linkedin > > On Mar 25, 12:42 pm, Carl wrote: > > > > > hi all, > > > I'm usinghttp://code.google.com/p/python-linkedin/fromcontrib/ > > login_methods/linkedin_account.py > > > In db.py I've added: > > KEY = 'my key' > > SECRET = 'associated secret' > > RETURN_URL =http://localhost:8080/a/c/f > > auth.settings.login_form=LinkedInAccount(request, KEY, SECRET, > > RETURN_URL) > > > In linkedin_account.py LinkedInAccount.__init__(), the called to > > self.api.requestToken() is failing with 'invalid_signature'. > > > The same code, when run locally with web2py.py (with RETURN_URL set to > > 127.0.0.1:8000/a/c/f) successfully calls self.api.requestToken()... it > > only fails when Linkedin tries to redirect to 127.0.0.1:8000 > > > Has anyone got LinkedIn OAuth working > > a) on web2py.py? > > b) on dev_appserver? > > c) live on GAE? -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Web2py & LinkedIn/OAuth and dev_appserver too
hi M Could I get a copy of your example code behind: http://web2py.com/linkedin p.s. when I click login on your example I am not taken to a linked authentication page. Should I expect that? On Mar 25, 6:12 pm, Carl wrote: > This pagehttp://code.google.com/p/python-linkedin/claims "can > usehttp://localhostas your RETURN URL" under the Usage section. > > And I could certainly get some calls working on 127.0.0.1 (just not > the RETURN_URL and so couldn't convince Web2py that the user had > logged in and I was simply redirected again back toLinkedin'slogin > page) > > But when running on dev_appserver I can't even get requestToken() to > work. > > I don't follow yourhttp://web2py.com/linkedinexample. Clicking the > login link doesn't take me toLinkedin. > > On Mar 25, 6:00 pm, mdipierro wrote: > > > > > I do not think it works from localhost. It must run from a public url. > > I have it running here:http://web2py.com/linkedin > > > On Mar 25, 12:42 pm, Carl wrote: > > > > hi all, > > > > I'm usinghttp://code.google.com/p/python-linkedin/fromcontrib/ > > > login_methods/linkedin_account.py > > > > In db.py I've added: > > > KEY = 'my key' > > > SECRET = 'associated secret' > > > RETURN_URL =http://localhost:8080/a/c/f > > > auth.settings.login_form=LinkedInAccount(request, KEY, SECRET, > > > RETURN_URL) > > > > In linkedin_account.py LinkedInAccount.__init__(), the called to > > > self.api.requestToken() is failing with 'invalid_signature'. > > > > The same code, when run locally with web2py.py (with RETURN_URL set to > > > 127.0.0.1:8000/a/c/f) successfully calls self.api.requestToken()... it > > > only fails whenLinkedintries to redirect to 127.0.0.1:8000 > > > > Has anyone gotLinkedInOAuth working > > > a) on web2py.py? > > > b) on dev_appserver? > > > c) live on GAE? -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] How do I remove the last entry returned by Set.select() without deleting from the db table?
I'm building a ui that lists results to the user. if there are further results available a "More" button allows the user to retrieve them (and have them displayed beneath the existing results) To calculate if there are indeed more results available I am using limitby and requesting one more result than I return to the client for display. outline code... max=10 query=... rows = self.db(query).select(..., limitby=(0,max+1)) if len(rows) == max+1: #lose last row! #but how? results = self.build_results(rows) return results I want to lose the last row of rows before passing it to build_results AND leave the database records untouched. I'm guessing the solution is straightforward and I'm just slow this morning! :) -- To unsubscribe, reply using "remove me" as the subject.
[web2py] Re: How do I remove the last entry returned by Set.select() without deleting from the db table?
thanks Tiago! Works flawlessly. I hadn't thought to drop the extra row on passing rows into build_results. (knew it was straightforward:) On Apr 15, 11:19 am, Tiago Almeida wrote: > This might be completely wrong but did you try using the slice operator? > like so: > > if len(rows) == max+1: > #lose last row! > #but how? > results = self.build_results( *rows[:max] *) > return results > > Sorry if it doesn't work. I can't try it now. > > Regards, > Tiago Almeida > > > > On Thu, Apr 15, 2010 at 10:48 AM, Carl wrote: > > I'm building a ui that lists results to the user. if there are further > > results available a "More" button allows the user to retrieve them > > (and have them displayed beneath the existing results) > > > To calculate if there are indeed more results available I am using > > limitby and requesting one more result than I return to the client for > > display. > > > outline code... > > > max=10 > > query=... > > rows = self.db(query).select(..., limitby=(0,max+1)) > > > if len(rows) == max+1: > > #lose last row! > > #but how? > > results = self.build_results(rows) > > return results > > > I want to lose the last row of rows before passing it to build_results > > AND leave the database records untouched. > > > I'm guessing the solution is straightforward and I'm just slow this > > morning! :) > > > -- > > To unsubscribe, reply using "remove me" as the subject.
[web2py] handing a file upload submitted outside of web2py
I'm using Pyjamas to build my client app and Web2py to build the server. I'm submitting a HTML form (generated by Pyjamas) to the Web2py server code. Where should I look to see how I can handle the submission using Web2py? I already have a function defined in /app/controllers/default.py which gets called with the form data from the web browser (stuff like request.vars). The return value from my function is correctly returned to the client but obviously I need to access the file the user selected and store it in the database (I'm using GAE so storing in the database is the route I need to take) Any pointers?
[web2py] Re: handing a file upload submitted outside of web2py
thanks for replying. It's not an image that's being uploaded but instead an XML file which I will be parsing the contents of into a database table. Carl On Aug 27, 5:24 pm, "Martin.Mulone" wrote: > do you want to access to the image uploaded with form for example?. > use download function in controller > > width="200px" /> > > On Aug 27, 12:08 pm, Carl wrote: > > > > > I'm using Pyjamas to build my client app and Web2py to build the > > server. > > > I'm submitting a HTML form (generated by Pyjamas) to the Web2py server > > code. > > > Where should I look to see how I can handle the submission using > > Web2py? > > > I already have a function defined in /app/controllers/default.py which > > gets called with the form data from the web browser (stuff like > > request.vars). > > > The return value from my function is correctly returned to the client > > but obviously I need to access the file the user selected and store it > > in the database (I'm using GAE so storing in the database is the route > > I need to take) > > > Any pointers?
[web2py] Re: handing a file upload submitted outside of web2py
found the answer here: http://groups.google.com/group/web2py/msg/f755a9d17eaeac26 the format is this: db.MYTABLE.insert(MYFIELD=db.MYTABLE.MYFIELD.store(request.vars.MYFORMFIELD.file,request.vars.MYFORMFIELD.filename)) one can of course insert any other fields using this insert function. On Aug 27, 6:33 pm, Carl wrote: > thanks for replying. > It's not an image that's being uploaded but instead an XML file which > I will be parsing the contents of into a database table. > > Carl > > On Aug 27, 5:24 pm, "Martin.Mulone" wrote: > > > > > do you want to access to the image uploaded with form for example?. > > use download function in controller > > > > width="200px" /> > > > On Aug 27, 12:08 pm, Carl wrote: > > > > I'm using Pyjamas to build my client app and Web2py to build the > > > server. > > > > I'm submitting a HTML form (generated by Pyjamas) to the Web2py server > > > code. > > > > Where should I look to see how I can handle the submission using > > > Web2py? > > > > I already have a function defined in /app/controllers/default.py which > > > gets called with the form data from the web browser (stuff like > > > request.vars). > > > > The return value from my function is correctly returned to the client > > > but obviously I need to access the file the user selected and store it > > > in the database (I'm using GAE so storing in the database is the route > > > I need to take) > > > > Any pointers?
[web2py] How to manipulate a file uploaded to server using web2py framework
I'm uploading a file from a html form submitted from a page built by "pyjamas" pyjs.org Such files contain XML and I have a method on the server to parse the content of such files and generate rows in various tables. Such files are <1MB in size (probably ~50KB at most). What is a good approach to use if using Web2py? I ask because the only examples I have found deal with image files which are not manipulated but 'merely' retrieved at display time. One approach I started was to submit the form and then insert the XML file contents into a table (called queue in the code below). But... I can't figure out how to retrieve the XML data saved to the database (I'm running on GAE). def upload(): from datetime import datetime now = datetime.now() db.queue.insert(name=request.vars.uploadFormElement.filename, xml=db.queue.xml.store(request.vars.uploadFormElement.file,request.vars.uploadFormElement.filename), processed=False, cDate=now, mDate=now) Of course I wouldn't need to retrieve the data from the database if I could have accessed it directly in upload(). Does anyone know the recommended approach to this problem set?
[web2py] Re: How to manipulate a file uploaded to server using web2py framework
thanks for responding Martin I don't want to fight the framework and certainly prefer to adapt my approach to leverage a framework's advantages. I can get Pyjamas to submit to default/upload Do you know a) is this bit Web2py friendly? and b) if so, then what code I should be putting in upload() instead of my low-level db.myfield.insert(...store()) ? On Sep 1, 5:44 pm, "Martin.Mulone" wrote: > In my point of view i don't recommend this approach for uploading > images or files. You lost many good things of web2py in that area, > file verification and in gae you are going to have problems. You can > use an iframe for showing in another page. > > On Sep 1, 12:48 pm, Carl wrote: > > > > > I'm uploading a file from a html form submitted from a page built by > > "pyjamas" pyjs.org > > > Such files contain XML and I have a method on the server to parse the > > content of such files and generate rows in various tables. Such files > > are <1MB in size (probably ~50KB at most). > > > What is a good approach to use if using Web2py? I ask because the only > > examples I have found deal with image files which are not manipulated > > but 'merely' retrieved at display time. > > > One approach I started was to submit the form and then insert the XML > > file contents into a table (called queue in the code below). But... I > > can't figure out how to retrieve the XML data saved to the database > > (I'm running on GAE). > > > def upload(): > > from datetime import datetime > > now = datetime.now() > > db.queue.insert(name=request.vars.uploadFormElement.filename, > > > xml=db.queue.xml.store(request.vars.uploadFormElement.file,request.vars.upl > > oadFormElement.filename), > > processed=False, > > cDate=now, > > mDate=now) > > > Of course I wouldn't need to retrieve the data from the database if I > > could have accessed it directly in upload(). > > > Does anyone know the recommended approach to this problem set?
[web2py] upgrade from 1.84.4 to 1.85.1 fails operations into datastore in sqlite but not GAE
It took a bit of binary upgrading to pin down this issue but I#ve found that it's between 1.84.4 and 1.85.1 However since 1.85.1 (thru to 1.85.3) selects and inserts to the datastore fail when I use a SQLCustom definition (see details below). On dev_appserver all continues to work fine. But locally on sqlite... operations on the datastore fail at gluon/ sql.py (in v1.85.1 it's line 3323) class Set, parse() after line "elif field_type == 'datetime'\" (y, m, d) = [int(x) for x in str(value)[:10].strip().split('-')] ValueError: need more than 1 value to unpack Background: Locally Web2py drops the microseconds from datetime. On GAE it does not. I need the accuracy so I added the following db.py to define a Fieldtype 'timestamp': if request.env.web2py_runtime_gae: from gluon.contrib.gql import * db = DAL('gae') session.connect(request, response, db=db) timestamp = 'datetime' else: # else use a normal relational database db = DAL('sqlite://storage.sqlite') from gluon.sql import SQLCustomType import datetime from time import mktime, localtime timestamp = SQLCustomType(type='datetime', native='NUMERIC(16,6)', encoder=(lambda x: str(mktime(x.timetuple()) + x.microsecond/100.0)), decoder=(lambda x: datetime.datetime(* (list(localtime(int(x))[:6])+[int(round(x%1,6)*100)]) ))) Is this definition of timestamp using SQLCustomType no longer appropriate/workable? Tables that don't include a timestamp field work correct in 1.84.x and 1.85.x
[web2py] Re: upgrade from 1.84.4 to 1.85.1 fails operations into datastore in sqlite but not GAE
Your change http://code.google.com/p/web2py/source/detail?r=37b316948f4ae0cfa8a3d566f17eb00ddca9b5c5 worked. thanks for the fast turn-around. Wondering aloud... would it be a good idea to add 'timestamp' as a formal Web2py Field type? the missing microseconds of datetime on *some* platforms is going to trip developers up. On Sep 20, 2:35 pm, mdipierro wrote: > Can you please try trunk? > > On Sep 20, 8:09 am, Carl wrote: > > > > > It took a bit of binary upgrading to pin down this issue but I#ve > > found that it's between 1.84.4 and 1.85.1 > > > However since 1.85.1 (thru to 1.85.3) selects and inserts to the > > datastore fail when I use a SQLCustom definition (see details below). > > > On dev_appserver all continues to work fine. > > But locally on sqlite... operations on the datastore fail at gluon/ > > sql.py (in v1.85.1 it's line 3323) class Set, parse() after line "elif > > field_type == 'datetime'\" > > (y, m, d) = [int(x) for x in str(value)[:10].strip().split('-')] > > ValueError: need more than 1 value to unpack > > > Background: > > Locally Web2py drops the microseconds from datetime. On GAE it does > > not. > > I need the accuracy so I added the following db.py to define a > > Fieldtype 'timestamp': > > > if request.env.web2py_runtime_gae: > > from gluon.contrib.gql import * > > db = DAL('gae') > > session.connect(request, response, db=db) > > timestamp = 'datetime' > > else: # else use a normal relational database > > db = DAL('sqlite://storage.sqlite') > > from gluon.sql import SQLCustomType > > import datetime > > from time import mktime, localtime > > timestamp = SQLCustomType(type='datetime', > > native='NUMERIC(16,6)', > > encoder=(lambda x: > > str(mktime(x.timetuple()) + x.microsecond/100.0)), > > decoder=(lambda x: datetime.datetime(* > > (list(localtime(int(x))[:6])+[int(round(x%1,6)*100)]) ))) > > > Is this definition of timestamp using SQLCustomType no longer > > appropriate/workable? > > Tables that don't include a timestamp field work correct in 1.84.x and > > 1.85.x
[web2py] does Field attribiute unique=True work on GAE?
My db.py includes... db.define_table('voucher', Field('code', 'string', length=128, unique=True, notnull=True, required=True), Locally on sqlite when I insert a second record with the same 'code' as an existing record insert() throws an except. I catch the exception and report back to the user. Locally on dev_appserver the "duplicate" insert() successfully inserts a duplicate record; no exception is thrown. I've looked at the 2nd edition book and this group but can't find anything that say that GAE doesn't support unqiue=True. Can anyone clarify this use of unique=True on GAE? And if it's not supported is there a recommended alternative approach?
[web2py] Re: Select specific fields on GAE
I'd like to second that comment - and add patient community and lead architect to it too! On Oct 1, 1:47 pm, István Gazsi wrote: > Thanks Massimo, you're working really fast! And by the way web2py has > the most user-friendly developers and community I have ever seen. :)
[web2py] almost have linkedin oauth working within web2py application. just need one more push
I've been following the instructions at http://code.google.com/p/python-linkedin/ to add linkedin authentication. I grabbed the latest revision (#20) from svn. I've started by creating a new app (and called it oauth) within web2py to keep things simple. Into default.py I've added the following functions (and I've defined my own KEY and SECRET in db.py). When I enter http://127.0.0.1:8000/oauth/default/linkedin I am redirected to the LinkedIn website where I can give permission to log in. Once I do that I am redirected to http://127.0.0.1:8000/oauth/default/profile/ Here I can retrieve request.vars.oauth_verifier for a call to api.accessToken(). however, the return value is False and a call to api.getRequestTokenError() returns "permission_unknown". I can't find out what is causing this error. Any ideas? def linkedin(): RETURN_URL = "http://127.0.0.1:8000/oauth/default/profile/"; import gluon.contrib.login_methods.linkedin from gluon.contrib.login_methods.linkedin import LinkedIn api = LinkedIn(KEY, SECRET, RETURN_URL) token = api.requestToken() if not api.getRequestTokenError(): u = api.getAuthorizeURL(request_token=api.request_token) redirect(u) return dict(message=T('Hello World'),token=token, request_token=api.request_token, token_secret=api.request_token_secret) def profile(): oauth_token = request.vars.oauth_token oauth_verifier = request.vars.oauth_verifier RETURN_URL = "http://127.0.0.1:8000/oauth/default/more/"; import gluon.contrib.login_methods.linkedin from gluon.contrib.login_methods.linkedin import LinkedIn api = LinkedIn(KEY, SECRET, RETURN_URL) token = api.requestToken() result = api.accessToken(verifier=oauth_verifier) profile = None if result: profile = api.GetProfile(url='http://www.linkedin.com/in/ carlroach') else: print api.getRequestTokenError() return dict(message=T('Profile info'), profile=profile) def more(): return dict(message='more')
[web2py] Re: almost have linkedin oauth working within web2py application. just need one more push
ah! Mic's Twitter example was *very* useful. Running web2py.py from a command line (on Win7HE) worked a treat but launching from within Eclipse (Helios) failed to return from Twitter. Why... well the 'return url' sent to twitter had the port number duplicated. So instead of http://127.0.0.1:8000/helloTwitter/default/home_timeline we have http://127.0.0.1:8000:8000/helloTwitter/default/home_timeline and of course that :8000:8000 means that the browser's redirecting nowhere fast. Twitter displays the return URL making it easy to diagnose. Linkedin does not so I had gotten stuck. So similarly, my round-trip to Linkedin works when running from a command line but not from within Eclipse. The duplicate port number happens in gluon/contrib/login_methods/ oauth10a_account.py in __redirect_uri() The line "if not http_host: http_host=r.env.http_host" retrieves a host name including a port number. The line url_port = ':' + r.env.server_port adds the port number again. The headache is: why does this happen within Eclipse but not from a command-line? Does anyone know the cure for this headache? On Oct 9, 8:15 pm, Carl Roach wrote: > Thanks Mic; looks and sounds really useful > > On 9 Oct 2010, at 18:23, Michele Comitini wrote: > > > > > > > > > You can try with oauth10a_account.py login method, it should work. I > > did not have time yet to put an example application on line, > > but it is very similar to twitter. > > >http://code.google.com/r/michelecomitini-facebookaccess/source/browse... > > > I will put thelinkedinexample online soon... > > > mic > > > 2010/10/9CarlRoach : > >> Thanks M. I'll look into that but I will need full access toLinkedIn(name, > >> company, contacts) > > >> I'm nearly there it's just the vague error message that had me stumped :) > > >> On 9 Oct 2010, at 04:18, mdipierro wrote: > > >>> If you only need authentication you may want to consider using rpx as > >>> shown in this video: > > >>>http://vimeo.com/13485916 > > >>> On Oct 8, 7:36 pm,Carl wrote: > >>>> I've been following the instructions > >>>> athttp://code.google.com/p/python-linkedin/ > >>>> to addlinkedinauthentication. I grabbed the latest revision (#20) > >>>> from svn. > > >>>> I've started by creating a new app (and called it oauth) within web2py > >>>> to keep things simple. > > >>>> Into default.py I've added the following functions (and I've defined > >>>> my own KEY and SECRET in db.py). When I > >>>> enterhttp://127.0.0.1:8000/oauth/default/linkedin > >>>> I am redirected to theLinkedInwebsite where I can give permission to > >>>> log in. Once I do that I am redirected > >>>> tohttp://127.0.0.1:8000/oauth/default/profile/ > >>>> Here I can retrieve request.vars.oauth_verifier for a call to > >>>> api.accessToken(). however, the return value is False and a call to > >>>> api.getRequestTokenError() returns "permission_unknown". I can't find > >>>> out what is causing this error. > > >>>> Any ideas? > > >>>> deflinkedin(): > >>>> RETURN_URL = "http://127.0.0.1:8000/oauth/default/profile/"; > >>>> import gluon.contrib.login_methods.linkedin > >>>> from gluon.contrib.login_methods.linkedinimportLinkedIn > >>>> api =LinkedIn(KEY, SECRET, RETURN_URL) > >>>> token = api.requestToken() > >>>> if not api.getRequestTokenError(): > >>>> u = api.getAuthorizeURL(request_token=api.request_token) > >>>> redirect(u) > >>>> return dict(message=T('Hello World'),token=token, > >>>> request_token=api.request_token, > >>>> token_secret=api.request_token_secret) > > >>>> def profile(): > >>>> oauth_token = request.vars.oauth_token > >>>> oauth_verifier = request.vars.oauth_verifier > > >>>> RETURN_URL = "http://127.0.0.1:8000/oauth/default/more/"; > >>>> import gluon.contrib.login_methods.linkedin > >>>> from gluon.contrib.login_methods.linkedinimportLinkedIn > >>>> api =LinkedIn(KEY, SECRET, RETURN_URL) > >>>> token = api.requestToken() > >>>> result = api.accessToken(verifier=oauth_verifier) > >>>> profile = None > >>>> if result: > >>>> profile = api.GetProfile(url='http://www.linkedin.com/in/ > >>>> carlroach') > >>>> else: > >>>> print api.getRequestTokenError() > > >>>> return dict(message=T('Profile info'), profile=profile) > > >>>> def more(): > >>>> return dict(message='more')
Re: [web2py] Re: almost have linkedin oauth working within web2py application. just need one more push
I'm on 1.85.3, the same as your example I'll update tomorrow to 1.86.3 and see if I get the same behaviour thanks for the help C On 11 October 2010 21:06, Michele Comitini wrote: > Carl, on 2nd thought... do you have 1.86.3, do you? > there was a bug in some erlier version... > > 2010/10/11 Carl : > > ah! > > > > Mic's Twitter example was *very* useful. > > > > Running web2py.py from a command line (on Win7HE) worked a treat but > > launching from within Eclipse (Helios) failed to return from Twitter. > > > > Why... well the 'return url' sent to twitter had the port number > > duplicated. So instead of > http://127.0.0.1:8000/helloTwitter/default/home_timeline > > we have http://127.0.0.1:8000:8000/helloTwitter/default/home_timeline > > > > and of course that :8000:8000 means that the browser's redirecting > > nowhere fast. > > > > Twitter displays the return URL making it easy to diagnose. Linkedin > > does not so I had gotten stuck. > > > > So similarly, my round-trip to Linkedin works when running from a > > command line but not from within Eclipse. > > > > The duplicate port number happens in gluon/contrib/login_methods/ > > oauth10a_account.py in __redirect_uri() > > The line "if not http_host: http_host=r.env.http_host" retrieves a > > host name including a port number. > > The line url_port = ':' + r.env.server_port adds the port number > > again. > > > > The headache is: why does this happen within Eclipse but not from a > > command-line? > > > > Does anyone know the cure for this headache? > > > > > > On Oct 9, 8:15 pm, Carl Roach wrote: > >> Thanks Mic; looks and sounds really useful > >> > >> On 9 Oct 2010, at 18:23, Michele Comitini > wrote: > >> > >> > >> > >> > >> > >> > >> > >> > You can try with oauth10a_account.py login method, it should work. I > >> > did not have time yet to put an example application on line, > >> > but it is very similar to twitter. > >> > >> >http://code.google.com/r/michelecomitini-facebookaccess/source/browse. > .. > >> > >> > I will put thelinkedinexample online soon... > >> > >> > mic > >> > >> > 2010/10/9CarlRoach : > >> >> Thanks M. I'll look into that but I will need full access > toLinkedIn(name, company, contacts) > >> > >> >> I'm nearly there it's just the vague error message that had me > stumped :) > >> > >> >> On 9 Oct 2010, at 04:18, mdipierro wrote: > >> > >> >>> If you only need authentication you may want to consider using rpx > as > >> >>> shown in this video: > >> > >> >>>http://vimeo.com/13485916 > >> > >> >>> On Oct 8, 7:36 pm,Carl wrote: > >> >>>> I've been following the instructions athttp:// > code.google.com/p/python-linkedin/ > >> >>>> to addlinkedinauthentication. I grabbed the latest revision (#20) > >> >>>> from svn. > >> > >> >>>> I've started by creating a new app (and called it oauth) within > web2py > >> >>>> to keep things simple. > >> > >> >>>> Into default.py I've added the following functions (and I've > defined > >> >>>> my own KEY and SECRET in db.py). When I enterhttp:// > 127.0.0.1:8000/oauth/default/linkedin > >> >>>> I am redirected to theLinkedInwebsite where I can give permission > to > >> >>>> log in. Once I do that I am redirected tohttp:// > 127.0.0.1:8000/oauth/default/profile/ > >> >>>> Here I can retrieve request.vars.oauth_verifier for a call to > >> >>>> api.accessToken(). however, the return value is False and a call to > >> >>>> api.getRequestTokenError() returns "permission_unknown". I can't > find > >> >>>> out what is causing this error. > >> > >> >>>> Any ideas? > >> > >> >>>> deflinkedin(): > >> >>>> RETURN_URL = "http://127.0.0.1:8000/oauth/default/profile/"; > >> >>>> import gluon.contrib.login_methods.linkedin > >> >>>> from gluon.contrib.login_methods.linkedinimportLinkedIn > >> >>>> api =LinkedIn(KEY, SECRET, RETURN_
[web2py] Re: almost have linkedin oauth working within web2py application. just need one more push
don't know why I didn't upgrade (it's normally the first thing I try) 1.86.3 has removed the bug! sorry to have wasted your time. I'll now have a go at adding Linkedin to your example app. C On Oct 11, 9:29 pm, Carl wrote: > I'm on 1.85.3, the same as your example > I'll update tomorrow to 1.86.3 and see if I get the same behaviour > > thanks for the help > > C > > On 11 October 2010 21:06, Michele Comitini wrote: > > > > > > > > > Carl, on 2nd thought... do you have 1.86.3, do you? > > there was a bug in some erlier version... > > > 2010/10/11 Carl : > > > ah! > > > > Mic's Twitter example was *very* useful. > > > > Running web2py.py from a command line (on Win7HE) worked a treat but > > > launching from within Eclipse (Helios) failed to return from Twitter. > > > > Why... well the 'return url' sent to twitter had the port number > > > duplicated. So instead of > >http://127.0.0.1:8000/helloTwitter/default/home_timeline > > > we havehttp://127.0.0.1:8000:8000/helloTwitter/default/home_timeline > > > > and of course that :8000:8000 means that the browser's redirecting > > > nowhere fast. > > > > Twitter displays the return URL making it easy to diagnose. Linkedin > > > does not so I had gotten stuck. > > > > So similarly, my round-trip to Linkedin works when running from a > > > command line but not from within Eclipse. > > > > The duplicate port number happens in gluon/contrib/login_methods/ > > > oauth10a_account.py in __redirect_uri() > > > The line "if not http_host: http_host=r.env.http_host" retrieves a > > > host name including a port number. > > > The line url_port = ':' + r.env.server_port adds the port number > > > again. > > > > The headache is: why does this happen within Eclipse but not from a > > > command-line? > > > > Does anyone know the cure for this headache? > > > > On Oct 9, 8:15 pm, Carl Roach wrote: > > >> Thanks Mic; looks and sounds really useful > > > >> On 9 Oct 2010, at 18:23, Michele Comitini > > wrote: > > > >> > You can try with oauth10a_account.py login method, it should work. I > > >> > did not have time yet to put an example application on line, > > >> > but it is very similar to twitter. > > > >> >http://code.google.com/r/michelecomitini-facebookaccess/source/browse. > > .. > > > >> > I will put thelinkedinexample online soon... > > > >> > mic > > > >> > 2010/10/9CarlRoach : > > >> >> Thanks M. I'll look into that but I will need full access > > toLinkedIn(name, company, contacts) > > > >> >> I'm nearly there it's just the vague error message that had me > > stumped :) > > > >> >> On 9 Oct 2010, at 04:18, mdipierro wrote: > > > >> >>> If you only need authentication you may want to consider using rpx > > as > > >> >>> shown in this video: > > > >> >>>http://vimeo.com/13485916 > > > >> >>> On Oct 8, 7:36 pm,Carl wrote: > > >> >>>> I've been following the instructions athttp:// > > code.google.com/p/python-linkedin/ > > >> >>>> to addlinkedinauthentication. I grabbed the latest revision (#20) > > >> >>>> from svn. > > > >> >>>> I've started by creating a new app (and called it oauth) within > > web2py > > >> >>>> to keep things simple. > > > >> >>>> Into default.py I've added the following functions (and I've > > defined > > >> >>>> my own KEY and SECRET in db.py). When I enterhttp:// > > 127.0.0.1:8000/oauth/default/linkedin > > >> >>>> I am redirected to theLinkedInwebsite where I can give permission > > to > > >> >>>> log in. Once I do that I am redirected tohttp:// > > 127.0.0.1:8000/oauth/default/profile/ > > >> >>>> Here I can retrieve request.vars.oauth_verifier for a call to > > >> >>>> api.accessToken(). however, the return value is False and a call to > > >> >>>> api.getRequestTokenError() returns "permission_unknown". I can't > > find > > >> >>>> out what is causing this error. > > > >> >>>> Any ideas? > >
[web2py] OAuth and Linkedin on dev_appserver trips with a 303
I started with Michele Comitini pointing me towards his example of oauth with twitter (it also has facebook) http://code.google.com/r/michelecomitini-facebookaccess/source/browse/%23hg/applications/helloTwitter&usg=AFQjCNGD_upo3rTb6VeNIEAo9EP5HA1mqg The Twitter oauth worked fine locally but on Win 7 on dev_appserver I needed to move the directory oauth2 from web2py/site-packages to web2py/gluon/contrib otherwise dev_appserver couldn't find the oauth2 import I created a basic Web2py applications to authenticate using LinkedIn. Locally on web2py all looks fine but locally on dev_appserver I hit a problem when LinkedIn returns once it has authenticated. On the return from LinkedIn I get XML Parsing Error: junk after document element Location: http://localhost:8080/linkedin/default/user/login?_next=%2Flinkedin%2Fdefault%2Fuser_profile&oauth_token=----&oauth_verifier=## Line Number 11, Column 1:Status: 303 SEE OTHER So... 303 is telling me I need to request another URL to find out the error. Does anyone know how I do that? Or, if indeed I need to.
[web2py] Re: almost have linkedin oauth working within web2py application. just need one more push
I have a basic linked oauth working. Now it's a question of parsing LinkedIn replies. thanks for your help C On Oct 12, 10:20 am, Carl wrote: > don't know why I didn't upgrade (it's normally the first thing I try) > > 1.86.3 has removed the bug! sorry to have wasted your time. > I'll now have a go at addingLinkedinto your example app. > > C > > On Oct 11, 9:29 pm, Carl wrote: > > > > > > > > > I'm on 1.85.3, the same as your example > > I'll update tomorrow to 1.86.3 and see if I get the same behaviour > > > thanks for the help > > > C > > > On 11 October 2010 21:06, Michele Comitini > > wrote: > > > > Carl, on 2nd thought... do you have 1.86.3, do you? > > > there was a bug in some erlier version... > > > > 2010/10/11 Carl : > > > > ah! > > > > > Mic's Twitter example was *very* useful. > > > > > Running web2py.py from a command line (on Win7HE) worked a treat but > > > > launching from within Eclipse (Helios) failed to return from Twitter. > > > > > Why... well the 'return url' sent to twitter had the port number > > > > duplicated. So instead of > > >http://127.0.0.1:8000/helloTwitter/default/home_timeline > > > > we havehttp://127.0.0.1:8000:8000/helloTwitter/default/home_timeline > > > > > and of course that :8000:8000 means that the browser's redirecting > > > > nowhere fast. > > > > > Twitter displays the return URL making it easy to diagnose.Linkedin > > > > does not so I had gotten stuck. > > > > > So similarly, my round-trip toLinkedinworks when running from a > > > > command line but not from within Eclipse. > > > > > The duplicate port number happens in gluon/contrib/login_methods/ > > > > oauth10a_account.py in __redirect_uri() > > > > The line "if not http_host: http_host=r.env.http_host" retrieves a > > > > host name including a port number. > > > > The line url_port = ':' + r.env.server_port adds the port number > > > > again. > > > > > The headache is: why does this happen within Eclipse but not from a > > > > command-line? > > > > > Does anyone know the cure for this headache? > > > > > On Oct 9, 8:15 pm, Carl Roach wrote: > > > >> Thanks Mic; looks and sounds really useful > > > > >> On 9 Oct 2010, at 18:23, Michele Comitini > > > wrote: > > > > >> > You can try with oauth10a_account.py login method, it should work. I > > > >> > did not have time yet to put an example application on line, > > > >> > but it is very similar to twitter. > > > > >> >http://code.google.com/r/michelecomitini-facebookaccess/source/browse. > > > .. > > > > >> > I will put thelinkedinexample online soon... > > > > >> > mic > > > > >> > 2010/10/9CarlRoach : > > > >> >> Thanks M. I'll look into that but I will need full access > > > toLinkedIn(name, company, contacts) > > > > >> >> I'm nearly there it's just the vague error message that had me > > > stumped :) > > > > >> >> On 9 Oct 2010, at 04:18, mdipierro wrote: > > > > >> >>> If you only need authentication you may want to consider using rpx > > > as > > > >> >>> shown in this video: > > > > >> >>>http://vimeo.com/13485916 > > > > >> >>> On Oct 8, 7:36 pm,Carl wrote: > > > >> >>>> I've been following the instructions athttp:// > > > code.google.com/p/python-linkedin/ > > > >> >>>> to addlinkedinauthentication. I grabbed the latest revision (#20) > > > >> >>>> from svn. > > > > >> >>>> I've started by creating a new app (and called it oauth) within > > > web2py > > > >> >>>> to keep things simple. > > > > >> >>>> Into default.py I've added the following functions (and I've > > > defined > > > >> >>>> my own KEY and SECRET in db.py). When I enterhttp:// > > > 127.0.0.1:8000/oauth/default/linkedin > > > >> >>>> I am redirected to theLinkedInwebsite where I can give permission > > > to > > > >> >>>> log in. Once I do that I am redirected
[web2py] How does Web2py identify unique users who login via oauth?
hi In my web2py login is done using oauth (via LinkedIn). How does Web2py differentiate between users? Without oauth I can see in the table auth_user that email is unique and can be mapped. When I login using a LinkedIn account I don't see anything unique in auth_user. What am I missing / not setting ? thanks
[web2py] Re: How does Web2py identify unique users who login via oauth?
Have worked out the answer; and it's an obvious answer. auth_user.username can be set to a linkedin user's profile id. On Oct 13, 5:19 pm, Carl wrote: > hi > > In my web2py login is done using oauth (via LinkedIn). > > How does Web2py differentiate between users? > > Without oauth I can see in the table auth_user that email is unique > and can be mapped. > > When I login using a LinkedIn account I don't see anything unique in > auth_user. > > What am I missing / not setting ? > > thanks
[web2py] Re: Vote for a new logo
great idea for an app. as well as voting perhaps adding a comment field could be offered as an option? Such comments could help logo designers iterate designs. On Oct 14, 11:07 am, rochacbruno wrote: > The app needs some improvements that will be done today. > > 1 order logos by number of votes > 2 allow users to delete > > I am working on this > > Enviado via iPhone > > Em 14/10/2010, às 06:58, Michele Comitini > escreveu: > > > > > > > > > How logos are presented? The order can interfere with the vote... > > > 2010/10/14 weheh : > >> If anyone can delete 22, 23, and 24, please, you have my permission to > >> do so.
[web2py] How to do one-off registration tasks when using LinkedIn to authenticate/login
My app has two methods for creating user accounts (for two different user groups) The first is conventional and takes email/password and sets auth.settings.register_onaccept to a function that adds the new user to various 'permission' groups. The second authenticates via LinkedIn but on return I'm having trouble doing one-off set-up (e.g., adding 'permission' groups). I've set auth.settings.register_onaccept but no registration function is called. is this correct? So my question is: when authenticating using LinkedIn how can I do one- off user set-up? I've put the relevant code from default.py below... # LinkedIn loa = local_import('linkedin_oauth_data') CLIENT_ID=loa.CLIENT_ID CLIENT_SECRET=loa.CLIENT_SECRET AUTH_URL=loa.AUTH_URL TOKEN_URL=loa.TOKEN_URL ACCESS_TOKEN_URL=loa.ACCESS_TOKEN_URL from gluon.contrib.login_methods.oauth10a_account import OAuthAccount import oauth2 as oauth import gluon.contrib.simplejson as json class LinkedInAccount(OAuthAccount): def get_user(self): if self.accessToken() is None: return None else: client = oauth.Client(self.consumer, self.accessToken()) resp, content = client.request('https://api.linkedin.com/ v1/people/~:(id,first-name,last-name)') if resp['status'] != '200': return None from gluon.contrib.login_methods.linkedin import Profile p = Profile() profile = p.create(content) return dict(first_name=profile.first_name, last_name=profile.last_name, email=profile.id) def user(): auth.settings.login_onaccept = lambda form: registerAgent(form) auth.settings.login_next = URL(r=request,f='account') auth.settings.login_form=LinkedInAccount(globals(),CLIENT_ID,CLIENT_SECRET, AUTH_URL, TOKEN_URL, ACCESS_TOKEN_URL) return dict(form=auth())
[web2py] Is user in [app]/[controller.py]/user hard-coded into Web2py?
Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
[web2py] Re: Vote for a new logo
Have we considered using 99designs.com? Logo design is one of their specialities. No offence intended (to anyone, at all!)
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro wrote: > look into default. You can replace > > def user(): return dict(form=auth()) > > > with > > def agent(): return dict(form=auth()) > def candidate(): return dict(form=auth()) > > and in the two functions you can set different default for auth_user > fields. > > On Oct 15, 8:45 am, Carl wrote: > > Is there a way to use [app]/default/agent instead of app/default/user? > > > > I want to have two implementations of authentication (/agent and / > > candidate)
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro wrote: > Not necessarily and I would not do it that way but you can. > > > > On Oct 15, 1:12 pm, Carl wrote: > > thanks M. > > > > Do I understand that your solution is to have two separate user tables in > > db.py? > > > > On 15 October 2010 18:42, mdipierro wrote: > > > > > look into default. You can replace > > > > > def user(): return dict(form=auth()) > > > > > with > > > > > def agent(): return dict(form=auth()) > > > def candidate(): return dict(form=auth()) > > > > > and in the two functions you can set different default for auth_user > > > fields. > > > > > On Oct 15, 8:45 am, Carl wrote: > > > > Is there a way to use [app]/default/agent instead of > app/default/user? > > > > > > I want to have two implementations of authentication (/agent and / > > > > candidate) > > > > >
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to "formally" register first and then login agents can be "automatically" registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl wrote: > I'm glad I don't need two user tables. I ideally would want to stick to a > single table. > > > > On 15 October 2010 19:14, mdipierro wrote: > >> Not necessarily and I would not do it that way but you can. >> >> >> >> On Oct 15, 1:12 pm, Carl wrote: >> > thanks M. >> > >> > Do I understand that your solution is to have two separate user tables >> in >> > db.py? >> > >> > On 15 October 2010 18:42, mdipierro wrote: >> > >> > > look into default. You can replace >> > >> > > def user(): return dict(form=auth()) >> > >> > > with >> > >> > > def agent(): return dict(form=auth()) >> > > def candidate(): return dict(form=auth()) >> > >> > > and in the two functions you can set different default for auth_user >> > > fields. >> > >> > > On Oct 15, 8:45 am, Carl wrote: >> > > > Is there a way to use [app]/default/agent instead of >> app/default/user? >> > >> > > > I want to have two implementations of authentication (/agent and / >> > > > candidate) >> > >> > >> > >
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
One small problem I'm coming across... I'm using OAuth to login via LinkedIn for a subset of my users. In gluon/tools.py line 1471 the statement hard-codes 'user' (web2py 1.87.3) next = self.url('user',args='login',vars=dict(_next=next)) Is there something I should have done to avoid this route through the code? I'm currently using it to pass a "return url" to LinkedIn and I'd like a different url besides /user/ On 16 October 2010 01:01, Carl Roach wrote: > Thanks M > I'll base my agent user type on your approach > Thanks again for taking the time > > On 16 Oct 2010, at 00:48, mdipierro wrote: > > > This is what I normally do: > > > > 1) I use LinkedIN with RPX (but should be same with OAuth) > > 2) my auth_user table is populated automatically when users login via > > RPX > > 3) my auth_user table as a field "registered' invisible and defaults > > to false > > 4) my model has this code > > > > if auth.user and request.function!='user' and not > > auth.user.registered: > >redirect(URL('default','user/profile')) > > > > 5) this forces users to complete a registration process. > > 6) my auth_user table also a boolean manager field that defaults to > > false. > > 7) I use appadmin to promote users to managers > > > > On Oct 15, 6:40 pm, Carl Roach wrote: > >> I've got authentication working with LinkedIn. But no registration step > happens... I would like to add a set of permissions the first time a new > user logins in via LinkedIn. > >> > >> For a second type of user I offer a registration page to get > email/password and then add a different set of permissions. > >> > >> So the piece I'm missing is: how do I fire off a registration step for > my "LinkedIn" users? > >> > >> On 16 Oct 2010, at 00:19, Radomirs Cirskis wrote: > >> > >>> Hi Carl! > >> > >>> you can implement two registration similar to the technique Massimo > >>> advised the authentication. > >>> You could look into CAS. Not 100% sure, but it could be solution for > >>> your case. I could be mistaken. Can you elaborate further on what you > >>> are trying to achieve? > >>> rad > >> > >>> On Oct 16, 10:00 am, Carl wrote: > >>>> thanks M. > >> > >>>> adding to def candidate() > >>>> auth.auth_user = 'candidate' > >>>> has that side sorted. > >> > >>>> for my function agent() the process is a little more complicated. > >>>> While Candidates have to "formally" register first and then login > agents can > >>>> be "automatically" registered (I need to add some permissions and do > other > >>>> one-off stuff) when they come back from LinkedIn. > >> > >>>> The problem is that registration doesn't take place at all and I can't > >>>> figure out how to get this one-off registration phase called. can you > point > >>>> me in the right direction? > >> > >>>> On 15 October 2010 19:22, Carl wrote: > >> > >>>>> I'm glad I don't need two user tables. I ideally would want to stick > to a > >>>>> single table. > >> > >>>>> On 15 October 2010 19:14, mdipierro wrote: > >> > >>>>>> Not necessarily and I would not do it that way but you can. > >> > >>>>>> On Oct 15, 1:12 pm, Carl wrote: > >>>>>>> thanks M. > >> > >>>>>>> Do I understand that your solution is to have two separate user > tables > >>>>>> in > >>>>>>> db.py? > >> > >>>>>>> On 15 October 2010 18:42, mdipierro > wrote: > >> > >>>>>>>> look into default. You can replace > >> > >>>>>>>> def user(): return dict(form=auth()) > >> > >>>>>>>> with > >> > >>>>>>>> def agent(): return dict(form=auth()) > >>>>>>>> def candidate(): return dict(form=auth()) > >> > >>>>>>>> and in the two functions you can set different default for > auth_user > >>>>>>>> fields. > >> > >>>>>>>> On Oct 15, 8:45 am, Carl wrote: > >>>>>>>>> Is there a way to use [app]/default/agent instead of > >>>>>> app/default/user? > >> > >>>>>>>>> I want to have two implementations of authentication (/agent and > / > >>>>>>>>> candidate) > >> > >> >
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
temporarily I've renamed def agent() back to def user() the only problem I'm left with is how to get my one-off registration code to be called. for users registering by a registration form all is well. For them I've set: auth.settings.register_onaccept = lambda form: registerCandidate(form) But for users via LinkedIn... no registeration step is called; and auth.settings.login_onaccept = lambda form: registerAgent(form) is ignored too. One solution is to change: auth.settings.login_next = URL(r=request,f='account') to: auth.settings.login_next = URL(r=request,f='oneoffregistration') which can do the one of stuff and then redirect to 'account' But I feel there must be a way that leverages the framework more elegantly. Is there? :) On 16 October 2010 03:51, mdipierro wrote: > I did not realize that... can change it but for now it is indeed a > problem. One solution would be to extend Auth and override url() > > On Oct 15, 9:07 pm, Carl wrote: > > One small problem I'm coming across... > > > > I'm using OAuth to login via LinkedIn for a subset of my users. > > > > In gluon/tools.py line 1471 the statement hard-codes 'user' (web2py > 1.87.3) > > next = self.url('user',args='login',vars=dict(_next=next)) > > > > Is there something I should have done to avoid this route through the > code? > > I'm currently using it to pass a "return url" to LinkedIn and I'd like a > > different url besides /user/ > > > > On 16 October 2010 01:01, Carl Roach wrote: > > > > > Thanks M > > > I'll base my agent user type on your approach > > > Thanks again for taking the time > > > > > On 16 Oct 2010, at 00:48, mdipierro wrote: > > > > > > This is what I normally do: > > > > > > 1) I use LinkedIN with RPX (but should be same with OAuth) > > > > 2) my auth_user table is populated automatically when users login via > > > > RPX > > > > 3) my auth_user table as a field "registered' invisible and defaults > > > > to false > > > > 4) my model has this code > > > > > > if auth.user and request.function!='user' and not > > > > auth.user.registered: > > > >redirect(URL('default','user/profile')) > > > > > > 5) this forces users to complete a registration process. > > > > 6) my auth_user table also a boolean manager field that defaults to > > > > false. > > > > 7) I use appadmin to promote users to managers > > > > > > On Oct 15, 6:40 pm, Carl Roach wrote: > > > >> I've got authentication working with LinkedIn. But no registration > step > > > happens... I would like to add a set of permissions the first time a > new > > > user logins in via LinkedIn. > > > > > >> For a second type of user I offer a registration page to get > > > email/password and then add a different set of permissions. > > > > > >> So the piece I'm missing is: how do I fire off a registration step > for > > > my "LinkedIn" users? > > > > > >> On 16 Oct 2010, at 00:19, Radomirs Cirskis > wrote: > > > > > >>> Hi Carl! > > > > > >>> you can implement two registration similar to the technique Massimo > > > >>> advised the authentication. > > > >>> You could look into CAS. Not 100% sure, but it could be solution > for > > > >>> your case. I could be mistaken. Can you elaborate further on what > you > > > >>> are trying to achieve? > > > >>> rad > > > > > >>> On Oct 16, 10:00 am, Carl wrote: > > > >>>> thanks M. > > > > > >>>> adding to def candidate() > > > >>>> auth.auth_user = 'candidate' > > > >>>> has that side sorted. > > > > > >>>> for my function agent() the process is a little more complicated. > > > >>>> While Candidates have to "formally" register first and then login > > > agents can > > > >>>> be "automatically" registered (I need to add some permissions and > do > > > other > > > >>>> one-off stuff) when they come back from LinkedIn. > > > > > >>>> The problem is that registration doesn't take place at all and I > can't > > > >>>> figure out how to get th
[web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
thanks M. I'm confused though as I can see 'user' here: In gluon/tools.py line 1471 the statement hard-codes 'user' (web2py 1.87.3) next = self.url('user',args='login',vars=dict(_next=next)) Have I misunderstood this line of code? On Oct 16, 4:51 am, mdipierro wrote: > On a second look... 'user' only appears in auth.settings. therefore > you can change them. > > On Oct 15, 9:51 pm, mdipierro wrote: > > > > > > > > > I did not realize that... can change it but for now it is indeed a > > problem. One solution would be to extend Auth and override url() > > > On Oct 15, 9:07 pm, Carl wrote: > > > > One small problem I'm coming across... > > > > I'm using OAuth to login via LinkedIn for a subset of my users. > > > > In gluon/tools.py line 1471 the statement hard-codes 'user' (web2py > > > 1.87.3) > > > next = self.url('user',args='login',vars=dict(_next=next)) > > > > Is there something I should have done to avoid this route through the > > > code? > > > I'm currently using it to pass a "return url" to LinkedIn and I'd like a > > > different url besides /user/ > > > > On 16 October 2010 01:01, Carl Roach wrote: > > > > > Thanks M > > > > I'll base my agent user type on your approach > > > > Thanks again for taking the time > > > > > On 16 Oct 2010, at 00:48, mdipierro wrote: > > > > > > This is what I normally do: > > > > > > 1) I use LinkedIN with RPX (but should be same with OAuth) > > > > > 2) my auth_user table is populated automatically when users login via > > > > > RPX > > > > > 3) my auth_user table as a field "registered' invisible and defaults > > > > > to false > > > > > 4) my model has this code > > > > > > if auth.user and request.function!='user' and not > > > > > auth.user.registered: > > > > > redirect(URL('default','user/profile')) > > > > > > 5) this forces users to complete a registration process. > > > > > 6) my auth_user table also a boolean manager field that defaults to > > > > > false. > > > > > 7) I use appadmin to promote users to managers > > > > > > On Oct 15, 6:40 pm, Carl Roach wrote: > > > > >> I've got authentication working with LinkedIn. But no registration > > > > >> step > > > > happens... I would like to add a set of permissions the first time a new > > > > user logins in via LinkedIn. > > > > > >> For a second type of user I offer a registration page to get > > > > email/password and then add a different set of permissions. > > > > > >> So the piece I'm missing is: how do I fire off a registration step > > > > >> for > > > > my "LinkedIn" users? > > > > > >> On 16 Oct 2010, at 00:19, Radomirs Cirskis > > > > >> wrote: > > > > > >>> Hi Carl! > > > > > >>> you can implement two registration similar to the technique Massimo > > > > >>> advised the authentication. > > > > >>> You could look into CAS. Not 100% sure, but it could be solution for > > > > >>> your case. I could be mistaken. Can you elaborate further on what > > > > >>> you > > > > >>> are trying to achieve? > > > > >>> rad > > > > > >>> On Oct 16, 10:00 am, Carl wrote: > > > > >>>> thanks M. > > > > > >>>> adding to def candidate() > > > > >>>> auth.auth_user = 'candidate' > > > > >>>> has that side sorted. > > > > > >>>> for my function agent() the process is a little more complicated. > > > > >>>> While Candidates have to "formally" register first and then login > > > > agents can > > > > >>>> be "automatically" registered (I need to add some permissions and > > > > >>>> do > > > > other > > > > >>>> one-off stuff) when they come back from LinkedIn. > > > > > >>>> The problem is that registration doesn't take place at all and I > > > > >>>> can't > > &g
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
thanks for the pointer Radomirs. the slice has the registering step disabled rpxAuth.rpx_disabled = ['register','retrieve_password', 'reset_password','change_password','profile'] but doesn't say how to skip registering by the user *and* still perform some register actions in the code. The above snippet prevents the user from registering. But how to have one's code, for example, set some permissions or set-up the account is some other way. On 16 October 2010 04:48, Radomirs Cirskis wrote: > RPX (LinkedId) + web2py Auth module > this could help: http://www.web2pyslices.com/main/slices/take_slice/28 > > Cheers, > rad > > On Oct 16, 12:40 pm, Carl Roach wrote: > > I've got authentication working with LinkedIn. But no registration step > happens... I would like to add a set of permissions the first time a new > user logins in via LinkedIn. > > > > For a second type of user I offer a registration page to get > email/password and then add a different set of permissions. > > > > So the piece I'm missing is: how do I fire off a registration step for my > "LinkedIn" users? > > > > On 16 Oct 2010, at 00:19, Radomirs Cirskis wrote: > > > > > > > > > Hi Carl! > > > > > you can implement two registration similar to the technique Massimo > > > advised the authentication. > > > You could look into CAS. Not 100% sure, but it could be solution for > > > your case. I could be mistaken. Can you elaborate further on what you > > > are trying to achieve? > > > rad > > > > > On Oct 16, 10:00 am, Carl wrote: > > >> thanks M. > > > > >> adding to def candidate() > > >> auth.auth_user = 'candidate' > > >> has that side sorted. > > > > >> for my function agent() the process is a little more complicated. > > >> While Candidates have to "formally" register first and then login > agents can > > >> be "automatically" registered (I need to add some permissions and do > other > > >> one-off stuff) when they come back from LinkedIn. > > > > >> The problem is that registration doesn't take place at all and I can't > > >> figure out how to get this one-off registration phase called. can you > point > > >> me in the right direction? > > > > >> On 15 October 2010 19:22, Carl wrote: > > > > >>> I'm glad I don't need two user tables. I ideally would want to stick > to a > > >>> single table. > > > > >>> On 15 October 2010 19:14, mdipierro wrote: > > > > >>>> Not necessarily and I would not do it that way but you can. > > > > >>>> On Oct 15, 1:12 pm, Carl wrote: > > >>>>> thanks M. > > > > >>>>> Do I understand that your solution is to have two separate user > tables > > >>>> in > > >>>>> db.py? > > > > >>>>> On 15 October 2010 18:42, mdipierro > wrote: > > > > >>>>>> look into default. You can replace > > > > >>>>>> def user(): return dict(form=auth()) > > > > >>>>>> with > > > > >>>>>> def agent(): return dict(form=auth()) > > >>>>>> def candidate(): return dict(form=auth()) > > > > >>>>>> and in the two functions you can set different default for > auth_user > > >>>>>> fields. > > > > >>>>>> On Oct 15, 8:45 am, Carl wrote: > > >>>>>>> Is there a way to use [app]/default/agent instead of > > >>>> app/default/user? > > > > >>>>>>> I want to have two implementations of authentication (/agent and > / > > >>>>>>> candidate) >
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
good question! if the account is authenticated using linkedin then I want to set-up the account a specific way. if the account is registered/logged-in the 'usual way' then I want to set-up the account in a specific but different way. I take your point with respect to "trust". I've missed a night's sleep so will think on that some more. But now I need to go out :) On 16 October 2010 05:50, mdipierro wrote: > I guess what I do not understand is the following. > > You authenticate somebody using linked (or other method), yet how do > you decide how to setup is account? You cannot decide from the url! No > because it would not be safe since the user decides the url. > > massimo > > On Oct 15, 10:59 pm, Carl wrote: > > thanks for the pointer Radomirs. > > the slice has the registering step disabled > > > > rpxAuth.rpx_disabled = ['register','retrieve_password', > > 'reset_password','change_password','profile'] > > > > but doesn't say how to skip registering by the user *and* still perform > some > > register actions in the code. The above snippet prevents the user from > > registering. But how to have one's code, for example, set some > permissions > > or set-up the account is some other way. > > > > On 16 October 2010 04:48, Radomirs Cirskis wrote: > > > > > RPX (LinkedId) + web2py Auth module > > > this could help:http://www.web2pyslices.com/main/slices/take_slice/28 > > > > > Cheers, > > > rad > > > > > On Oct 16, 12:40 pm, Carl Roach wrote: > > > > I've got authentication working with LinkedIn. But no registration > step > > > happens... I would like to add a set of permissions the first time a > new > > > user logins in via LinkedIn. > > > > > > For a second type of user I offer a registration page to get > > > email/password and then add a different set of permissions. > > > > > > So the piece I'm missing is: how do I fire off a registration step > for my > > > "LinkedIn" users? > > > > > > On 16 Oct 2010, at 00:19, Radomirs Cirskis > wrote: > > > > > > > Hi Carl! > > > > > > > you can implement two registration similar to the technique Massimo > > > > > advised the authentication. > > > > > You could look into CAS. Not 100% sure, but it could be solution > for > > > > > your case. I could be mistaken. Can you elaborate further on what > you > > > > > are trying to achieve? > > > > > rad > > > > > > > On Oct 16, 10:00 am, Carl wrote: > > > > >> thanks M. > > > > > > >> adding to def candidate() > > > > >> auth.auth_user = 'candidate' > > > > >> has that side sorted. > > > > > > >> for my function agent() the process is a little more complicated. > > > > >> While Candidates have to "formally" register first and then login > > > agents can > > > > >> be "automatically" registered (I need to add some permissions and > do > > > other > > > > >> one-off stuff) when they come back from LinkedIn. > > > > > > >> The problem is that registration doesn't take place at all and I > can't > > > > >> figure out how to get this one-off registration phase called. can > you > > > point > > > > >> me in the right direction? > > > > > > >> On 15 October 2010 19:22, Carl wrote: > > > > > > >>> I'm glad I don't need two user tables. I ideally would want to > stick > > > to a > > > > >>> single table. > > > > > > >>> On 15 October 2010 19:14, mdipierro > wrote: > > > > > > >>>> Not necessarily and I would not do it that way but you can. > > > > > > >>>> On Oct 15, 1:12 pm, Carl wrote: > > > > >>>>> thanks M. > > > > > > >>>>> Do I understand that your solution is to have two separate user > > > tables > > > > >>>> in > > > > >>>>> db.py? > > > > > > >>>>> On 15 October 2010 18:42, mdipierro > > > wrote: > > > > > > >>>>>> look into default. You can replace > > > > > > >>>>>> def user(): return dict(form=auth()) > > > > > > >>>>>> with > > > > > > >>>>>> def agent(): return dict(form=auth()) > > > > >>>>>> def candidate(): return dict(form=auth()) > > > > > > >>>>>> and in the two functions you can set different default for > > > auth_user > > > > >>>>>> fields. > > > > > > >>>>>> On Oct 15, 8:45 am, Carl wrote: > > > > >>>>>>> Is there a way to use [app]/default/agent instead of > > > > >>>> app/default/user? > > > > > > >>>>>>> I want to have two implementations of authentication (/agent > and > > > / > > > > >>>>>>> candidate) > > > > >
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
one thought: for one set of users I'll have been given an email address and password and for the other set I'll have a LinkedIn user key On 16 October 2010 06:06, Carl wrote: > good question! > > if the account is authenticated using linkedin then I want to set-up the > account a specific way. > > if the account is registered/logged-in the 'usual way' then I want to > set-up the account in a specific but different way. > > I take your point with respect to "trust". I've missed a night's sleep so > will think on that some more. But now I need to go out :) > > > On 16 October 2010 05:50, mdipierro wrote: > >> I guess what I do not understand is the following. >> >> You authenticate somebody using linked (or other method), yet how do >> you decide how to setup is account? You cannot decide from the url! No >> because it would not be safe since the user decides the url. >> >> massimo >> >> On Oct 15, 10:59 pm, Carl wrote: >> > thanks for the pointer Radomirs. >> > the slice has the registering step disabled >> > >> > rpxAuth.rpx_disabled = ['register','retrieve_password', >> > 'reset_password','change_password','profile'] >> > >> > but doesn't say how to skip registering by the user *and* still perform >> some >> > register actions in the code. The above snippet prevents the user from >> > registering. But how to have one's code, for example, set some >> permissions >> > or set-up the account is some other way. >> > >> > On 16 October 2010 04:48, Radomirs Cirskis wrote: >> > >> > > RPX (LinkedId) + web2py Auth module >> > > this could help:http://www.web2pyslices.com/main/slices/take_slice/28 >> > >> > > Cheers, >> > > rad >> > >> > > On Oct 16, 12:40 pm, Carl Roach wrote: >> > > > I've got authentication working with LinkedIn. But no registration >> step >> > > happens... I would like to add a set of permissions the first time a >> new >> > > user logins in via LinkedIn. >> > >> > > > For a second type of user I offer a registration page to get >> > > email/password and then add a different set of permissions. >> > >> > > > So the piece I'm missing is: how do I fire off a registration step >> for my >> > > "LinkedIn" users? >> > >> > > > On 16 Oct 2010, at 00:19, Radomirs Cirskis >> wrote: >> > >> > > > > Hi Carl! >> > >> > > > > you can implement two registration similar to the technique >> Massimo >> > > > > advised the authentication. >> > > > > You could look into CAS. Not 100% sure, but it could be solution >> for >> > > > > your case. I could be mistaken. Can you elaborate further on what >> you >> > > > > are trying to achieve? >> > > > > rad >> > >> > > > > On Oct 16, 10:00 am, Carl wrote: >> > > > >> thanks M. >> > >> > > > >> adding to def candidate() >> > > > >> auth.auth_user = 'candidate' >> > > > >> has that side sorted. >> > >> > > > >> for my function agent() the process is a little more complicated. >> > > > >> While Candidates have to "formally" register first and then login >> > > agents can >> > > > >> be "automatically" registered (I need to add some permissions and >> do >> > > other >> > > > >> one-off stuff) when they come back from LinkedIn. >> > >> > > > >> The problem is that registration doesn't take place at all and I >> can't >> > > > >> figure out how to get this one-off registration phase called. can >> you >> > > point >> > > > >> me in the right direction? >> > >> > > > >> On 15 October 2010 19:22, Carl wrote: >> > >> > > > >>> I'm glad I don't need two user tables. I ideally would want to >> stick >> > > to a >> > > > >>> single table. >> > >> > > > >>> On 15 October 2010 19:14, mdipierro >> wrote: >> > >> > > > >>>> Not necessarily and I would not do it that way but you can. >> > >> > > > >>>> On Oct 15, 1:12 pm, Carl wrote: >> > > > >>>>> thanks M. >> > >> > > > >>>>> Do I understand that your solution is to have two separate >> user >> > > tables >> > > > >>>> in >> > > > >>>>> db.py? >> > >> > > > >>>>> On 15 October 2010 18:42, mdipierro >> > > wrote: >> > >> > > > >>>>>> look into default. You can replace >> > >> > > > >>>>>> def user(): return dict(form=auth()) >> > >> > > > >>>>>> with >> > >> > > > >>>>>> def agent(): return dict(form=auth()) >> > > > >>>>>> def candidate(): return dict(form=auth()) >> > >> > > > >>>>>> and in the two functions you can set different default for >> > > auth_user >> > > > >>>>>> fields. >> > >> > > > >>>>>> On Oct 15, 8:45 am, Carl wrote: >> > > > >>>>>>> Is there a way to use [app]/default/agent instead of >> > > > >>>> app/default/user? >> > >> > > > >>>>>>> I want to have two implementations of authentication (/agent >> and >> > > / >> > > > >>>>>>> candidate) >> > >> > >> > >
[web2py] Re: Vote for a new logo
How about Web heart Py with a '2' within the heart symbol On Oct 13, 10:17 pm, Bruno Rocha wrote: > Martin Mulone made the logovote application. > > I am hosting at my server > > You can post logo ideas, and vote for you prefered logo. > > Better if you made an transparent canvas .gif or .png maximum 250x70 > > Maximum of 10 uploads per user, Just one vote per user. > > Take a look:http://blouweb.com/logovote/
[web2py] What am I missing when trying to update table_user_name?
I am trying to add a registration step when users login using OAuth (LinkedIn in my example). a) am I taking a good approach? b) why am I getting an exception when I try to write to my user table? >From db.py: auth.settings.table_user = db.define_table( auth.settings.table_user_name, db.Field('email', 'string', length=254, unique=True, notnull=True, required=True, requires = [IS_LOWER(), IS_EMAIL(), IS_NOT_IN_DB(db,'%s.email'%auth.settings.table_user_name)]), db.Field('password', 'password', length=512, readable=False, label='Password', requires = [CRYPT(key='***')]), db.Field('registration_id', length=512, writable=False, readable=False, default=''), db.Field('registration_key', length=512, writable=False, readable=False, default=''), db.Field('first_name', 'string', length=128), db.Field('last_name', 'string', length=128)) The rest is in default.py: def user: auth.settings.login_next = URL(r=request,f='registerLinkedInAgent') auth.settings.login_form=LinkedInAccount(globals(),CLIENT_ID,CLIENT_SECRET, AUTH_URL, TOKEN_URL, ACCESS_TOKEN_URL) return dict(form=auth()) I won't include LinkedInAccount() here but the issue I have is in registerAgent(form) def registerLinkedInAgent(): if auth.user.registration_key and len(auth.user.registration_key): auth.add_membership(auth.id_group( 'agent'), auth.user.id) # here I do my once-on-registration calls do_registration_stuff() # find current user's record and update registration key to an empty string so this code isn't called again users = db(db.auth_user.id==auth.user.id).select(db.auth_user.ALL) if users and len(users): users[0].update_record({'registration_key''}) redirect(URL('account')) The problem is I get "ValueError: need more than 1 value to unpack" . Full trackback is below: Traceback (most recent call last): File "E:\projects\workspace\TestEnvoy\web2py\gluon\restricted.py", line 188, in restricted exec ccode in environment File "E:/projects/workspace/TestEnvoy/web2py/applications/init/ controllers/default.py", line 1528, in File "E:\projects\workspace\TestEnvoy\web2py\gluon\globals.py", line 96, in self._caller = lambda f: f() File "E:/projects/workspace/TestEnvoy/web2py/applications/init/ controllers/default.py", line 1132, in registerLinkedInAgent users[0].update_record({'registration_key' : ''}) File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line 3381, in colset.update_record = lambda _ = (colset, table, id), **a: update_record(_, a) File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line 3508, in update_record (colset, table, id) = pack ValueError: need more than 1 value to unpack If anyone needs greater explanation please complain and I'll add more! :)
[web2py] Re: What am I missing when trying to update table_user_name?
2nd thoughts, here's the missing function in db.py One can't get an email back from LinkedIn so I set the email field to the user's LinkedIn id it also returns to set the registration_key so that my registration key can fire off (and clear this field once completed) - it is in the function registerLinkedInAgent() that it fails to clear this field. from gluon.contrib.login_methods.oauth10a_account import OAuthAccount class LinkedInAccount(OAuthAccount): def get_user(self): import oauth2 as oauth if self.accessToken() is None: return None else: client = oauth.Client(self.consumer, self.accessToken()) resp, content = client.request('https://api.linkedin.com/ v1/people/~:(id,first-name,last-name)') if resp['status'] != '200': return None # TODO: check status; cannot get user info from gluon.contrib.login_methods.linkedin import Profile p = Profile() profile = p.create(content) # email must be unique return dict(first_name=profile.first_name, last_name=profile.last_name, registration_id=profile.id, registration_key=profile.id, email=profile.id) On Oct 28, 4:25 pm, Carl wrote: > I am trying to add a registration step when users login using OAuth > (LinkedIn in my example). > > a) am I taking a good approach? > b) why am I getting an exception when I try to write to my user table? > > From db.py: > auth.settings.table_user = db.define_table( > auth.settings.table_user_name, > db.Field('email', 'string', length=254, unique=True, notnull=True, > required=True, > requires = [IS_LOWER(), > IS_EMAIL(), > > IS_NOT_IN_DB(db,'%s.email'%auth.settings.table_user_name)]), > db.Field('password', 'password', length=512, readable=False, > label='Password', > requires = [CRYPT(key='***')]), > db.Field('registration_id', length=512, writable=False, > readable=False, default=''), > db.Field('registration_key', length=512, writable=False, > readable=False, default=''), > db.Field('first_name', 'string', length=128), > db.Field('last_name', 'string', length=128)) > > The rest is in default.py: > > def user: > auth.settings.login_next = > URL(r=request,f='registerLinkedInAgent') > > auth.settings.login_form=LinkedInAccount(globals(),CLIENT_ID,CLIENT_SECRET, > AUTH_URL, TOKEN_URL, ACCESS_TOKEN_URL) > return dict(form=auth()) > > I won't include LinkedInAccount() here but the issue I have is in > registerAgent(form) > > def registerLinkedInAgent(): > if auth.user.registration_key and len(auth.user.registration_key): > auth.add_membership(auth.id_group( 'agent'), auth.user.id) > > # here I do my once-on-registration calls > do_registration_stuff() > > # find current user's record and update registration key to an > empty string so this code isn't called again > users = > db(db.auth_user.id==auth.user.id).select(db.auth_user.ALL) > if users and len(users): > users[0].update_record({'registration_key''}) > redirect(URL('account')) > > The problem is I get "ValueError: need more than 1 value to unpack" . > Full trackback is below: > > Traceback (most recent call last): > File "E:\projects\workspace\TestEnvoy\web2py\gluon\restricted.py", > line 188, in restricted > exec ccode in environment > File "E:/projects/workspace/TestEnvoy/web2py/applications/init/ > controllers/default.py", line 1528, in > File "E:\projects\workspace\TestEnvoy\web2py\gluon\globals.py", line > 96, in > self._caller = lambda f: f() > File "E:/projects/workspace/TestEnvoy/web2py/applications/init/ > controllers/default.py", line 1132, in registerLinkedInAgent > users[0].update_record({'registration_key' : ''}) > File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line > 3381, in > colset.update_record = lambda _ = (colset, table, id), **a: > update_record(_, a) > File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line > 3508, in update_record > (colset, table, id) = pack > ValueError: need more than 1 value to unpack > > If anyone needs greater explanation please complain and I'll add > more! :)
[web2py] update_record() failing on user record
When I try and do an update_record() I get an exception. Is there something wrong with my table definition? Can anyone help? >From db.py: auth.settings.table_user = db.define_table( auth.settings.table_user_name, db.Field('email', 'string', length=254, unique=True, notnull=True, required=True, requires = [IS_LOWER(), IS_EMAIL(), IS_NOT_IN_DB(db,'%s.email'%auth.settings.table_user_name)]), db.Field('password', 'password', length=512, readable=False, label='Password', requires = [CRYPT(key='***')]), db.Field('registration_id', length=512, writable=False, readable=False, default=''), db.Field('registration_key', length=512, writable=False, readable=False, default=''), db.Field('first_name', 'string', length=128), db.Field('last_name', 'string', length=128)) The rest is in default.py: registerAgent(form) def registerLinkedInAgent(): if auth.user.registration_key and len(auth.user.registration_key): # one-off calls auth.add_membership(auth.id_group( 'agent'), auth.user.id) # find current user's record and update registration key to an empty string so this code isn't called again users = db(db.auth_user.id==auth.user.id).select(db.auth_user.ALL) if users and len(users): users[0].update_record({'registration_key''}) redirect(URL('account')) The problem is I get "ValueError: need more than 1 value to unpack" when I call update_record() Full trackback is below: Traceback (most recent call last): File "E:\projects\workspace\TestEnvoy\web2py\gluon\restricted.py", line 188, in restricted exec ccode in environment File "E:/projects/workspace/TestEnvoy/web2py/applications/init/ controllers/default.py", line 1528, in File "E:\projects\workspace\TestEnvoy\web2py\gluon\globals.py", line 96, in self._caller = lambda f: f() File "E:/projects/workspace/TestEnvoy/web2py/applications/init/ controllers/default.py", line 1132, in registerLinkedInAgent users[0].update_record({'registration_key' : ''}) File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line 3381, in colset.update_record = lambda _ = (colset, table, id), **a: update_record(_, a) File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line 3508, in update_record (colset, table, id) = pack ValueError: need more than 1 value to unpack
Re: [web2py] Re: update_record() failing on user record
thank you for responding. my error is editing the code in the posting (which I tell myself I should never do!) I actually have: users[0].update_record({'registration_key'' : ''}) but even that is crazy talk and you are right, the following is correct... users[0].update_record(registration_key='') thanks for your help. I just couldn't see the problem for want of staring. On 29 October 2010 17:20, villas wrote: > This doesn't look very well formed: > users[0].update_record({'registration_key''}) > > See the manual example... > > >>>rows=db(db.person.id>2).select() > >>>row=rows[0] > >>>row.update_record(name='Curt') > > http://www.web2py.com/book/default/chapter/06?search=update_record > > -D > > > On Oct 29, 3:32 pm, Carl wrote: > > When I try and do an update_record() I get an exception. > > Is there something wrong with my table definition? > > Can anyone help? > > > > From db.py: > > auth.settings.table_user = db.define_table( > > auth.settings.table_user_name, > > db.Field('email', 'string', length=254, unique=True, notnull=True, > > required=True, requires = [IS_LOWER(), IS_EMAIL(), > > IS_NOT_IN_DB(db,'%s.email'%auth.settings.table_user_name)]), > > db.Field('password', 'password', length=512, readable=False, > > label='Password', requires = [CRYPT(key='***')]), > > db.Field('registration_id', length=512, writable=False, > > readable=False, default=''), > > db.Field('registration_key', length=512, writable=False, > > readable=False, default=''), > > db.Field('first_name', 'string', length=128), > > db.Field('last_name', 'string', length=128)) > > > > The rest is in default.py: > > registerAgent(form) > > def registerLinkedInAgent(): > > if auth.user.registration_key and > > len(auth.user.registration_key): > > # one-off calls > > auth.add_membership(auth.id_group( 'agent'), auth.user.id) > > > > # find current user's record and update registration key to an > > empty string so this code isn't called again > > users = > > db(db.auth_user.id==auth.user.id).select(db.auth_user.ALL) > > if users and len(users): > > users[0].update_record({'registration_key''}) > > redirect(URL('account')) > > > > The problem is I get "ValueError: need more than 1 value to unpack" > > when I call update_record() > > Full trackback is below: > > Traceback (most recent call last): > > File "E:\projects\workspace\TestEnvoy\web2py\gluon\restricted.py", > > line 188, in restricted > > exec ccode in environment > > File "E:/projects/workspace/TestEnvoy/web2py/applications/init/ > > controllers/default.py", line 1528, in > > File "E:\projects\workspace\TestEnvoy\web2py\gluon\globals.py", line > > 96, in > > self._caller = lambda f: f() > > File "E:/projects/workspace/TestEnvoy/web2py/applications/init/ > > controllers/default.py", line 1132, in registerLinkedInAgent > > users[0].update_record({'registration_key' : ''}) > > File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line > > 3381, in > > colset.update_record = lambda _ = (colset, table, id), **a: > > update_record(_, a) > > File "E:\projects\workspace\TestEnvoy\web2py\gluon\sql.py", line > > 3508, in update_record > > (colset, table, id) = pack > > ValueError: need more than 1 value to unpack
[web2py] rallying developers who are combining Web2py and the Pyjamas compiler
hi all, I've set-up a group on LinkedIn to publicize that developers are combining Web2py with the Pyjamas compiler*. If you are using both, please consider joining Web2Pyjamas at linkedin.com/groups?gid=3634078 This can, I hope, act as a beacon for developers who have found one side of the equation and are looking for the other. * Pyjamas (pyjs.org) compiles Python code into JavaScript and can be easily communicate back and forth to Web2Py server code using jsonrpc. A short example app can get one started: web2py.com/book/default/ chapter/09 If we can prove a large enough groundswell of use we could then consider a Google Groups discussion group. C
[web2py:23843] Controlling lazy T
I am using web2py on GAE. I am sending emails using GAE. I'd delimited the subject line with T ( ... ) and, you guessed it, GAE didn't like it at all. How can I have the subject string translated *before* the call to GAE's platform? example code: bSuccess = mail.send(to=to,subject=T('Lazy subjects'),message=message) Carl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:23882] Re: Controlling lazy T
subject=str(T('Lazy subjects')) did it. what's useful is that I can use subject=str(T(subject)) and bury this statement inside my email() wrapper so that different calling code can use (or not use) T appropriately. This was an awkward gotcha for me. Any place that this could be documented? Happy to add it if you point in the right direction. C On Jun 10, 10:50 pm, mdipierro wrote: > If you run the code locally (whithout GAE) and click on [admin]/ > [Languages]/[update languages] the string "Lazy subjects" will be > added to the the language files. > > The problem may be that you need: > > subject=str(T('Lazy subjects')) > > Massimo > > On Jun 10, 3:27 pm, Carl wrote: > > > > > I am using web2py on GAE. > > > I am sending emails using GAE. I'd delimited the subject line with T > > ( ... ) and, you guessed it, GAE didn't like it at all. > > > How can I have the subject string translated *before* the call to > > GAE's platform? > > > example code: > > > bSuccess = mail.send(to=to,subject=T('Lazy subjects'),message=message) > > > Carl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:24375] http_origin equivalent outside of forms
I'm building URLs for emails. One email is fired out in response to the user submitting a form. url = '%s%s' % (request.env.http_origin,URL (r=request,c='default',f='confirmgreet', args=base64.b16encode (address))) However, I also need to build an URL when a form is not submitted. In this case, no request.env.http_origin is defined How can I find out what the http://site/ path is so that my code can run regardless of deployment (local or GAE). thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:24414] Re: http_origin equivalent outside of forms
thanks. for the record; locally on a Win XP box and deployed to GAE the following works: 'http://%s%s' % (request.env.http_host, URL(r=request,c='c', f='f')) [odd behaviour from Google Groups - I couldn't find this thread in search results and had to retrieve from browser history] On Jun 17, 6:25 pm, mdipierro wrote: > This is not possible in general because web2py may be behind a proxy. > > You can make a guess: > > '%s://%s:%s % (request.env.request_methd, request.env.http_host, > request.env.server_port) > > and it is not guaranteed that the server defines these variables > either. > > massimo > > On Jun 17, 12:04 pm, Carl wrote: > > > > > I'm building URLs for emails. > > > One email is fired out in response to the user submitting a form. > > > url = '%s%s' % (request.env.http_origin,URL > > (r=request,c='default',f='confirmgreet', args=base64.b16encode > > (address))) > > > However, I also need to build an URL when a form is not submitted. > > In this case, no request.env.http_origin is defined > > > How can I find out what thehttp://site/pathis so that my code can > > run regardless of deployment (local or GAE). > > > thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:24877] Web2Py Profiling documentation
hi Is there a section covering profiling Web2Py projects? I'm using GAE and found this from google which are generic instructions for any Python code: http://code.google.com/appengine/kb/commontasks.html#profiling [this requires me to modify the framework file gaehandler.py] I wondered if there was anything formalised for Web2Py? Back in Feb, there was a thread discussing code changes http://groups.google.com/group/web2py/browse_thread/thread/8e38fc1c177d5640/61239b9260d9a8e1?lnk=gst&q=cprofile#61239b9260d9a8e1 but I can't find anything more structured (I'm probably not looking in the right place!) thanks Carl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:24891] Re: Web2Py Profiling documentation
thanks. I saw -F PROFILER_FILENAME in the documentation and noted that it didn't work on GAE (because -F is file based) For GAE, Google recommend (and provide) an alternative main() function. http://code.google.com/appengine/kb/commontasks.html#profiling Using this and running on GAE produces curious output. GAE logs displays (in red) 1400cpu_ms & 129api_ms indicating that my page is too heavy. And yet the 'GAE' profiler quotes 19500 function calls in 0.245 CPU seconds (the page doesn't do much so perhaps .245 is too heavy!) Running locally, using -F, the same page records 9500 function calls taking .207 CPU seconds. So that's 10K fewer function calls between local and GAE. On Jun 24, 2:05 pm, mdipierro wrote: > try web2py.py -h > there is a profiling flag but does not work on GAE > > On Jun 24, 4:03 am, Carl wrote: > > > > > hi > > > Is there a section covering profiling Web2Py projects? > > > I'm using GAE and found this from google which are generic > > instructions for any Python > > code:http://code.google.com/appengine/kb/commontasks.html#profiling > > [this requires me to modify the framework file gaehandler.py] > > > I wondered if there was anything formalised for Web2Py? > > > Back in Feb, there was a thread discussing code > > changeshttp://groups.google.com/group/web2py/browse_thread/thread/8e38fc1c17... > > but I can't find anything more structured (I'm probably not looking in > > the right place!) > > > thanks > > > Carl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:25019] Re: web2py 1.63.4 is OUT
hi M, where can I find release notes for each release? Carl On Jun 4, 2:56 pm, mdipierro wrote: > Fixed anouther python 2.4 compatibility issue, thanks Mariano. > > Massimo > > On Jun 4, 8:32 am, Hans > wrote: > > > > > I just downloaded 1.63.5 from web2py.com and could not findrelease/ > > changenotesfor this version in the README file or here. Maybe it > > should be version 1.63.4 ? > > > Keep up the great work! > > > Hans > > > On 4 Jun., 06:03, mdipierro wrote: > > > > I just posted 1.63.4 because I patch in 1.63.3 had broken Python 2.4 > > > and it was an urgent matter. > > > I think the problem is now fixed. > > > > Changelog: > > > - fixed python 2.4 > > > - fixed problem with strange char encoding of absolute paths in sqlite > > > on windows. Thanks Iceberg. > > > > Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:25480] Adding extensions to markdown2
hi, Is there a document/guideline detailing how one can extend markdown2? I want to add my own handlers (line handling and perhaps block handling) thanks Carl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27494] How to add newly registered users to Groups
hi, I have created MyAuth(Auth) I have override the method register() with if self.environment.response.mode == 'buyer': onaccept = registerBuyer return super(EnvoyAuth, self).register(next, onvalidation, onaccept, log) when users have been successfully register, my own registerBuyer is called. def registerBuyer(form): from registerBuyer I can access form.vars.id I want to call: group_id = auth.add_group( 'buyer', 'main group') auth.add_membership(group_id, form.vars.id) Two questions: 1. is this the right approach to implement several different registration forms (one for each type of user). User will be able to register for multiple services but I don't want them all to have to fill in all the user fields (I need more info from buyers than from general users for example). 2. if my approach is fine then how do I access the auth instance that was set-up in db.py with auth=EnvoyAuth(globals(),db) thanks Carl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27510] Re: How to add newly registered users to Groups
hi Fran thanks! For now your first solution is fab (& simple to boot). [and yes I mean EnvoyAuth not MyAuth - a typo in my post] C On Jul 28, 5:36 pm, Fran wrote: > On Jul 28, 1:43 pm, Carl wrote: > > > I have created MyAuth(Auth) > > You mean EnvoyAuth(Auth) ? > > > > > > > I have override the method register() with > > if self.environment.response.mode == 'buyer': > > onaccept = registerBuyer > > return super(EnvoyAuth, self).register(next, onvalidation, onaccept, > > log) > > when users have been successfully register, my own registerBuyer is > > called. > > def registerBuyer(form): > > from registerBuyer I can access form.vars.id > > I want to call: > > group_id = auth.add_group( 'buyer', 'main group') > > auth.add_membership(group_id, form.vars.id) > > Two questions: > > 1. is this the right approach to implement several different > > registration forms (one for each type of user). User will be able to > > register for multiple services but I don't want them all to have to > > fill in all the user fields (I need more info from buyers than from > > general users for example). > > If just needing to change the onaccept then you can do this in the > Controller - no need to extend register(): > if mode == 'buyer': > auth.settings.register_onaccept = lambda form: registerBuyer(form) > > > 2. if my approach is fine then how do I access the auth instance that > > was set-up in db.py with auth=EnvoyAuth(globals(),db) > > All controllers can see this as just 'auth' > Views would need to have auth passed through to them: return dict > (auth=auth) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27549] Auth. Customisation form created by register()
hi, I'm using auth for my authentication. I have two types of users: buyers and students. Each user type fills in a different (overlapping) set of fields when they register. One user type may, at a future point, register as an additional type. Can I use web2py auth to offer differnt registration fields? say for .../user_b/register & .../user_s/register I've looked into tools.py at register() and, given that it calls SQLForm() without giving a "fields=" parameter I'm jumping ahead and thinking that getting my desired behaviour won't be easy. hoping you can help. Carl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27555] Re: Auth. Customisation form created by register()
thanks for the reply Fran; and the suggestions. it feels like I'm fighting against the framework on this one so I'm adopting a JIT philosophy for data collection. I'll collect the very basics on registration and then ask for more when users want the additional services. for the future: being able to set my own form for register() would be real nice. at present I can do that only if I want to pull in a remote authentication system. thanks again. Carl On Jul 29, 6:58 pm, Fran wrote: > On Jul 29, 5:51 pm, Carl wrote: > > > I'm using auth for my authentication. > > I have two types of users: buyers and students. > > Each user type fills in a different (overlapping) set of fields when > > they register. > > One user type may, at a future point, register as an additional type. > > Can I use web2py auth to offer differnt registration fields? > > say for .../user_b/register & .../user_s/register > > I've looked into tools.py at register() and, given that it calls > > SQLForm() without giving a "fields=" parameter I'm jumping ahead and > > thinking that getting my desired behaviour won't be easy. > > It is certainly possible to have 2 different register pages which use > different view templates. > I would add all fields to the auth_user table & then use jQuery > to .hide() rows that are not required for that user type. > You may also want to change the table.field.requires settings within > the different controllers (or else set acceptable dummy values via > table.field.default or even using jQuery) > > F --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27593] Re: Auth. Customisation form created by register()
Fran - thanks. that's great. C On Jul 29, 8:53 pm, Fran wrote: > On Jul 29, 8:13 pm, Carl wrote: > > > for the future: being able to set my own form for register() would be > > real nice. at present I can do that only if I want to pull in a remote > > authentication system. > > You can have extra fields on the register() form very easily - the > form is simply a SQLFORM of the auth_user table...so just create a > custom auth_user table with the fields you want before you call > auth.define_tables() > > You can also make a full custom form in the usual way: > In the view instead of {{=form}} you can do: > {{=form.custom.begin}} > {{=form.custom.widget.first_name}} > etc > {{=form.custom.submit}} > {{=form.custom.end}} > > & surround these elements with whatever HTML you want... > > As long as the mandatory fields are populated then you're good to > go :) > > F --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27604] Re: Auth. Customisation form created by register()
hi Fran, Have looked at {{=form.custom.begin}} and it looks just the ticket. It enables me to have one User table (which I've modified in db.py with additional fields) and then have two views: one for each type of user. I've one last sticking point... Now I'm no longer using {{=form}} I don't get the Password2 field added for free nor its data validation (that password == password2). And the thought occurs that if I wanted to have recaptcha I'd run into similar issues. Do you know if/how I can add password2 handling into my custom form view? (and recaptcha if I wanted that too?) Many thanks for your time Carl On Jul 29, 8:53 pm, Fran wrote: > On Jul 29, 8:13 pm, Carl wrote: > > > for the future: being able to set my own form for register() would be > > real nice. at present I can do that only if I want to pull in a remote > > authentication system. > > You can have extra fields on the register() form very easily - the > form is simply a SQLFORM of the auth_user table...so just create a > custom auth_user table with the fields you want before you call > auth.define_tables() > > You can also make a full custom form in the usual way: > In the view instead of {{=form}} you can do: > {{=form.custom.begin}} > {{=form.custom.widget.first_name}} > etc > {{=form.custom.submit}} > {{=form.custom.end}} > > & surround these elements with whatever HTML you want... > > As long as the mandatory fields are populated then you're good to > go :) > > F --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27702] Re: Auth. Customisation form created by register()
hi Fran, I've figured it out. In my view I've added {{if form.errors and form.errors.password_two:}}Password fields don't match{{pass}} at the end of my "Verify password" td. thanks for your help. Carl On Jul 30, 12:48 pm, Carl wrote: > hi Fran, > > Have looked at {{=form.custom.begin}} and it looks just the ticket. It > enables me to have one User table (which I've modified in db.py with > additional fields) and then have two views: one for each type of user. > > I've one last sticking point... > > Now I'm no longer using {{=form}} I don't get the Password2 field > added for free nor its data validation (that password == password2). > > And the thought occurs that if I wanted to have recaptcha I'd run into > similar issues. > > Do you know if/how I can add password2 handling into my custom form > view? (and recaptcha if I wanted that too?) > > Many thanks for your time > > Carl > > On Jul 29, 8:53 pm, Fran wrote: > > > > > On Jul 29, 8:13 pm, Carl wrote: > > > > for the future: being able to set my own form for register() would be > > > real nice. at present I can do that only if I want to pull in a remote > > > authentication system. > > > You can have extra fields on the register() form very easily - the > > form is simply a SQLFORM of the auth_user table...so just create a > > custom auth_user table with the fields you want before you call > > auth.define_tables() > > > You can also make a full custom form in the usual way: > > In the view instead of {{=form}} you can do: > > {{=form.custom.begin}} > > {{=form.custom.widget.first_name}} > > etc > > {{=form.custom.submit}} > > {{=form.custom.end}} > > > & surround these elements with whatever HTML you want... > > > As long as the mandatory fields are populated then you're good to > > go :) > > > F --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27889] Sharing Auth user table between two registration processes
hi Has anyone had a simlilar requirement and used a different/better approach that that described below? I have 2 registration forms to cover my 2 user groups. Each is prompted to register with a different subset of Auth User fields. I've extended Auth to include the additional fields (e.g., Country, Billing Country). The challenge is that for only one set of users are some fields are Mandatory. To achieve this I did the following: 1. set-up a table called iso3166 to hold a standard set of countries. 2. in my custom autrh user table include this statement: db.Field('country', db.iso3166, requires=IS_NULL_OR(IS_INT_IN_RANGE(0, 1e100) ) ) I set 'requires' here otherwise the framework jumps in at this point and will insist that this field has a validator to check that the field is always set to an integer. My setting enables one of my registration UIs to ignore the field. 3. in my controller... for the form that prompts the user for country: db.auth_user.country.requires = IS_IN_DB(db, db.iso3166.id, '%(country) s', orderby=db.iso3166.country_order) for the form that doesn't prompt for country: db.auth_user.country.requires = IS_NULL_OR(IS_NOT_EMPTY()) So... I'm twisting existing validators to get the behaviour I want. In step #3 "IS_NULL_OR(IS_NOT_EMPTY())" feels hacky but otherwise I'm comfortable enough. Constructive feedback welcomed. Carl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:28159] Re: IS_EMAIL validator problem
This is an excellent article on the traps to beware of when regex'ing email address formats http://www.regular-expressions.info/email.html This may ignite a debate though :) I favour this variation... [a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a- z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz| info|mobi|name|aero|jobs|museum)\b C On Aug 7, 8:25 am, Jonathan Lundell wrote: > On Aug 7, 2009, at 12:22 AM, mdipierro wrote: > > > > > I will take a patch for this. > > If nobody else gets to it first, I'll work up a patch over the weekend. > > > > > > > Massimo > > > On Aug 7, 1:33 am, Jonathan Lundell wrote: > >> On Aug 6, 2009, at 9:32 PM, DenesL wrote: > > >>> IS_EMAIL does not follow the RFC specs for valid email addresses > >>> (seehttp://en.wikipedia.org/wiki/E-mail_address) > > >>> even a simple a...@b.com fails > > >>> it is kinda late to work on the regex now, maybe tomorrow. > > >> The RFC is fairly hard to validate. If that's what we really want, I > >> found this one on the web that looks about right: > > >> ^(?!\.)("([^"\r\\]|\\["\r\\])*"|([-a-z0-9!#$%&'*+/=?^_`{|}~]|(?...@[a- > >> z0-9][\w\.-]*[a-z0-9]\.[a-z][a-z\.]*[a-z]$ > > >> It assumes the case-insensitive flag. > > >>http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an- > >> email... > > >> Overkill? Or, what the heck? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:28161] Re: IS_EMAIL validator problem
You've convinced me that staying close to RFC is a "best choice" even though we lose the opportunity for users to correct addresses at the point of data entry. nb the suggested regex in my last posting doesn't work well enough! e.g., a...@domain.co.uk isn't matched C On Aug 7, 4:48 pm, Jonathan Lundell wrote: > On Aug 7, 2009, at 8:13 AM, Carl wrote: > > > > > This is an excellent article on the traps to beware of when regex'ing > > email address formats > > >http://www.regular-expressions.info/email.html > > > This may ignite a debate though :) > > A discussion, maybe. In the abstract, I like the idea of verifying the > RFC verbatim, but we *should* be clear on what we're trying to do. > Guard against typos? Prevent some kind of attack? How much do we care > about false positives? > > The article objects (to RFC-style checking) that j...@aol.com.nospam, > for example, will validate. I'm not too concerned about that, in that > there are lots of ways that a user can enter a wrong but > (syntactically) valid address. We deal with that through active > validation, not a syntax check. > > Might there be a security concern? The quoted variation of the RFC > checker is very permissive: > > "([^"\r\\]|\\["\r\\])*" > > Could that open the door to some kind of injection attack? Presumably > we sanitize it for display; how about when we actually use it to send > mail? Any consumer that doesn't understand quoted names could end up > very confused. > > I take false positives as a v. bad thing: if a user enters a real and > valid address, I do not want to reject it. So I don't much like the > explicit list of TLDs (below), on the grounds that it's bound to > expand, and at some point it'll break. From the Wikipedia TLD article: > > > During the 32nd International Public ICANN Meeting in Paris in 2008, > > ICANN started a new process of TLD naming policy to take a > > "significant step forward on the introduction of new generic top- > > level domains." This program envisions the availability of many new > > or already proposed domains, as well a new application and > > implementation process. Observers believed that the new rules could > > result in hundreds of new gTLDs to be registered. Proposed TLDs > > include music, berlin and nyc. > > I think I'd favor the RFC-style pattern without the quoted-name > alternation. > > One thing we could do is to give the developer an option: > IS_EMAIL(something or other) that lets them select one of a small > number of regexes. And of course the developer can always use IS_MATCH > if they don't like our choice of email filters. > > If we permitted a choice, I'd suggest: > > 1. default to the RFC regex, but without quoted names > 2. RFC including quoted names > 3. something like the pattern below, including the TLD filter (maybe) > > > > > > > I favour this variation... > > [a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a- > > z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz| > > info|mobi|name|aero|jobs|museum)\b > > > C > > > On Aug 7, 8:25 am, Jonathan Lundell wrote: > >> On Aug 7, 2009, at 12:22 AM, mdipierro wrote: > > >>> I will take a patch for this. > > >> If nobody else gets to it first, I'll work up a patch over the > >> weekend. > > >>> Massimo > > >>> On Aug 7, 1:33 am, Jonathan Lundell wrote: > >>>> On Aug 6, 2009, at 9:32 PM, DenesL wrote: > > >>>>> IS_EMAIL does not follow the RFC specs for valid email addresses > >>>>> (seehttp://en.wikipedia.org/wiki/E-mail_address) > > >>>>> even a simple a...@b.com fails > > >>>>> it is kinda late to work on the regex now, maybe tomorrow. > > >>>> The RFC is fairly hard to validate. If that's what we really > >>>> want, I > >>>> found this one on the web that looks about right: > > >>>> ^(?!\.)("([^"\r\\]|\\["\r\\])*"|([-a-z0-9!#$%&'*+/=?^_`{|}~]|(?...@[a- > >>>> z0-9][\w\.-]*[a-z0-9]\.[a-z][a-z\.]*[a-z]$ > > >>>> It assumes the case-insensitive flag. > > >>>>http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an- > >>>> email... > > >>>> Overkill? Or, what the heck? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:28679] Re: logo
What does each logo look like on a dark/black background? A On Aug 13, 5:29 pm, Massimo Di Pierro wrote: > Two logos have been proposed for web2py. I love them both and I would > like your opinions. Here they are attached. > > Which one should go on the main web2py page and the book? > > Vote A for the logo with the W and B for the logo with the globe. > > Poll is open for 48 hours starting now. > > Massimo > > logo1.png > 31KViewDownload > > web2py_logo_300.png > 89KViewDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:28680] Re: logo
A handful of points: 1. It would be useful to supply both logos on a black background as well as white. Having a logo that works on a broad range of backgrounds means it can be applied in a broader range of situations. 2. Printing in black and white is becoming rarer but it would be useful to have a design that works well in black and white. Could both logos be displayed transposed to black and white? 3. from web2py.com's home page: "agile development of fast, secure and portable database-driven web-based applications" The name 'web2py' covers the web-based attribute. Neither logo 'invokes agile/fast/secure/portable'. Option A invokes 'group/team/ social' and 'B' invokes a sense of geography/location or comprehensiveness. 4. One interesting test of a logo is to remove any wording and see what remains says about the product/service. C On Aug 13, 5:29 pm, Massimo Di Pierro wrote: > Two logos have been proposed for web2py. I love them both and I would > like your opinions. Here they are attached. > > Which one should go on the main web2py page and the book? > > Vote A for the logo with the W and B for the logo with the globe. > > Poll is open for 48 hours starting now. > > Massimo > > logo1.png > 31KViewDownload > > web2py_logo_300.png > 89KViewDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:28888] web2py, bigtable and the '09 DAL
hi I'm currently building a project with python, web2py & pyjamas; I will be deploying on gae. As you will know gae isn't a relational store but leverages a different design so I want to experiment with two different approaches: a) accessing gae thru web2py (treating gae as a subset of a relational db) and b) accessing bigtable more directly to help my data accesses scale on google's infrastructure. Now core to web2py's philosophy is compatibility for code across a range of data stores. I realise my option b) **may not** be compatible with that goal (perhaps this is where the new DAL comes in?). finally the question: has anyone implemented bigtable directly while still using web2py and if so, how do they do local testing? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:28922] Can I access BigTable api from within Web2py
hi, I want to leverage BigTable within my web2py-based application. To create a local environment that I can test code what would be involved? Would I need to run dev_appserver.py locally and then load the web2py environment 'manually' ? I've looked at Django on gae but it loses some key functionality (such as authentication) is its move to gae; and I can't get Pylons to run locally on dev_appserver.py (it's discussion group suggests that installation instructions are out of date). Has anyone access BigTable directly and been able to test locally within a framework? thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:28927] Re: web2py, bigtable and the '09 DAL
hi Benigno, 'fraid my project is from a clean sheet so I've not investigated how to migrate relational databases. I'm currently looking at http://code.google.com/p/app-engine-patch which leverages Django to access BigTable natively. C On Aug 19, 12:52 pm, Benigno wrote: > Carl, > > Sorry I do not add any answer. I would be delighted to hear more > about the subject, as it is indeed quite important for me too. > > Can you address me to any place to learn more about bigtable?. > Rather, what are best practices and how to "transform" an Rdb > structure into something that works for bigtable. > > Cheers, > Benigno. > > On Aug 18, 1:37 pm, Carl wrote: > > > > > hi > > > I'm currently building a project with python, web2py & pyjamas; I will > > be deploying on gae. > > > As you will know gae isn't a relational store but leverages a > > different design so I want to experiment with two different > > approaches: a) accessing gae thru web2py (treating gae as a subset of > > a relational db) and b) accessing bigtable more directly to help my > > data accesses scale on google's infrastructure. > > > Now core to web2py's philosophy is compatibility for code across a > > range of data stores. I realise my option b) **may not** be compatible > > with that goal (perhaps this is where the new DAL comes in?). > > > finally the question: has anyone implemented bigtable directly while > > still using web2py and if so, how do they do local testing? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:28934] Re: web2py, bigtable and the '09 DAL
Google's own video are a place to start: Wipe your mind of rdbm design, sit back and breath them in... http://www.youtube.com/watch?v=tx5gdoNpcZM http://www.youtube.com/watch?v=rRCx9e38yr8 On Aug 19, 4:28 pm, Benigno wrote: > Hello Carl, > > My question was rather more generic, I mean from an application > design point of view, what things does one need to consider when > creating an app for GAE. I was asking about Rdb, because thats the > only db structure I have been working with all my life so it would > have been more "intuitive" for me to understand the concepts. > > On Aug 19, 2:36 pm, Carl wrote: > > > > > hi Benigno, > > > 'fraid my project is from a clean sheet so I've not investigated how > > to migrate relational databases. > > I'm currently looking athttp://code.google.com/p/app-engine-patch > > which leverages Django to access BigTable natively. > > > C > > > On Aug 19, 12:52 pm, Benigno wrote: > > > > Carl, > > > > Sorry I do not add any answer. I would be delighted to hear more > > > about the subject, as it is indeed quite important for me too. > > > > Can you address me to any place to learn more about bigtable?. > > > Rather, what are best practices and how to "transform" an Rdb > > > structure into something that works for bigtable. > > > > Cheers, > > > Benigno. > > > > On Aug 18, 1:37 pm, Carl wrote: > > > > > hi > > > > > I'm currently building a project with python, web2py & pyjamas; I will > > > > be deploying on gae. > > > > > As you will know gae isn't a relational store but leverages a > > > > different design so I want to experiment with two different > > > > approaches: a) accessing gae thru web2py (treating gae as a subset of > > > > a relational db) and b) accessing bigtable more directly to help my > > > > data accesses scale on google's infrastructure. > > > > > Now core to web2py's philosophy is compatibility for code across a > > > > range of data stores. I realise my option b) **may not** be compatible > > > > with that goal (perhaps this is where the new DAL comes in?). > > > > > finally the question: has anyone implemented bigtable directly while > > > > still using web2py and if so, how do they do local testing? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:28942] Re: web2py, bigtable and the '09 DAL
that sounds excellent Yarko. I'll willing to experiment and report back. have you any idea where I can start? by which I mean: how do I go about experimenting with, say gae's ListProperty from within a Web2py project. If I use dev-appserver I can run BigTable code locally. What's needed to run it locally within a Web2py environment? I need to run/test locally otherwise my development loop is going to be too broad (uploading to google and reading thru its logs to see what caused the errors) C On Aug 19, 5:25 pm, Yarko Tymciurak wrote: > There are 2 things to keep in mind here: > > Specificity (big tables) and abstraction (portability, DAL). > > Right now, the data abstraction layer of web2py (DAL) handles RDBM's rather > close to the RDBM (that is, it is not an object-relational mapper, but a bit > lower level). It also handles those concepts from that abstraction which > map well into big tables. DAL also creates freatures (form generation, auth > tools, etc.) based on DAL information. > > IF you make BT (big table) specific adaptations, you will [1] risk losing > the abstractions and the interface into web2py facilities. But it may be a > useful start. A better start would be to look at what abstractions DAL > employes, what the interfaces to the rest of web2py are, and create an > interface class for "COLUMN ORIENTED STORES" (e.g. start with just big table > if you want). This would be more interesting results than merely "I want > to access all of big tables facilities" - it would reach into how to hook it > into the nature of what web2py does. > > > > On Wed, Aug 19, 2009 at 11:20 AM, dlypka wrote: > > > rdbm is still needed to drive CRUD forns > > > On Aug 19, 11:56 am, Carl wrote: > > > Google's own video are a place to start: > > > > Wipe your mind of rdbm design, sit back and breath them in... > >http://www.youtube.com/watch?v=tx5gdoNpcZMhttp://www.youtube.com/watc... > > > > On Aug 19, 4:28 pm, Benigno wrote: > > > > > Hello Carl, > > > > > My question was rather more generic, I mean from an application > > > > design point of view, what things does one need to consider when > > > > creating an app for GAE. I was asking about Rdb, because thats the > > > > only db structure I have been working with all my life so it would > > > > have been more "intuitive" for me to understand the concepts. > > > > > On Aug 19, 2:36 pm, Carl wrote: > > > > > > hi Benigno, > > > > > > 'fraid my project is from a clean sheet so I've not investigated how > > > > > to migrate relational databases. > > > > > I'm currently looking athttp://code.google.com/p/app-engine-patch > > > > > which leverages Django to access BigTable natively. > > > > > > C > > > > > > On Aug 19, 12:52 pm, Benigno wrote: > > > > > > > Carl, > > > > > > > Sorry I do not add any answer. I would be delighted to hear > > more > > > > > > about the subject, as it is indeed quite important for me too. > > > > > > > Can you address me to any place to learn more about bigtable?. > > > > > > Rather, what are best practices and how to "transform" an Rdb > > > > > > structure into something that works for bigtable. > > > > > > > Cheers, > > > > > > Benigno. > > > > > > > On Aug 18, 1:37 pm, Carl wrote: > > > > > > > > hi > > > > > > > > I'm currently building a project with python, web2py & pyjamas; I > > will > > > > > > > be deploying on gae. > > > > > > > > As you will know gae isn't a relational store but leverages a > > > > > > > different design so I want to experiment with two different > > > > > > > approaches: a) accessing gae thru web2py (treating gae as a > > subset of > > > > > > > a relational db) and b) accessing bigtable more directly to help > > my > > > > > > > data accesses scale on google's infrastructure. > > > > > > > > Now core to web2py's philosophy is compatibility for code across > > a > > > > > > > range of data stores. I realise my option b) **may not** be > > compatible > > > > > > > with that goal (perhaps this is where the new DAL comes in?). > > > > > > > > finally the question: has anyone implemented bigtable directly > > while > > > > > > > still using web2py and if so, how do they do local testing?- Hide > > quoted text - > > > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:28946] Re: web2py, bigtable and the '09 DAL
hi dlypka, that's fantastic! I would love to hear more / see some code examples. GAE datastore Class level is what I had in mind (pardon my shorthand of referring to it as bigtable) C On Aug 19, 6:24 pm, dlypka wrote: > I believe it is possible to have a hybrid model. I have one working > (to some degree). > My approach is not related to the column-oriented aspect. I'm working > at the GAE datastore CLASS level, not BigTable low-level. > So I am pushing ahead with it, and anyone who is interested may > contact me for code. > > On Aug 19, 12:25 pm, Yarko Tymciurak wrote: > > > > > There are 2 things to keep in mind here: > > > Specificity (big tables) and abstraction (portability, DAL). > > > Right now, the data abstraction layer of web2py (DAL) handles RDBM's rather > > close to the RDBM (that is, it is not an object-relational mapper, but a bit > > lower level). It also handles those concepts from that abstraction which > > map well into big tables. DAL also creates freatures (form generation, auth > > tools, etc.) based on DAL information. > > > IF you make BT (big table) specific adaptations, you will [1] risk losing > > the abstractions and the interface into web2py facilities. But it may be a > > useful start. A better start would be to look at what abstractions DAL > > employes, what the interfaces to the rest of web2py are, and create an > > interface class for "COLUMN ORIENTED STORES" (e.g. start with just big table > > if you want). This would be more interesting results than merely "I want > > to access all of big tables facilities" - it would reach into how to hook it > > into the nature of what web2py does. > > > On Wed, Aug 19, 2009 at 11:20 AM, dlypka wrote: > > > > rdbm is still needed to drive CRUD forns > > > > On Aug 19, 11:56 am, Carl wrote: > > > > Google's own video are a place to start: > > > > > Wipe your mind of rdbm design, sit back and breath them in... > > >http://www.youtube.com/watch?v=tx5gdoNpcZMhttp://www.youtube.com/watc... > > > > > On Aug 19, 4:28 pm, Benigno wrote: > > > > > > Hello Carl, > > > > > > My question was rather more generic, I mean from an application > > > > > design point of view, what things does one need to consider when > > > > > creating an app for GAE. I was asking about Rdb, because thats the > > > > > only db structure I have been working with all my life so it would > > > > > have been more "intuitive" for me to understand the concepts. > > > > > > On Aug 19, 2:36 pm, Carl wrote: > > > > > > > hi Benigno, > > > > > > > 'fraid my project is from a clean sheet so I've not investigated how > > > > > > to migrate relational databases. > > > > > > I'm currently looking athttp://code.google.com/p/app-engine-patch > > > > > > which leverages Django to access BigTable natively. > > > > > > > C > > > > > > > On Aug 19, 12:52 pm, Benigno wrote: > > > > > > > > Carl, > > > > > > > > Sorry I do not add any answer. I would be delighted to hear > > > more > > > > > > > about the subject, as it is indeed quite important for me too. > > > > > > > > Can you address me to any place to learn more about > > > > > > > bigtable?. > > > > > > > Rather, what are best practices and how to "transform" an Rdb > > > > > > > structure into something that works for bigtable. > > > > > > > > Cheers, > > > > > > > Benigno. > > > > > > > > On Aug 18, 1:37 pm, Carl wrote: > > > > > > > > > hi > > > > > > > > > I'm currently building a project with python, web2py & pyjamas; > > > > > > > > I > > > will > > > > > > > > be deploying on gae. > > > > > > > > > As you will know gae isn't a relational store but leverages a > > > > > > > > different design so I want to experiment with two different > > > > > > > > approaches: a) accessing gae thru web2py (treating gae as a > > > subset of > > > > > > > > a relational db) and b) accessing bigtable more directly to help > > > my > > > > > > > > data accesses scale on google's infrastructure. > > > > > > > > > Now core to web2py's philosophy is compatibility for code across > > > a > > > > > > > > range of data stores. I realise my option b) **may not** be > > > compatible > > > > > > > > with that goal (perhaps this is where the new DAL comes in?). > > > > > > > > > finally the question: has anyone implemented bigtable directly > > > while > > > > > > > > still using web2py and if so, how do they do local testing?- > > > > > > > > Hide > > > quoted text - > > > > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:28989] upgrading to 1.66.1 chokes on sqlite database
hi, I upgraded from 1.65.5 to 1.66.1 this morning but had the following issue. I'm using WinXP with sqlite. recent call stack (most recent call at bottom)... gluon/main.py line 470 inwsgibase session._unlock(response) gluon/globals.py line 369 in _unlock portalocker.unlock (response.session_file) gluon/portalocker.py line 74 unlock hfile = win32file._get_ofshandle(file.fileno()) ValueError: I/O operation on closed file I didn't try to deploy to gae (my production environment) but a return to 1.65.5 worked just fine. Before I give more details, is this a known issue with the 1.66.1 release? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:29004] Re: upgrading to 1.66.1 chokes on sqlite database
I'm using src. heard about exe but have always run from src so I'm not tied to a particular OS. C On Aug 20, 12:30 pm, Fran wrote: > On Aug 20, 10:24 am, Carl wrote: > > > I upgraded from 1.65.5 to 1.66.1 this morning but had the following > > issue. > > Before I give more details, is this a known issue with the 1.66.1 > > release? > > src or exe version? > > exe version has known issues, src works fine for me... > > F --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:29005] Re: upgrading to 1.66.1 chokes on sqlite database
I'm using src. heard about exe but have always run from src so I'm not tied to a particular OS. Fran - are you using sqlite? C On Aug 20, 12:30 pm, Fran wrote: > On Aug 20, 10:24 am, Carl wrote: > > > I upgraded from 1.65.5 to 1.66.1 this morning but had the following > > issue. > > Before I give more details, is this a known issue with the 1.66.1 > > release? > > src or exe version? > > exe version has known issues, src works fine for me... > > F --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:29024] Re: upgrading to 1.66.1 chokes on sqlite database
yea, I figure that's what I'll have to try. I reckon that must be it. as my project matures I'm trying to avoid that. I have a set of populate() functions to pre-fill the database but there still more dynamic data to create - I guess a set of test code will do that for me too. tried updating to pyjamas 0.6 and that didn't go well either! :) not my day. thanks for the feedback - good to know it's not just me on xp On Aug 20, 4:46 pm, Fran wrote: > On Aug 20, 2:41 pm, Carl wrote: > > > Fran - are you using sqlite? > > Yes: XP, Python 2.5.4 (mostly), Web2Py trunk > No issues for me currently. > > Can you wipe your databases folder & let fresh ones be created? > > F --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:29087] Re: Can I access BigTable api from within Web2py
ha! sometimes web2py is too straightforward! :) and that's not a complaint! have set-up Eclipse to launch a debug session for dev_appserver.py as well as web2py.py thanks for the pointer mdipierro wrote: > On Aug 19, 2:55 am, Carl wrote: > > hi, > > > > I want to leverage BigTable within my web2py-based application. > > > > To create a local environment that I can test code what would be > > involved? > > You can do it. you need to download the google appserver. > > > Would I need to run dev_appserver.py locally and then load the web2py > > environment 'manually' ? > > You just make the dev_appserver point to gaehandler.py > the yaml files are there. > > > I've looked at Django on gae but it loses some key functionality (such > > as authentication) is its move to gae; and I can't get Pylons to run > > locally on dev_appserver.py (it's discussion group suggests that > > installation instructions are out of date). > > > > Has anyone access BigTable directly and been able to test locally > > within a framework? > > > thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:29334] Re: upgrading to 1.66.1 chokes on sqlite database
I've just downloaded 1.66.2 and am getting further. I'm getting this ticket... Traceback (most recent call last): File "G:\My Documents\Carl\projects\TestOrbit\web2py\gluon\main.py", line 412, in wsgibase session._try_store_on_disk(request, response) File "G:\My Documents\Carl\projects\TestOrbit\web2py\gluon \globals.py", line 366, in _try_store_on_disk self._unlock(response) File "G:\My Documents\Carl\projects\TestOrbit\web2py\gluon \globals.py", line 374, in _unlock response.session_file.close() IOError: [Errno 13] Permission denied I think 1.65.5 kicked out a warning to console; 1.66.2 shouts louder. With this short post do you have any initial ideas? (I'm using XP, Sqlite) On Aug 21, 8:51 am, mdipierro wrote: > I will look into this today. > > On Aug 20, 4:24 am, Carl wrote: > > > > > hi, > > > I upgraded from 1.65.5 to 1.66.1 this morning but had the following > > issue. > > > I'm using WinXP with sqlite. > > > recent call stack (most recent call at bottom)... > > > gluon/main.py line 470 inwsgibase session._unlock(response) > > > gluon/globals.py line 369 in _unlock portalocker.unlock > > (response.session_file) > > > gluon/portalocker.py line 74 unlock > > hfile = win32file._get_ofshandle(file.fileno()) > > ValueError: I/O operation on closed file > > > I didn't try to deploy to gae (my production environment) but a return > > to 1.65.5 worked just fine. > > > Before I give more details, is this a known issue with the 1.66.1 > > release? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:29342] Re: upgrading to 1.66.1 chokes on sqlite database
thanks! On 25/08/2009, mdipierro wrote: > > > Yes. That issues was fixed in 1.66.2 > > On Aug 20, 4:24 am, Carl wrote: > > hi, > > > > I upgraded from 1.65.5 to 1.66.1 this morning but had the following > > issue. > > > > I'm using WinXP with sqlite. > > > > recent call stack (most recent call at bottom)... > > > > gluon/main.py line 470 inwsgibase session._unlock(response) > > > > gluon/globals.py line 369 in _unlock portalocker.unlock > > (response.session_file) > > > > gluon/portalocker.py line 74 unlock > > hfile = win32file._get_ofshandle(file.fileno()) > > ValueError: I/O operation on closed file > > > > I didn't try to deploy to gae (my production environment) but a return > > to 1.65.5 worked just fine. > > > > Before I give more details, is this a known issue with the 1.66.1 > > release? > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---