[web2py] Recommended Payment Gateway (besides PayPal)
I am looking for recommendations for payment gateways.I already know about PayPal, and Authorize.NET. The former seems expensive, and has not been well-supported in my country in the past, and the latter is plagued with horror stories from disgruntled customers.
[web2py] Suggestion for the Web2py book regarding importing and exporting data
In reading the chapter on CSV and Remote Database Syncronization in the web2py book, specifically in these sections: 2. Create a controller action to export the database: 3. Create a controller action to import a saved copy of the other database and sync records Would it be advisable to mention that these controller actions would best be placed within the appadmin as opposed to the app in general? This way, a casual user would not be able to export the data.
[web2py] Is there a way to remove application name from URL()?
I'm using a routing file which makes my app load by default on localhost. It works well, but everywhere I have used the URL() function it prepends the application name to the URL. This of course no longer works, because my real URLs no longer need the name. So is there any configuration that will tell URL() not to add app name automatically? In case of need, here's my routes.py: --- default_application = myapp routes_in = ( ('/static/$anything', '/myapp/static/$anything'), ('/appadmin/$anything', '/myapp/appadmin/$anything'), ('/favicon.ico', '/myapp/static/favicon.ico'), ('/robots.txt', '/myapp/static/robots.txt'), ('/(?Pany.*)', '/myapp/\gany'), ) routes_out = [(x, y) for (y, x) in routes_in[:-2]]
[web2py] Table of Contents for plugin_wiki pages
Something that might interest plugin_wiki users, is the possibility to automatically generate tables of contents from a page based on headings and specially tagged divs. just put this on the page.html view of the plugin: {{extend 'layout.html'}} {{if page:}} {{if page.slug.startswith('meta-'):}}{{=CODE(page.body)}}{{else:}} {{import re}}{{from BeautifulSoup import BeautifulSoup}} {{content=plugin_wiki.render(page.body)}} {{soup = BeautifulSoup(str(content))}} {{toc = [(tag.name,tag.text) for tag in soup.findAll(name=re.compile(rh[1-3]))]}}{{pass}} now you have a list with a pair telling you the level of heading and its content so you can do things like this: div id=toc ul {{sublevel=0}}{{for index,(level,text) in enumerate(toc):}}{{if int(toc[index-1][0][1]) int(level[1]):}}{{sublevel+=1}} ul{{elif int(toc[index-1][0][1]) int(level[1]) and sublevel 0:}} {{sublevel-=1}}/ul{{pass}} li{{=text}}/li{{pass}}{{while sublevel 0:}}{{sublevel -=1}}/ ul{{pass}} /ul /div {{=content}} This can easily be adapted to more generic situations. All you need is the html content of the page in a variable so that you can parse it for headings. You can adjust the depth of headings to be displayed by changing the regular expression h[1-3] to h[1-6] if you want 6... Next step: add anchors in headings so that we can link the table of contents into it. Best regards
Re: [web2py] Suggestion for the Web2py book regarding importing and exporting data
Appadmin already has the ability to expoert and import CSV-files. So no need putting them there. In one of my application users has the right to export data as CSV and even import it back. They don´t get all data, only data that belongs to the user. Kenneth In reading the chapter on CSV and Remote Database Syncronization in the web2py book, specifically in these sections: 2. Create a controller action to export the database: 3. Create a controller action to import a saved copy of the other database and sync records Would it be advisable to mention that these controller actions would best be placed within the appadmin as opposed to the app in general? This way, a casual user would not be able to export the data.
[web2py] Timing issue in web2py
There appears to be a bug during startup. C:\Temp\web2pyweb2py.exe web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2011 Version 1.91.6 (2011-01-03 17:55:14) Database drivers available: SQLite3, pymysql Starting hardcron... Fatal Python error: PyEval_RestoreThread: NULL tstate This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. If I run the same command again, everything works fine. C:\Temp\web2pyweb2py.exe web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2011 Version 1.91.6 (2011-01-03 17:55:14) Database drivers available: SQLite3, pymysql Starting hardcron... please visit: http://127.0.0.1:8000 starting browser... C:\Temp\web2pyweb2py.exe web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2011 Version 1.91.6 (2011-01-03 17:55:14) Database drivers available: SQLite3, pymysql Starting hardcron... Fatal Python error: PyEval_RestoreThread: NULL tstate This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. C:\Temp\web2pyweb2py.exe web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2011 Version 1.91.6 (2011-01-03 17:55:14) Database drivers available: SQLite3, pymysql Starting hardcron... please visit: http://127.0.0.1:8000 starting browser... and how everything works. It may related to this post: http://osdir.com/ml/python.matplotlib.general/2004-12/msg00130.html --Ondrej
[web2py] request.vars question
In the shell this works: In [7]: print db._lastsql -- print(db._lastsql) SELECT count(*) FROM artikel WHERE (artikel.id 0) In [8]: query = db.artikel.id 0 In [9]: l = db(query).count() In [10]: print db._lastsql --- print(db._lastsql) SELECT count(*) FROM artikel WHERE (artikel.id 0) However when I use it in a controller like this: query = db.artikel.id 0 total_found = db(query).count() redirect(URL('list_records', vars = dict( table = db.artikel, query = query, total_found = total_found , flds = () ))) Then I found in 'list_records' that the request vars look like this: Storage {'query': '(artikel.id 0)', 'table': 'artikel'} So what happened to total_found and flds? Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and excellence. 2 Pet. 1:2b,3a
[web2py] Reunião Coding Dojo
Olá pessoal, Para todos ficarem cientes, nessa semana eu vou me reunir como coordenador da UNIP para acertamos o local e a data do evento. Att, _ *Gilson Filho* *Desenvolvedor Web Blog:* blog.gilsondev.com *Twitter:* twitter.com/gilsonfilho
[web2py] Re: Reunião Coding Dojo
On Jan 17, 2:50 pm, contatogilson...@gmail.com contatogilson...@gmail.com wrote: Para todos ficarem cientes, nessa semana eu vou me reunir como coordenador da UNIP para acertamos o local e a data do evento. O que é UNIP, e que evento é tudo isso? Além disso, esta lista tem membros falando principalmente Inglês, embora esta google-translate post pode contornar a barreira da língua um pouco.
[web2py] web2py social network designer/architect
Hi, I am developing a social network with web2py. I will be using freelancer to do the work for me. However I lack an overall design for the social network. Can you help us with the overal design and architecture ? If you can recommend someone that will be good too. Thanks Dennis Yar Baby Carrot skype yardennis1 email yarden...@gmail.com
[web2py] TAG and xml
I am trying to relaunch a question implicit in one of my previous posts. As I said TAG with its xml() serializer fails in generating valid xml when both name and value are unicode strings with non ascii chars (in my test it succeeds when either name or value is unicode string with non ascii chars). Reading the code I was not able to figure out what is the real problem with this issue: I would ask some more involved web2py developers to point this out and highlight which would be the issues in tackling with this limitation. Thank you
Re: [web2py] web2py social network designer/architect
This is a social network built with web2py - http://tymr.com/ Bruno Rocha http://about.me/rochacbruno/bio 2011/1/17 yarden...@gmail.com yarden...@gmail.com Hi, I am developing a social network with web2py. I will be using freelancer to do the work for me. However I lack an overall design for the social network. Can you help us with the overal design and architecture ? If you can recommend someone that will be good too. Thanks Dennis Yar Baby Carrot skype yardennis1 email yarden...@gmail.com
[web2py] Problem with one-to-many field
Hi guys, I just started working with web2py and I like it a lot. I have a little problem with the following tables: The firma field in the second table is shown as a text field where I can only enter the ids and not as a select field. I admit that I might have saved the db.py with firma field as a string first but now the migration does not seem to take place. I have other foreign key fields that are working fine but this one is giving me troubles. Did I do something wrong here? If you need more info please let me know. Keep up the good work! Radu db.define_table('firma', Field('nume', required=True, unique=True), format='%(nume)s' ) db.define_table('angajat', Field('firma', db.firma, requires=[IS_IN_DB(db, 'firma.id', '%(nume)s')]), Field('nume', required=True), Field('prenume', required=True), Field('norma', 'integer', required=True, requires=[IS_INT_IN_RANGE(1,10)]), Field('activ', 'boolean', default=True), format='%(nume)s %(prenume)s' )
Re: [web2py] Re: sqlform.factory, inserting variable number of records in an other table
Thanks Mart... I read back my mail and my english was terrible. ;-) I thought about it after sent the mail and I realise that subform seems what I was searching for. I will try what you propose and give feedback here. Richard On Sun, Jan 16, 2011 at 10:43 PM, mart msenecal...@gmail.com wrote: You know, I discovered a week or 2 ago a way to make a form appear to have sub-forms (or sub-templates). Massimo's 'Audit Trail' (i think I saw it on web2pyslices) serves this purpose extremely well. To that, it becomes very easy to write scripts to generate all sorts of combinations of tables that exist to those that can be generated dynamically. Anyways, from the Audit trail idea, I made a requests app, that serves many different categories and types of requests, where forms can be created/generated on the fly. If I were doing something like you described, I would probably try something like this test_1=db.Table(None,'test_1', Field('results','??') Field('whomadethetest','string'), Field('date','date')) test_2=db.Table(None,'test_2', Field('results','??') Field('whomadethetest','string'), Field('date','date')) then you could do this (or have scripts generate it): db.define_table('result', Field('length','integer'), Field('width','integer'), Field('result','integer'), test_1) or db.define_table('result', Field('length','integer'), Field('width','integer'), Field('result','integer'), test_1, test2) or just the test results: db.define_table('result',test_1,test2) etc... Hope it helps, Mart :) On Jan 16, 4:38 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello, Let me expose my problem. I have a test (experience test that I made in lab) that I have to redo many time. At time point 1 there is only one result, but at the other time point the is one more result to store each time. So at time point 2 there is two results, at time point 3 there is 3 results and so on. Since the number of time point is not fixed I can create a given number of columns to handle this probleme in a not normalized way. Say fill with null the empty columns when the results are not available for a particular record (or a given time point). To normalize the schema I can do : db.define_table('result', Field('length','integer'), Field('width','integer'), Field('result','integer')) db.define_table('test1', Field('results','list:integer result') Field('whomadethetest','string'), Field('date','date')) db.test1.results.requires = IS_IN_DB(db,'result.id',db. result._format,multiple=True) I could add my result one by one in the result table and then pick them up... But I would do something sexier then that. I would like to be able to add any number of record by adding the row of result table in the same form of test1 table. So my model should be : db.define_table('test1', Field('results','??') Field('whomadethetest','string'), Field('date','date')) db.define_table('result', Field('length','integer'), Field('width','integer'), Field('result','integer'), Field('test1_id','db.test1') I have now a 1:n relation that is stored in result table. I would build a widget that let insert all the fields of an other table row by row. So if I have one result generated at time point 1 there will be one row in my form. But if I am a later time point there will have 2 rows for time point 2 and 3 for time point 3, etc. It could has a button to add more empty row that could be filled out. I read an search a lot. I found web2py_component that could be of some utility, but I am not sure since it seams to work with form in a global manner and not support field. SQLFORM.factory look the way to go before build the whole thing from scratch with form... If any of you have a android phone, I would make a form that looks and works like the contact app. You can add any number of phone number for the same contact by pressing + button to add an other empty box (field). Do I must made a custom widget (widget seams to be reserved to a single form processing), build custom form with helpers, or could SQLFORM.factory is enough??? Thanks Richard
[web2py] TAG name and XML: maybe a solution?
As in my previous post, TAG with its xml serializer fails when both tag Name and Contents are unicode strings with non ascii chars. What about this trivial solution in html.py? def xml(self): generates the xml for this component. (fa, co) = self._xml() if not self.tag: return co if self.tag[-1:] == '/': # tag [attributes] / #should encode this as well return '%s%s /' % (self.tag[:-1], fa) # else: tag [attributes] inner components xml /tag #explicitly encoding self.tag return '%s%s%s/%s' % ((self.tag).encode('utf-8'), fa, co, (self.tag).encode('utf-8')) In my test code this is ok but I do not know if it breaks something else. Another thing I noticed is that even HTML attributes like u'some_non_ascii_chars' breaks _validate()..but this is a story much more complex than the TAG problem.
[web2py] Change upload behaviour: standard filename
I'd like to change the default behaviour for one app, concerning my uploads. Web2py normally rename the uploaded file, but in my particular case, web2py doesn't need to change my filename. Is something possible, while creating my model? Next to that i also like to store a hash of a file in my database. With the standard crud i can't change this behaviour. I also can't find such a functionality right now in web2py/crud, or did i miss something?
Re: [web2py] request.vars question
On Jan 17, 2011, at 4:43 AM, Johann Spies wrote: In the shell this works: In [7]: print db._lastsql -- print(db._lastsql) SELECT count(*) FROM artikel WHERE (artikel.id 0) In [8]: query = db.artikel.id 0 In [9]: l = db(query).count() In [10]: print db._lastsql --- print(db._lastsql) SELECT count(*) FROM artikel WHERE (artikel.id 0) However when I use it in a controller like this: query = db.artikel.id 0 total_found = db(query).count() redirect(URL('list_records', vars = dict( table = db.artikel, query = query, total_found = total_found , flds = () ))) Then I found in 'list_records' that the request vars look like this: Storage {'query': '(artikel.id 0)', 'table': 'artikel'} So what happened to total_found and flds? You might try putting this just before the redirect: session.flash = URL('list_records', vars=... (same as above)) ...and see what that shows you. That is, see what URL is generating before it goes through the redirection. Something to consider (not necessarily having to do with the disappearing items) is that the encoding of a URL query string is strictly a string encoding; there's no preservation of Python objects. So for example flds is going to come back (if it comes back) as the string '()', not as an empty tuple. You can get it back with eval(), of course, but that opens a pretty big security hole.
Re: [web2py] TAG name and XML: maybe a solution?
On Jan 17, 2011, at 7:39 AM, carlo wrote: As in my previous post, TAG with its xml serializer fails when both tag Name and Contents are unicode strings with non ascii chars. What about this trivial solution in html.py? Makes sense to me, but I have to admit that I get a little confused by the mix of Python's handling of encodings and the logic of TAG. It does seem reasonable that we'd default to utf8. def xml(self): generates the xml for this component. (fa, co) = self._xml() if not self.tag: return co if self.tag[-1:] == '/': # tag [attributes] / #should encode this as well return '%s%s /' % (self.tag[:-1], fa) # else: tag [attributes] inner components xml /tag #explicitly encoding self.tag return '%s%s%s/%s' % ((self.tag).encode('utf-8'), fa, co, (self.tag).encode('utf-8')) In my test code this is ok but I do not know if it breaks something else. Another thing I noticed is that even HTML attributes like u'some_non_ascii_chars' breaks _validate()..but this is a story much more complex than the TAG problem.
[web2py] Re: upload widgets problem with nullable compound validators
IS_NULL_OR([IS_XXX(..), IS_YYY(..), ..]) in trunk now. Good suggestion although I think an internal refactoring is in order. On Jan 16, 10:57 pm, kenji4569 hos...@s-cubism.jp wrote: I ended up with making a custom validator IS_ALL for the problem: IS_NULL_OR(IS_ALL([IS_XXX(..), IS_YYY(..), ..]) and it works. The alternatives could be to permit the follwoing interfaces, which need patches though: IS_NULL_OR([IS_XXX(..), IS_YYY(..), ..]) or [IS_NULL_OR(IS_XXX(..)), IS_NULL_OR(IS_YYY(..)), ..] (the first one) What do you think? Thanks in advance, Kenji On 1月12日, 午後10:57, Massimo Di Pierro massimo.dipie...@gmail.com wrote: good catch. Let me think about this... On Jan 12, 1:12 am, kenji4569 hos...@s-cubism.jp wrote: I applied the follwing validators for upload fields in version 1.91.6: requires = [ IS_NULL_OR(IS_UPLOAD_FILENAME(extension='pdf')), IS_NULL_OR(IS_LENGTH(1048576, 1024)), ] Everything was fine until I used a SQLFORM object with an upload keyword for editing. Then, a delete checkbox of an upload widget falsely disappeared which should be displayed with a link to the uploaded file. This is the result of the code in UploadWidget class of gluon/ sqlhtml.py: if requires == [] or isinstance(requires, IS_EMPTY_OR): inp = DIV(, ..., UploadWidget.ID_DELETE_SUFFIX), ...) And, the next patch would tentatively fix the problem: if (requires == [] or isinstance(requires, IS_EMPTY_OR) or (isinstance(requires, (list, tuple)) and reduce(lambda a,b:ab, [isinstance(r, IS_EMPTY_OR) for r in requires]))): ... But, I am not sure if the above patch is smart. Is there any way to implement such validation without patches nor custom validators?
[web2py] Re: Recommended Payment Gateway (besides PayPal)
http://web2py.appspot.com/plugin_checkout/default/checkout On Jan 17, 2:34 am, cjrh caleb.hatti...@gmail.com wrote: I am looking for recommendations for payment gateways. I already know about PayPal, and Authorize.NET. The former seems expensive, and has not been well-supported in my country in the past, and the latter is plagued with horror stories from disgruntled customers.
[web2py] Re: Table of Contents for plugin_wiki pages
http://code.google.com/p/samaxesjs/wiki/TableOfContentsPlugin On Jan 17, 5:31 am, blackthorne francisco@gmail.com wrote: Something that might interest plugin_wiki users, is the possibility to automatically generate tables of contents from a page based on headings and specially tagged divs. just put this on the page.html view of the plugin: {{extend 'layout.html'}} {{if page:}} {{if page.slug.startswith('meta-'):}}{{=CODE(page.body)}}{{else:}} {{import re}}{{from BeautifulSoup import BeautifulSoup}} {{content=plugin_wiki.render(page.body)}} {{soup = BeautifulSoup(str(content))}} {{toc = [(tag.name,tag.text) for tag in soup.findAll(name=re.compile(rh[1-3]))]}}{{pass}} now you have a list with a pair telling you the level of heading and its content so you can do things like this: div id=toc ul {{sublevel=0}}{{for index,(level,text) in enumerate(toc):}}{{if int(toc[index-1][0][1]) int(level[1]):}}{{sublevel+=1}} ul{{elif int(toc[index-1][0][1]) int(level[1]) and sublevel 0:}} {{sublevel-=1}}/ul{{pass}} li{{=text}}/li{{pass}}{{while sublevel 0:}}{{sublevel -=1}}/ ul{{pass}} /ul /div {{=content}} This can easily be adapted to more generic situations. All you need is the html content of the page in a variable so that you can parse it for headings. You can adjust the depth of headings to be displayed by changing the regular expression h[1-3] to h[1-6] if you want 6... Next step: add anchors in headings so that we can link the table of contents into it. Best regards
[web2py] Re: Timing issue in web2py
Could please open an issue on googlecode about this. Thanks Ondrej On Jan 17, 6:21 am, ondrejs ondrej.s...@gmail.com wrote: There appears to be a bug during startup. C:\Temp\web2pyweb2py.exe web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2011 Version 1.91.6 (2011-01-03 17:55:14) Database drivers available: SQLite3, pymysql Starting hardcron... Fatal Python error: PyEval_RestoreThread: NULL tstate This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. If I run the same command again, everything works fine. C:\Temp\web2pyweb2py.exe web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2011 Version 1.91.6 (2011-01-03 17:55:14) Database drivers available: SQLite3, pymysql Starting hardcron... please visit: http://127.0.0.1:8000 starting browser... C:\Temp\web2pyweb2py.exe web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2011 Version 1.91.6 (2011-01-03 17:55:14) Database drivers available: SQLite3, pymysql Starting hardcron... Fatal Python error: PyEval_RestoreThread: NULL tstate This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. C:\Temp\web2pyweb2py.exe web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2011 Version 1.91.6 (2011-01-03 17:55:14) Database drivers available: SQLite3, pymysql Starting hardcron... please visit: http://127.0.0.1:8000 starting browser... and how everything works. It may related to this post: http://osdir.com/ml/python.matplotlib.general/2004-12/msg00130.html --Ondrej
[web2py] Re: web2py social network designer/architect
Hey! This should be on web2py.com/poweredby On Jan 17, 7:32 am, Bruno Rocha rochacbr...@gmail.com wrote: This is a social network built with web2py -http://tymr.com/ Bruno Rochahttp://about.me/rochacbruno/bio 2011/1/17 yarden...@gmail.com yarden...@gmail.com Hi, I am developing a social network with web2py. I will be using freelancer to do the work for me. However I lack an overall design for the social network. Can you help us with the overal design and architecture ? If you can recommend someone that will be good too. Thanks Dennis Yar Baby Carrot skype yardennis1 email yarden...@gmail.com
[web2py] Re: Problem with one-to-many field
Replace Field('firma', db.firma, requires=[IS_IN_DB(db, 'firma.id', '% (nume)s')]), with Field('firma', db.firma, requires=IS_IN_DB(db, 'firma.id', '% (nume)s')), or even better Field('firma', db.firma), the validator is automatic for reference fields. Field('firma', db.firma, requires=[IS_IN_DB(db, 'firma.id', '%(nume)s')]), On Jan 17, 5:11 am, rif feric...@gmail.com wrote: Hi guys, I just started working with web2py and I like it a lot. I have a little problem with the following tables: The firma field in the second table is shown as a text field where I can only enter the ids and not as a select field. I admit that I might have saved the db.py with firma field as a string first but now the migration does not seem to take place. I have other foreign key fields that are working fine but this one is giving me troubles. Did I do something wrong here? If you need more info please let me know. Keep up the good work! Radu db.define_table('firma', Field('nume', required=True, unique=True), format='%(nume)s' ) db.define_table('angajat', Field('firma', db.firma, requires=[IS_IN_DB(db, 'firma.id', '%(nume)s')]), Field('nume', required=True), Field('prenume', required=True), Field('norma', 'integer', required=True, requires=[IS_INT_IN_RANGE(1,10)]), Field('activ', 'boolean', default=True), format='%(nume)s %(prenume)s' )
Re: [web2py] Re: Testing the new router
On Jan 16, 2011, at 5:44 PM, Matt wrote: Hi Jonathan, Thanks for your quick response. Yes the application is 'app'. Sure, that would be great. I've been looking at this, and a couple of things aren't making sense to me. Your configuration sounds fine, at least what I see of it. I've been testing it like this: routers = dict( BASE = dict( default_application = 'app', ), app = dict( controllers = ['default', 'error', 'appadmin'], ), ) routes_onerror = [(r'*/*', r'/error')] ...because I don't have an application installed named 'app'; this tells the router logic to pretend there's such an app, with the indicated controllers (if the controller list is different, please let me know, but it shouldn't much affect things). You wrote that this works: http://localhost:8000/css/base.css ...but it really shouldn't, since there's no way for the router to recognize the URL as a static file. I'd expect it to be rewritten as: http://localhost:8000/app/css/base.css ...that is, treating 'css' as a controller. I would expect this to work: http://localhost:8000/static/css/base.css So I'm wondering first if you're running the current trunk (last few days, anyway). If not, the 'routers=' entry will be ignored. Second, it would be helpful to turn on router logging. To do so, copy logging.example.conf to logging.conf, and then edit the rewrite logger and console handler to log debug messages: [logger_rewrite] level=DEBUG qualname=web2py.rewrite handlers=consoleHandler propagate=0 ... [handler_consoleHandler] class=StreamHandler level=DEBUG formatter=simpleFormatter args=(sys.stdout,) (If you're not able to log to the console, you'll have to do more configuration work to log elsewhere.) Another thing to try, and I recommend this for anyone doing routing, is to customize the doctest in routes.py for your own routing policy. Try replacing the existing doctest with this (if this doesn't work, please send me your routes.py privately and I'll edit it myself and send it back). You run the doctest at the cli: python routes.py import os import gluon.main from gluon.rewrite import load, filter_url, filter_err, get_effective_router, try_redirect_on_error load(routes=os.path.basename(__file__)) filter_url('http://localhost:8000/css/base.css', router='app') 'app' os.path.relpath(filter_url('http://domain.com/favicon.ico')) 'applications/app/static/favicon.ico' filter_url('http://domain.com/abc') '/app/default/abc' filter_url('http://localhost:8000/css/base.css') /app/default/css ['base.css'] os.path.relpath(filter_url('http://domain.com/static/css/base.css')) 'applications/app/static/css/base.css' from gluon.http import HTTP from gluon.storage import Storage http = HTTP(400, 'original http message', Location='some/location') request = Storage() request.env = Storage() request.application = 'app' request.env.request_uri = 'request_uri' request.url = 'request.url' http = try_redirect_on_error(http, request) (http.status, http.body, http.headers.get('Location')) (303, 'You are being redirected a href=/error?code=400ticket=Nonerequested_uri=request_urirequest_url=request.urlhere/a', '/error?code=400ticket=Nonerequested_uri=request_urirequest_url=request.url') filter_url('https://domain.com/app/ctr/fcn', out=True) '/ctr/fcn' filter_url('https://domain.com/welcome/ctr/fcn', out=True) '/welcome/ctr/fcn' filter_url('https://domain.com/app/default/fcn', out=True) '/fcn' filter_url('https://domain.com/app/default/index', out=True) '/' filter_url('https://domain.com/app/appadmin/index', out=True) '/appadmin' filter_url('http://domain.com/app/default/fcn?query', out=True) '/fcn?query' filter_url('http://domain.com/app/default/fcn#anchor', out=True) '/fcn#anchor' filter_url('http://domain.com/app/default/fcn?query#anchor', out=True) '/fcn?query#anchor' filter_err(200) 200 filter_err(399) 399 filter_err(404) '/error?code=404ticket=tkt' Cheers, Matt On Jan 17, 2:19 pm, Jonathan Lundell jlund...@pobox.com wrote: Thanks for the report, Matt. On Jan 16, 2011, at 5:11 PM, Matt wrote: Hi Jonathan, I'm also trying to use the new routing approach and I'm having a little trouble with static files. In my app's static directory I have sub folders (containing files) like this: /static/css/base.css /static/images/logo.png /static/js/jquery.js I'm using the most minimal routing: routers = dict( BASE = dict( default_application = 'app', ), ) routes_onerror = [(r'*/*', r'/error')] Now when I try and request certain files I seem to get very unexpected results When I try: http://localhost:8000/css/base.css it works. OK, I wouldn't expect that to
[web2py] Re: web2py social network designer/architect
On Monday, January 17, 2011 11:27:49 AM UTC-5, Massimo Di Pierro wrote: Hey! This should be on web2py.com/poweredby Yes, already added it a few days ago: http://web2py.com/poweredby/default/site_read/89
[web2py] Re: web2py social network designer/architect
Thank you all for the inclusion. I haven't made any promotion here, because tymr.com is a one man project for now, and i'm not yet fully satisfied with the result. I'm looking for some angel ou vc investment but the economy is not very good in Portugal at the moment. On Jan 17, 4:58 pm, Anthony abasta...@gmail.com wrote: On Monday, January 17, 2011 11:27:49 AM UTC-5, Massimo Di Pierro wrote: Hey! This should be on web2py.com/poweredby Yes, already added it a few days ago:http://web2py.com/poweredby/default/site_read/89
Re: [web2py] Re: Testing the new router
return LOAD('plugin_comments','comments.load',args=[tablename, record_id, page],ajax=True) File /home/martin/Repositorios/google_appengine/web2py/gluon/compileapp.py, line 145, in __call__ extension=extension) File /home/martin/Repositorios/google_appengine/web2py/gluon/html.py, line 262, in URL acf = rewrite.map_url_out(application, controller, function, args, r or _request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 867, in map_url_out map = MapUrlOut(application, controller, function, args, request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 722, in __init__ self.domain_application = self.request.env.domain_application AttributeError: 'NoneType' object has no attribute 'env' I start to test, but I have this error In GAE 2011/1/17 Jonathan Lundell jlund...@pobox.com On Jan 16, 2011, at 5:44 PM, Matt wrote: Hi Jonathan, Thanks for your quick response. Yes the application is 'app'. Sure, that would be great. I've been looking at this, and a couple of things aren't making sense to me. Your configuration sounds fine, at least what I see of it. I've been testing it like this: routers = dict( BASE = dict( default_application = 'app', ), app = dict( controllers = ['default', 'error', 'appadmin'], ), ) routes_onerror = [(r'*/*', r'/error')] ...because I don't have an application installed named 'app'; this tells the router logic to pretend there's such an app, with the indicated controllers (if the controller list is different, please let me know, but it shouldn't much affect things). You wrote that this works: http://localhost:8000/css/base.css ...but it really shouldn't, since there's no way for the router to recognize the URL as a static file. I'd expect it to be rewritten as: http://localhost:8000/app/css/base.css ...that is, treating 'css' as a controller. I would expect this to work: http://localhost:8000/static/css/base.css So I'm wondering first if you're running the current trunk (last few days, anyway). If not, the 'routers=' entry will be ignored. Second, it would be helpful to turn on router logging. To do so, copy logging.example.conf to logging.conf, and then edit the rewrite logger and console handler to log debug messages: [logger_rewrite] level=DEBUG qualname=web2py.rewrite handlers=consoleHandler propagate=0 ... [handler_consoleHandler] class=StreamHandler level=DEBUG formatter=simpleFormatter args=(sys.stdout,) (If you're not able to log to the console, you'll have to do more configuration work to log elsewhere.) Another thing to try, and I recommend this for anyone doing routing, is to customize the doctest in routes.py for your own routing policy. Try replacing the existing doctest with this (if this doesn't work, please send me your routes.py privately and I'll edit it myself and send it back). You run the doctest at the cli: python routes.py import os import gluon.main from gluon.rewrite import load, filter_url, filter_err, get_effective_router, try_redirect_on_error load(routes=os.path.basename(__file__)) filter_url('http://localhost:8000/css/base.css', router='app') 'app' os.path.relpath(filter_url('http://domain.com/favicon.ico')) 'applications/app/static/favicon.ico' filter_url('http://domain.com/abc') '/app/default/abc' filter_url('http://localhost:8000/css/base.css') /app/default/css ['base.css'] os.path.relpath(filter_url('http://domain.com/static/css/base.css' )) 'applications/app/static/css/base.css' from gluon.http import HTTP from gluon.storage import Storage http = HTTP(400, 'original http message', Location='some/location') request = Storage() request.env = Storage() request.application = 'app' request.env.request_uri = 'request_uri' request.url = 'request.url' http = try_redirect_on_error(http, request) (http.status, http.body, http.headers.get('Location')) (303, 'You are being redirected a href=/error?code=400ticket=Nonerequested_uri=request_urirequest_url=request.urlhere/a', '/error?code=400ticket=Nonerequested_uri=request_urirequest_url=request.url') filter_url('https://domain.com/app/ctr/fcn', out=True) '/ctr/fcn' filter_url('https://domain.com/welcome/ctr/fcn', out=True) '/welcome/ctr/fcn' filter_url('https://domain.com/app/default/fcn', out=True) '/fcn' filter_url('https://domain.com/app/default/index', out=True) '/' filter_url('https://domain.com/app/appadmin/index', out=True) '/appadmin' filter_url('http://domain.com/app/default/fcn?query', out=True) '/fcn?query' filter_url('http://domain.com/app/default/fcn#anchor', out=True) '/fcn#anchor' filter_url('http://domain.com/app/default/fcn?query#anchor', out=True) '/fcn?query#anchor'
[web2py] regarding social networking...
Hi, This seems to be a popular subject lately, including places that are closer to home... My 8 year old desperately wants to join in the fun, but daddy (me) can't think of anything else to say but go clean your room or go bug your sisters or something... we'll talk when you're 40 ! ;) . But, kids are resourceful, and will figure out a way to quench their thirst to fit in... The reasons for not letting her in are obvious, and even though technically not allowed, they will do it anyways... even at school (other kids with means and an iPhone and not that rare anymore) So here's my idea and was looking for a kick start... I was thinking, if i can't win on this one (which I won't, again kids way too resourceful), I may as well try to join them (and keep some sort of control). Would someone have something (some code, a model, a sketch (a ready made app :) ), etc...) that could help me get her friends setup on a private social thing of their own? To some sort of basic app, I would like apply to some VERY secure features (the kind of security that would allow me to sleep at night), where registering is impossible (must be invited, with obviously some routing ability to daddy's email (and invitee's parents') :) ) and the account is created for them), have some sort of overding parental control, enable a i_am_still_in_charge group for parents, some sort of proxy service for email (i had to remove her email privileges, not her fault really, but had to anyways) and things like that... but to get to there, I was hoping to... dare I say it? yeah, use someone else's code if some available :) - by the time I get to it, ... HTML 6 will probably be well over my head ;) I think it is sad to need to go to that length, but after seeing what happens first hand the type of scary stuff that kids get exposed to, its my one and only compromise to my daughter her few friends (wether they like it or not). Kids (my daughter specifically) has been my first focus with web2py (that's a way different story) and maybe out of this, a community of young web2py fans could emerge :) - BTW - when explained at their level, kids that age do have the ability to learn about technology and as it turns out, they can be pretty handy (sometimes way too handy)... Can anyone help with ? :) Thanks, Mart :)
Re: [web2py] Re: Testing the new router (attn Massimo)
On Jan 17, 2011, at 9:38 AM, Martín Mulone wrote: return LOAD('plugin_comments','comments.load',args=[tablename, record_id, page],ajax=True) File /home/martin/Repositorios/google_appengine/web2py/gluon/compileapp.py, line 145, in __call__ extension=extension) File /home/martin/Repositorios/google_appengine/web2py/gluon/html.py, line 262, in URL acf = rewrite.map_url_out(application, controller, function, args, r or _request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 867, in map_url_out map = MapUrlOut(application, controller, function, args, request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 722, in __init__ self.domain_application = self.request.env.domain_application AttributeError: 'NoneType' object has no attribute 'env' I start to test, but I have this error In GAE Thanks, Martín. Is this the current trunk? What's happening is that LOAD is calling URL in a peculiar way (Massimo, would you take a look, please?). It's making this call: html.URL(request.application,c,f, args=args,vars=vars,extension=extension) ...which means that URL isn't able to pass request on to the URL rewriter. As a temporary workaround, you can do the URL rewriting yourself by adding a url= argument to your LOAD call: ..., url=URL(r=request, c='plugin_comments', f='comments.load', args=[tablename, record_id, page]) in which case you don't have to pass those args to LOAD (but I think it does no harm). Massimo, I think that LOAD's call to html.URL needs to include request, or else simply call URL, which will take care of it automatically. Do you see any reason not to do that? (This will be a non-problem once we have request-scope globals available in gluon.)
Re: [web2py] Re: Testing the new router (attn Massimo)
yes is trunk 2011/1/17 Jonathan Lundell jlund...@pobox.com On Jan 17, 2011, at 9:38 AM, Martín Mulone wrote: return LOAD('plugin_comments','comments.load',args=[tablename, record_id, page],ajax=True) File /home/martin/Repositorios/google_appengine/web2py/gluon/compileapp.py, line 145, in __call__ extension=extension) File /home/martin/Repositorios/google_appengine/web2py/gluon/html.py, line 262, in URL acf = rewrite.map_url_out(application, controller, function, args, r or _request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 867, in map_url_out map = MapUrlOut(application, controller, function, args, request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 722, in __init__ self.domain_application = self.request.env.domain_application AttributeError: 'NoneType' object has no attribute 'env' I start to test, but I have this error In GAE Thanks, Martín. Is this the current trunk? What's happening is that LOAD is calling URL in a peculiar way (Massimo, would you take a look, please?). It's making this call: html.URL(request.application,c,f, args=args,vars=vars,extension=extension) ...which means that URL isn't able to pass request on to the URL rewriter. As a temporary workaround, you can do the URL rewriting yourself by adding a url= argument to your LOAD call: ..., url=URL(r=request, c='plugin_comments', f='comments.load', args=[tablename, record_id, page]) in which case you don't have to pass those args to LOAD (but I think it does no harm). Massimo, I think that LOAD's call to html.URL needs to include request, or else simply call URL, which will take care of it automatically. Do you see any reason not to do that? (This will be a non-problem once we have request-scope globals available in gluon.) -- Pablo Martín Mulone (mar...@tecnodoc.com.ar) http://www.tecnodoc.com.ar/ Paraná, Entre Ríos, Argentina (CP 3100). My blog: http://martin.tecnodoc.com.ar Expert4Solution Profile: http://www.experts4solutions.com/e4s/default/expert/6
Re: [web2py] Re: sqlform.factory, inserting variable number of records in an other table
Not exactly what I seaching for... As far as I understand... It only let you simplified code by isolated repetitive piece of model code. Since it's only create one table I can't have a normalized schema. I would do something like this : http://charlie.griefer.com/blog/index.cfm/2009/9/17/jQuery--Dynamically-Adding-Form-Elements see demo link in page This snippet seems much more interresting since you can even pick the type of input field you want to create : http://www.randomsnippets.com/2008/02/21/how-to-dynamically-add-form-elements-via-javascript/ second example This can let me insert the other form field (or subform) in my first form then I could use jQuery to add more row in my second table or subform... But I have 2 submit buttons and I will have to set the ID of the first form as a foreigh key for the second form or table manually : http://www.mail-archive.com/web2py@googlegroups.com/msg31293.html Richard On Mon, Jan 17, 2011 at 8:46 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: Thanks Mart... I read back my mail and my english was terrible. ;-) I thought about it after sent the mail and I realise that subform seems what I was searching for. I will try what you propose and give feedback here. Richard On Sun, Jan 16, 2011 at 10:43 PM, mart msenecal...@gmail.com wrote: You know, I discovered a week or 2 ago a way to make a form appear to have sub-forms (or sub-templates). Massimo's 'Audit Trail' (i think I saw it on web2pyslices) serves this purpose extremely well. To that, it becomes very easy to write scripts to generate all sorts of combinations of tables that exist to those that can be generated dynamically. Anyways, from the Audit trail idea, I made a requests app, that serves many different categories and types of requests, where forms can be created/generated on the fly. If I were doing something like you described, I would probably try something like this test_1=db.Table(None,'test_1', Field('results','??') Field('whomadethetest','string'), Field('date','date')) test_2=db.Table(None,'test_2', Field('results','??') Field('whomadethetest','string'), Field('date','date')) then you could do this (or have scripts generate it): db.define_table('result', Field('length','integer'), Field('width','integer'), Field('result','integer'), test_1) or db.define_table('result', Field('length','integer'), Field('width','integer'), Field('result','integer'), test_1, test2) or just the test results: db.define_table('result',test_1,test2) etc... Hope it helps, Mart :) On Jan 16, 4:38 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello, Let me expose my problem. I have a test (experience test that I made in lab) that I have to redo many time. At time point 1 there is only one result, but at the other time point the is one more result to store each time. So at time point 2 there is two results, at time point 3 there is 3 results and so on. Since the number of time point is not fixed I can create a given number of columns to handle this probleme in a not normalized way. Say fill with null the empty columns when the results are not available for a particular record (or a given time point). To normalize the schema I can do : db.define_table('result', Field('length','integer'), Field('width','integer'), Field('result','integer')) db.define_table('test1', Field('results','list:integer result') Field('whomadethetest','string'), Field('date','date')) db.test1.results.requires = IS_IN_DB(db,'result.id',db. result._format,multiple=True) I could add my result one by one in the result table and then pick them up... But I would do something sexier then that. I would like to be able to add any number of record by adding the row of result table in the same form of test1 table. So my model should be : db.define_table('test1', Field('results','??') Field('whomadethetest','string'), Field('date','date')) db.define_table('result', Field('length','integer'), Field('width','integer'), Field('result','integer'), Field('test1_id','db.test1') I have now a 1:n relation that is stored in result table. I would build a widget that let insert all the fields of an other table row by row. So if I have one result generated at time point 1 there will be one row in my form. But if I am a later time point there will have 2 rows for time point 2 and 3 for time point 3, etc. It could has a button to add more empty row that could be filled out. I read an search a lot. I found web2py_component that could be of some utility, but I am not sure since it seams to work with form in a global manner and not support field. SQLFORM.factory look the way to go before build the whole thing from scratch with form... If any of you
Re: [web2py] regarding social networking...
What about Diaspora open source social network that give you control over your own private information?? Richard On Mon, Jan 17, 2011 at 12:49 PM, mart msenecal...@gmail.com wrote: Hi, This seems to be a popular subject lately, including places that are closer to home... My 8 year old desperately wants to join in the fun, but daddy (me) can't think of anything else to say but go clean your room or go bug your sisters or something... we'll talk when you're 40 ! ;) . But, kids are resourceful, and will figure out a way to quench their thirst to fit in... The reasons for not letting her in are obvious, and even though technically not allowed, they will do it anyways... even at school (other kids with means and an iPhone and not that rare anymore) So here's my idea and was looking for a kick start... I was thinking, if i can't win on this one (which I won't, again kids way too resourceful), I may as well try to join them (and keep some sort of control). Would someone have something (some code, a model, a sketch (a ready made app :) ), etc...) that could help me get her friends setup on a private social thing of their own? To some sort of basic app, I would like apply to some VERY secure features (the kind of security that would allow me to sleep at night), where registering is impossible (must be invited, with obviously some routing ability to daddy's email (and invitee's parents') :) ) and the account is created for them), have some sort of overding parental control, enable a i_am_still_in_charge group for parents, some sort of proxy service for email (i had to remove her email privileges, not her fault really, but had to anyways) and things like that... but to get to there, I was hoping to... dare I say it? yeah, use someone else's code if some available :) - by the time I get to it, ... HTML 6 will probably be well over my head ;) I think it is sad to need to go to that length, but after seeing what happens first hand the type of scary stuff that kids get exposed to, its my one and only compromise to my daughter her few friends (wether they like it or not). Kids (my daughter specifically) has been my first focus with web2py (that's a way different story) and maybe out of this, a community of young web2py fans could emerge :) - BTW - when explained at their level, kids that age do have the ability to learn about technology and as it turns out, they can be pretty handy (sometimes way too handy)... Can anyone help with ? :) Thanks, Mart :)
Re: [web2py] Re: Testing the new router (attn Massimo)
On Jan 17, 2011, at 10:07 AM, Martín Mulone wrote: yes is trunk OK, either try the workaround (url=) or if you want to wait, we'll get LOAD fixed in the trunk (might take a day or two). 2011/1/17 Jonathan Lundell jlund...@pobox.com On Jan 17, 2011, at 9:38 AM, Martín Mulone wrote: return LOAD('plugin_comments','comments.load',args=[tablename, record_id, page],ajax=True) File /home/martin/Repositorios/google_appengine/web2py/gluon/compileapp.py, line 145, in __call__ extension=extension) File /home/martin/Repositorios/google_appengine/web2py/gluon/html.py, line 262, in URL acf = rewrite.map_url_out(application, controller, function, args, r or _request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 867, in map_url_out map = MapUrlOut(application, controller, function, args, request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 722, in __init__ self.domain_application = self.request.env.domain_application AttributeError: 'NoneType' object has no attribute 'env' I start to test, but I have this error In GAE Thanks, Martín. Is this the current trunk? What's happening is that LOAD is calling URL in a peculiar way (Massimo, would you take a look, please?). It's making this call: html.URL(request.application,c,f, args=args,vars=vars,extension=extension) ...which means that URL isn't able to pass request on to the URL rewriter. As a temporary workaround, you can do the URL rewriting yourself by adding a url= argument to your LOAD call: ..., url=URL(r=request, c='plugin_comments', f='comments.load', args=[tablename, record_id, page]) in which case you don't have to pass those args to LOAD (but I think it does no harm). Massimo, I think that LOAD's call to html.URL needs to include request, or else simply call URL, which will take care of it automatically. Do you see any reason not to do that? (This will be a non-problem once we have request-scope globals available in gluon.) -- Pablo Martín Mulone (mar...@tecnodoc.com.ar) http://www.tecnodoc.com.ar/ Paraná, Entre Ríos, Argentina (CP 3100). My blog: http://martin.tecnodoc.com.ar Expert4Solution Profile: http://www.experts4solutions.com/e4s/default/expert/6
Re: [web2py] Re: Testing the new router (attn Massimo)
On Jan 17, 2011, at 10:07 AM, Martín Mulone wrote: yes is trunk If you'd like to try a likely fix to LOAD, you can make this change. In gluon.compileapp.LoadFactory, you'll see this line toward the end: url = url or html.URL(request.application,c, f, args=args,vars=vars, extension=extension) Just add r=request: url = url or html.URL(request.application,c, f, args=args,vars=vars, r=request, extension=extension) 2011/1/17 Jonathan Lundell jlund...@pobox.com On Jan 17, 2011, at 9:38 AM, Martín Mulone wrote: return LOAD('plugin_comments','comments.load',args=[tablename, record_id, page],ajax=True) File /home/martin/Repositorios/google_appengine/web2py/gluon/compileapp.py, line 145, in __call__ extension=extension) File /home/martin/Repositorios/google_appengine/web2py/gluon/html.py, line 262, in URL acf = rewrite.map_url_out(application, controller, function, args, r or _request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 867, in map_url_out map = MapUrlOut(application, controller, function, args, request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 722, in __init__ self.domain_application = self.request.env.domain_application AttributeError: 'NoneType' object has no attribute 'env' I start to test, but I have this error In GAE Thanks, Martín. Is this the current trunk? What's happening is that LOAD is calling URL in a peculiar way (Massimo, would you take a look, please?). It's making this call: html.URL(request.application,c,f, args=args,vars=vars,extension=extension) ...which means that URL isn't able to pass request on to the URL rewriter. As a temporary workaround, you can do the URL rewriting yourself by adding a url= argument to your LOAD call: ..., url=URL(r=request, c='plugin_comments', f='comments.load', args=[tablename, record_id, page]) in which case you don't have to pass those args to LOAD (but I think it does no harm). Massimo, I think that LOAD's call to html.URL needs to include request, or else simply call URL, which will take care of it automatically. Do you see any reason not to do that? (This will be a non-problem once we have request-scope globals available in gluon.) -- Pablo Martín Mulone (mar...@tecnodoc.com.ar) http://www.tecnodoc.com.ar/ Paraná, Entre Ríos, Argentina (CP 3100). My blog: http://martin.tecnodoc.com.ar Expert4Solution Profile: http://www.experts4solutions.com/e4s/default/expert/6
[web2py] Re: regarding social networking...
Just had a look, thanks for that :) Yes, pretty close, isn't it? only a few things i see: 1) it not web2py ;) - my daughter is a HUGE fan, I am teaching her basic programming, and the web app world, all @ 127.0.0.1 (although, i have MUCH to learn my self ;) 2)Since this is for my daughter, i would want control over auth_user ;) - There are some of her little friends, that I don't fully approve of - yes, I am paranoid ;) She may suggest or ask, but ultimately, daddy gets to say yes or no to the invite list. The reason isn't that I want to dictate, but she was victimized by other older kids @ school a few months ago (including through email and getting her to give her password to a few online clubs - which are usually really great (like Disney and webkinz), but can't protect the kids against themselves and nor should they have to. So for now, knowing, and having control over who is really important. 3) Then, there's the Twitter's legal agreement which, probably wouldn't do anything too atrocious, but doen't give me that warm and fuzzy... The Services that Twitter provides are always evolving and the form and nature of the Services that Twitter provides may change from time to time without prior notice to you But, I do like what it offers :) Thanks for the info though, it's much appreciated, Mart :) On Jan 17, 1:11 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: What about Diaspora open source social network that give you control over your own private information?? Richard On Mon, Jan 17, 2011 at 12:49 PM, mart msenecal...@gmail.com wrote: Hi, This seems to be a popular subject lately, including places that are closer to home... My 8 year old desperately wants to join in the fun, but daddy (me) can't think of anything else to say but go clean your room or go bug your sisters or something... we'll talk when you're 40 ! ;) . But, kids are resourceful, and will figure out a way to quench their thirst to fit in... The reasons for not letting her in are obvious, and even though technically not allowed, they will do it anyways... even at school (other kids with means and an iPhone and not that rare anymore) So here's my idea and was looking for a kick start... I was thinking, if i can't win on this one (which I won't, again kids way too resourceful), I may as well try to join them (and keep some sort of control). Would someone have something (some code, a model, a sketch (a ready made app :) ), etc...) that could help me get her friends setup on a private social thing of their own? To some sort of basic app, I would like apply to some VERY secure features (the kind of security that would allow me to sleep at night), where registering is impossible (must be invited, with obviously some routing ability to daddy's email (and invitee's parents') :) ) and the account is created for them), have some sort of overding parental control, enable a i_am_still_in_charge group for parents, some sort of proxy service for email (i had to remove her email privileges, not her fault really, but had to anyways) and things like that... but to get to there, I was hoping to... dare I say it? yeah, use someone else's code if some available :) - by the time I get to it, ... HTML 6 will probably be well over my head ;) I think it is sad to need to go to that length, but after seeing what happens first hand the type of scary stuff that kids get exposed to, its my one and only compromise to my daughter her few friends (wether they like it or not). Kids (my daughter specifically) has been my first focus with web2py (that's a way different story) and maybe out of this, a community of young web2py fans could emerge :) - BTW - when explained at their level, kids that age do have the ability to learn about technology and as it turns out, they can be pretty handy (sometimes way too handy)... Can anyone help with ? :) Thanks, Mart :)
[web2py] Re: sqlform.factory, inserting variable number of records in an other table
yes, I see what you mean... that is interesting... Now, you have me wanting to look into that too ;) Could be very useful as a plugin (or ready made snippet of code), you are right with that. Mart :) On Jan 17, 1:08 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: Not exactly what I seaching for... As far as I understand... It only let you simplified code by isolated repetitive piece of model code. Since it's only create one table I can't have a normalized schema. I would do something like this : http://charlie.griefer.com/blog/index.cfm/2009/9/17/jQuery--Dynamical... see demo link in page This snippet seems much more interresting since you can even pick the type of input field you want to create :http://www.randomsnippets.com/2008/02/21/how-to-dynamically-add-form-... second example This can let me insert the other form field (or subform) in my first form then I could use jQuery to add more row in my second table or subform... But I have 2 submit buttons and I will have to set the ID of the first form as a foreigh key for the second form or table manually :http://www.mail-archive.com/web2py@googlegroups.com/msg31293.html Richard On Mon, Jan 17, 2011 at 8:46 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: Thanks Mart... I read back my mail and my english was terrible. ;-) I thought about it after sent the mail and I realise that subform seems what I was searching for. I will try what you propose and give feedback here. Richard On Sun, Jan 16, 2011 at 10:43 PM, mart msenecal...@gmail.com wrote: You know, I discovered a week or 2 ago a way to make a form appear to have sub-forms (or sub-templates). Massimo's 'Audit Trail' (i think I saw it on web2pyslices) serves this purpose extremely well. To that, it becomes very easy to write scripts to generate all sorts of combinations of tables that exist to those that can be generated dynamically. Anyways, from the Audit trail idea, I made a requests app, that serves many different categories and types of requests, where forms can be created/generated on the fly. If I were doing something like you described, I would probably try something like this test_1=db.Table(None,'test_1', Field('results','??') Field('whomadethetest','string'), Field('date','date')) test_2=db.Table(None,'test_2', Field('results','??') Field('whomadethetest','string'), Field('date','date')) then you could do this (or have scripts generate it): db.define_table('result', Field('length','integer'), Field('width','integer'), Field('result','integer'), test_1) or db.define_table('result', Field('length','integer'), Field('width','integer'), Field('result','integer'), test_1, test2) or just the test results: db.define_table('result',test_1,test2) etc... Hope it helps, Mart :) On Jan 16, 4:38 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello, Let me expose my problem. I have a test (experience test that I made in lab) that I have to redo many time. At time point 1 there is only one result, but at the other time point the is one more result to store each time. So at time point 2 there is two results, at time point 3 there is 3 results and so on. Since the number of time point is not fixed I can create a given number of columns to handle this probleme in a not normalized way. Say fill with null the empty columns when the results are not available for a particular record (or a given time point). To normalize the schema I can do : db.define_table('result', Field('length','integer'), Field('width','integer'), Field('result','integer')) db.define_table('test1', Field('results','list:integer result') Field('whomadethetest','string'), Field('date','date')) db.test1.results.requires = IS_IN_DB(db,'result.id',db. result._format,multiple=True) I could add my result one by one in the result table and then pick them up... But I would do something sexier then that. I would like to be able to add any number of record by adding the row of result table in the same form of test1 table. So my model should be : db.define_table('test1', Field('results','??') Field('whomadethetest','string'), Field('date','date')) db.define_table('result', Field('length','integer'), Field('width','integer'), Field('result','integer'), Field('test1_id','db.test1') I have now a 1:n relation that is stored in result table. I would build a widget that let insert all the fields of an other table row by row. So if I have one result generated at time point 1 there will be one row in my form. But if I am a later time point there will have 2 rows for time point 2 and 3 for time point 3, etc. It could has a button to
[web2py] today's rewrite patch
The rewrite patch that just appeared in the trunk doesn't make any substantive changes; it's just a code reorganization to make it more modular and (hopefully) a little more readable. If you're experimenting with the new routing, it'd be helpful for you to track the changes so line numbers and such match up, but you shouldn't see any behavior change.
Re: [web2py] looking for advice on validation
I use to validate date : data = IS_NULL_OR(IS_DATE(format=T('%d/%m/%Y'))) def make_data(field): if field != None: return field.strftime(%d/%m/%Y) and in the Field Field('data_cadastro', 'date',default=request.now,label='Data de Registro',requires=data,represent= lambda field: make_data(field)), 2011/1/17 tomt tom_tren...@yahoo.com Hi, I have learned to use SQLFORM to generate forms. The validation defined in the db model works as expected, but there are times when I want to write a controller that uses a different validation than what is defined in the model. (Specifically, I want to force a different date validation) From what I've read in the manual, and in web2py-users, I can define the form manually using FORM and specify the validation on each field, but I was hoping there was a way I could do this with SQLFORM. I'd appreciate any recommendations and/or examples. Thanks, - Tom -- Atenciosamente Alexandre Andrade Hipercenter.com Classificados Gratuitos e Inteligentes
Re: [web2py] Re: sqlform.factory, inserting variable number of records in an other table
There is a couple of little problem with the script : one have been corrected by someone post... Look at Raymond on 9/2/10 12:11 AM The other problem, actually not a problem, but it could be much more fun for user to be able to erase only the added line they mistake on... So having a button erase on the side of every added row. It pretty much like Gmail contact interface... The last thing I would like is to be able to add more then only one subfield. For example, if I have Client Name Address Street City I would have form like this Name : Street | City emptyboxstreetrow1 | emptyboxcityrow1 trashcan button emptyboxstreetrow2 | emptyboxcityrow2 trashcan button I guest it could be easier like this in the first place : Name : Street : City : Street : City : etc. Here the SQLFORM.factory doc link that should be the way to generate the basic form that can then be modify by Charlie's script http://www.web2py.com/book/default/chapter/07#SQLFORM.factory Richard On Mon, Jan 17, 2011 at 1:56 PM, mart msenecal...@gmail.com wrote: yes, I see what you mean... that is interesting... Now, you have me wanting to look into that too ;) Could be very useful as a plugin (or ready made snippet of code), you are right with that. Mart :) On Jan 17, 1:08 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: Not exactly what I seaching for... As far as I understand... It only let you simplified code by isolated repetitive piece of model code. Since it's only create one table I can't have a normalized schema. I would do something like this : http://charlie.griefer.com/blog/index.cfm/2009/9/17/jQuery--Dynamical... see demo link in page This snippet seems much more interresting since you can even pick the type of input field you want to create : http://www.randomsnippets.com/2008/02/21/how-to-dynamically-add-form-... second example This can let me insert the other form field (or subform) in my first form then I could use jQuery to add more row in my second table or subform... But I have 2 submit buttons and I will have to set the ID of the first form as a foreigh key for the second form or table manually : http://www.mail-archive.com/web2py@googlegroups.com/msg31293.html Richard On Mon, Jan 17, 2011 at 8:46 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: Thanks Mart... I read back my mail and my english was terrible. ;-) I thought about it after sent the mail and I realise that subform seems what I was searching for. I will try what you propose and give feedback here. Richard On Sun, Jan 16, 2011 at 10:43 PM, mart msenecal...@gmail.com wrote: You know, I discovered a week or 2 ago a way to make a form appear to have sub-forms (or sub-templates). Massimo's 'Audit Trail' (i think I saw it on web2pyslices) serves this purpose extremely well. To that, it becomes very easy to write scripts to generate all sorts of combinations of tables that exist to those that can be generated dynamically. Anyways, from the Audit trail idea, I made a requests app, that serves many different categories and types of requests, where forms can be created/generated on the fly. If I were doing something like you described, I would probably try something like this test_1=db.Table(None,'test_1', Field('results','??') Field('whomadethetest','string'), Field('date','date')) test_2=db.Table(None,'test_2', Field('results','??') Field('whomadethetest','string'), Field('date','date')) then you could do this (or have scripts generate it): db.define_table('result', Field('length','integer'), Field('width','integer'), Field('result','integer'), test_1) or db.define_table('result', Field('length','integer'), Field('width','integer'), Field('result','integer'), test_1, test2) or just the test results: db.define_table('result',test_1,test2) etc... Hope it helps, Mart :) On Jan 16, 4:38 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello, Let me expose my problem. I have a test (experience test that I made in lab) that I have to redo many time. At time point 1 there is only one result, but at the other time point the is one more result to store each time. So at time point 2 there is two results, at time point 3 there is 3 results and so on. Since the number of time point is not fixed I can create a given number of columns to handle this probleme in a not normalized way. Say fill with null the empty columns when the results are not available for a particular record (or a given time point). To normalize the schema I can do : db.define_table('result', Field('length','integer'), Field('width','integer'),
Re: [web2py] Re: Testing the new router (attn Massimo)
On Jan 17, 2011, at 10:49 AM, Jonathan Lundell wrote: On Jan 17, 2011, at 10:07 AM, Martín Mulone wrote: yes is trunk If you'd like to try a likely fix to LOAD, you can make this change. In gluon.compileapp.LoadFactory, you'll see this line toward the end: url = url or html.URL(request.application,c, f, args=args,vars=vars, extension=extension) Just add r=request: url = url or html.URL(request.application,c, f, args=args,vars=vars, r=request, extension=extension) I just noticed that this pattern appears twice. Martín, I think you're using the second one, but it shouldn't hurt to patch both. 2011/1/17 Jonathan Lundell jlund...@pobox.com On Jan 17, 2011, at 9:38 AM, Martín Mulone wrote: return LOAD('plugin_comments','comments.load',args=[tablename, record_id, page],ajax=True) File /home/martin/Repositorios/google_appengine/web2py/gluon/compileapp.py, line 145, in __call__ extension=extension) File /home/martin/Repositorios/google_appengine/web2py/gluon/html.py, line 262, in URL acf = rewrite.map_url_out(application, controller, function, args, r or _request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 867, in map_url_out map = MapUrlOut(application, controller, function, args, request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 722, in __init__ self.domain_application = self.request.env.domain_application AttributeError: 'NoneType' object has no attribute 'env' I start to test, but I have this error In GAE Thanks, Martín. Is this the current trunk? What's happening is that LOAD is calling URL in a peculiar way (Massimo, would you take a look, please?). It's making this call: html.URL(request.application,c,f, args=args,vars=vars,extension=extension) ...which means that URL isn't able to pass request on to the URL rewriter. As a temporary workaround, you can do the URL rewriting yourself by adding a url= argument to your LOAD call: ..., url=URL(r=request, c='plugin_comments', f='comments.load', args=[tablename, record_id, page]) in which case you don't have to pass those args to LOAD (but I think it does no harm). Massimo, I think that LOAD's call to html.URL needs to include request, or else simply call URL, which will take care of it automatically. Do you see any reason not to do that? (This will be a non-problem once we have request-scope globals available in gluon.) -- Pablo Martín Mulone (mar...@tecnodoc.com.ar) http://www.tecnodoc.com.ar/ Paraná, Entre Ríos, Argentina (CP 3100). My blog: http://martin.tecnodoc.com.ar Expert4Solution Profile: http://www.experts4solutions.com/e4s/default/expert/6
[web2py] Re: Apache, Wsgi problem
Are you using connection pooling? Can I see the line db = DAL(...)? On Jan 16, 2:24 pm, VP vtp2...@gmail.com wrote: Kenneth (see post above) had the same problem with MySQL. On Jan 16, 3:55 am, ron_m ron.mco...@gmail.com wrote: Is there any chance to try another server based database such as MySQL. Since SQLite did not exhibit a problem that is a valid data point but it is an embedded database so called directly by the web2py server code instead of using a driver. There is a possibility there is a problem with the driver on PostgreSQL if the connections are being reused in a pool. This is very difficult to find without some further logging. I gather the page request you see failing as a user simply never completes. I saw this once while testing the application but the loading is only myself running tests. I use PostgreSQL in this app but I also have a version that runs on MySQL which has only a connection string difference plus the content of the databases directory. Maybe I can try this tomorrow, it is almost 2 am here so I don't want to start something new right now. I just need to learn how to use ab which I take it isn't going to be much to figure out.
[web2py] doesn't represents in a string format
can you help me with this, please? i can't find why producto.subcategoria doesn't represents in a string format. in jqgrid and sqltable shows the producto.subcategoria reference like an integer and should be represented as %(nombre)s, but it doesn't... am I forgeting something? my model: http://ompldr.org/vNzE1eA/model my controller: http://ompldr.org/vNzE1eg/controller thanks in advance
[web2py] [plugin] Plugin comments
http://martin.tecnodoc.com.ar/myblog/2011/01/17/plugin-comments-for-web2py
Re: [web2py] Re: web2py social network designer/architect
@francisco, Tymr should be worldwide events+places social network, don't be only in Portugal, I liked so much your idea, let me know if you want to expand the idea, may be we can work together, I can try something in Brazil. Bruno Rocha http://about.me/rochacbruno/bio 2011/1/17 Francisco Costa m...@franciscocosta.com Thank you all for the inclusion. I haven't made any promotion here, because tymr.com is a one man project for now, and i'm not yet fully satisfied with the result. I'm looking for some angel ou vc investment but the economy is not very good in Portugal at the moment. On Jan 17, 4:58 pm, Anthony abasta...@gmail.com wrote: On Monday, January 17, 2011 11:27:49 AM UTC-5, Massimo Di Pierro wrote: Hey! This should be on web2py.com/poweredby Yes, already added it a few days ago: http://web2py.com/poweredby/default/site_read/89
Re: [web2py] [plugin] Plugin comments
Great! I am testing, silently since you commited it in to bitbucket. Very nice plugin. Bruno Rocha http://about.me/rochacbruno/bio
[web2py] Re: [plugin] Plugin comments
You should add it to http://www.web2py.com/plugins/. Actually, we should probably clean up the free plugins list -- maybe archive the outdated ones. On Monday, January 17, 2011 2:20:00 PM UTC-5, Martin.Mulone wrote: http://martin.tecnodoc.com.ar/myblog/2011/01/17/plugin-comments-for-web2py
[web2py] Re: Apache, Wsgi problem
Here it is with private information replaced with generic information. if request.env.web2py_runtime_gae:# if running on Google App Engine db = DAL('gae') # connect to Google BigTable session.connect(request, response, db = db) # and store sessions and tickets there else: # else use a normal relational database db = DAL('postgres://name:password@localhost:5432/db') #db = DAL('sqlite://storage.sqlite') On Jan 17, 1:19 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Are you using connection pooling? Can I see the line db = DAL(...)? On Jan 16, 2:24 pm, VP vtp2...@gmail.com wrote: Kenneth (see post above) had the same problem with MySQL. On Jan 16, 3:55 am, ron_m ron.mco...@gmail.com wrote: Is there any chance to try another server based database such as MySQL. Since SQLite did not exhibit a problem that is a valid data point but it is an embedded database so called directly by the web2py server code instead of using a driver. There is a possibility there is a problem with the driver on PostgreSQL if the connections are being reused in a pool. This is very difficult to find without some further logging. I gather the page request you see failing as a user simply never completes. I saw this once while testing the application but the loading is only myself running tests. I use PostgreSQL in this app but I also have a version that runs on MySQL which has only a connection string difference plus the content of the databases directory. Maybe I can try this tomorrow, it is almost 2 am here so I don't want to start something new right now. I just need to learn how to use ab which I take it isn't going to be much to figure out.
[web2py] Basic Python ignorance? simplejson throwing TypeError(key + repr(key) + is not a string)
No doubt this is my base Python ignorance being the problem. I've made some progress on my pivot problem, using this recipe http://code.activestate.com/recipes/334695-pivotcrosstabdenormalization-of-a-normalized-list/ (actually, the improved one from the comments). I'm getting what I want now (or close to it): [ { 'FreezeTime': datetime.datetime(2010, 12, 12, 21, 0), ('S',): 643.882600715039, ('S0001',): '', ('S0002',): 621.511925599709}, { 'FreezeTime': datetime.datetime(2010, 12, 12, 22, 0), ('S',): 159.230736027886, ('S0001',): '', ('S0002',): 166.628191452988}, ... ] But when I try to convert it to json using this in my view: var optimizerdata = {{response.write(json(optimizers), escape=False)}}; Where optimizers is a list that looks like this: It throws the error, saying this: TypeError: key ('S0001',) is not a string -- Lorin Rivers Mosasaur: Killer Technical Marketing http://www.mosasaur.com mailto:lriv...@mosasaur.com 512/203.3198 (m)
[web2py] Re: web2py social network designer/architect
and it's not only in Portugal.. I will email you! On Jan 17, 7:21 pm, Bruno Rocha rochacbr...@gmail.com wrote: @francisco, Tymr should be worldwide events+places social network, don't be only in Portugal, I liked so much your idea, let me know if you want to expand the idea, may be we can work together, I can try something in Brazil. Bruno Rochahttp://about.me/rochacbruno/bio 2011/1/17 Francisco Costa m...@franciscocosta.com Thank you all for the inclusion. I haven't made any promotion here, because tymr.com is a one man project for now, and i'm not yet fully satisfied with the result. I'm looking for some angel ou vc investment but the economy is not very good in Portugal at the moment. On Jan 17, 4:58 pm, Anthony abasta...@gmail.com wrote: On Monday, January 17, 2011 11:27:49 AM UTC-5, Massimo Di Pierro wrote: Hey! This should be on web2py.com/poweredby Yes, already added it a few days ago: http://web2py.com/poweredby/default/site_read/89
Re: [web2py] social network idea
Actually, Facebook also uses social graphs to identify people you may know. This part of it is a pretty tough problem, but there are some pretty sharp people on this list… On Jan 17, 2011, at 13:43 , Massimo Di Pierro wrote: Most social network assue you know who your friends are and allow you to share info with your friends. How about the opposite? Something like a bookmarking app that tells me who my friends should be based on physical distance and recent common bookmarks? It seems to me the main problem to me is that a lot of people are alone they because do not necessarily share interests with their colleagues and family members. Facebook is popular because it allows people to connect with people that they knew and therefore assume had something in common. Until people find out time has passed by and there is not really much to talk about. You can be a scientist and soon find your page polluted with somebody's horoscope. - a bookmarking system like http://radbox.me/ - when you bookmark something you tag with fixed categories - a way to sort/organize and rate own bookmarks using mouse drag and drop. - you have a profile and public pages showing your bookmarks only (can be used by a prof to share links with students for example) - Once logged in you can see other users nearby that bookmarked - independently - the same links, and filter then by location, gender, age, bookmark category (could compete with match.com too) - You can then choose to be notified when a given person bookmarks something new (like twitter) - You can check who is following your bookmarks. Massimo -- Lorin Rivers Mosasaur: Killer Technical Marketing http://www.mosasaur.com mailto:lriv...@mosasaur.com 512/203.3198 (m)
[web2py] Re: social network idea
On Jan 17, 1:43 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Most social network assue you know who your friends are and allow you to share info with your friends. How about the opposite? Something like a bookmarking app that tells me who my friends should be based on physical distance and recent common bookmarks? It seems to me the main problem to me is that a lot of people are alone they because do not necessarily share interests with their colleagues and family members. Facebook is popular because it allows people to connect with people that they knew and therefore assume had something in common. Until people find out time has passed by and there is not really much to talk about. You can be a scientist and soon find your page polluted with somebody's horoscope. - a bookmarking system likehttp://radbox.me/ - when you bookmark something you tag with fixed categories - a way to sort/organize and rate own bookmarks using mouse drag and drop. - you have a profile and public pages showing your bookmarks only (can be used by a prof to share links with students for example) - Once logged in you can see other users nearby that bookmarked - independently - the same links, and filter then by location, gender, age, bookmark category (could compete with match.com too) - You can then choose to be notified when a given person bookmarks something new (like twitter) - You can check who is following your bookmarks. Massimo That's a very good idea! Mr.Netadmin
Re: [web2py] social network idea
IMHO, I think that the best feature of facebook is that you can share things (links, video, music), with a subgroup of friends. In example, you if you have a group of friends that you know that they love music, you share music videos with them. (and only with them). Another example, the familiar christhmas photos, you'll share only with members of your family (another subgroup of friends). Albert On Mon, Jan 17, 2011 at 8:43 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Most social network assue you know who your friends are and allow you to share info with your friends. How about the opposite? Something like a bookmarking app that tells me who my friends should be based on physical distance and recent common bookmarks? It seems to me the main problem to me is that a lot of people are alone they because do not necessarily share interests with their colleagues and family members. Facebook is popular because it allows people to connect with people that they knew and therefore assume had something in common. Until people find out time has passed by and there is not really much to talk about. You can be a scientist and soon find your page polluted with somebody's horoscope. - a bookmarking system like http://radbox.me/ - when you bookmark something you tag with fixed categories - a way to sort/organize and rate own bookmarks using mouse drag and drop. - you have a profile and public pages showing your bookmarks only (can be used by a prof to share links with students for example) - Once logged in you can see other users nearby that bookmarked - independently - the same links, and filter then by location, gender, age, bookmark category (could compete with match.com too) - You can then choose to be notified when a given person bookmarks something new (like twitter) - You can check who is following your bookmarks. Massimo
Re: [web2py] Basic Python ignorance? simplejson throwing TypeError(key + repr(key) + is not a string)
Because its using a tuple as a dictionary key. Why not use the file I sent you the other day? -- Thadeus On Mon, Jan 17, 2011 at 1:41 PM, Lorin Rivers lriv...@mosasaur.com wrote: No doubt this is my base Python ignorance being the problem. I've made some progress on my pivot problem, using this recipe http://code.activestate.com/recipes/334695-pivotcrosstabdenormalization-of-a-normalized-list/ (actually, the improved one from the comments). I'm getting what I want now (or close to it): [ { 'FreezeTime': datetime.datetime(2010, 12, 12, 21, 0), ('S',): 643.882600715039, ('S0001',): '', ('S0002',): 621.511925599709}, { 'FreezeTime': datetime.datetime(2010, 12, 12, 22, 0), ('S',): 159.230736027886, ('S0001',): '', ('S0002',): 166.628191452988}, ... ] But when I try to convert it to json using this in my view: var optimizerdata = {{response.write(json(optimizers), escape=False)}}; Where optimizers is a list that looks like this: It throws the error, saying this: TypeError: key ('S0001',) is not a string -- Lorin Rivers Mosasaur: Killer Technical Marketing http://www.mosasaur.com mailto:lriv...@mosasaur.com 512/203.3198 (m)
[web2py] Re: Plugin comments
It would be great is somebody could improve the appliance app to handle plugin. Here is the source: http://www.web2py.com/appliances/static/web2py.app.appliances.w2p Massimo
[web2py] Re: doesn't represents in a string format
On 17 ene, 16:19, web2py noob web2py.n...@gmail.com wrote: can you help me with this, please? i can't find why producto.subcategoria doesn't represents in a string format. in jqgrid and sqltable shows the producto.subcategoria reference like an integer and should be represented as %(nombre)s, but it doesn't... am I forgeting something? my model: http://ompldr.org/vNzE1eA/model my controller:http://ompldr.org/vNzE1eg/controller thanks in advance i know it should be something very easy, but i'm just blocked. any help, please...
Re: [web2py] Re: Plugin comments
2011/1/17 Massimo Di Pierro massimo.dipie...@gmail.com It would be great is somebody could improve the appliance app to handle plugin. Here is the source: I am working on a new *web2pyslices* my idea besides the new layout is to index every kind of slice related do web2py. I am planning a new layout and main areas of the site ['snippets','plugins','applications','tips','recipes'], everything on the same site. Nathan Freeze gave me the app + database dump, and I am already working on it. any ideas? Bruno Rocha http://about.me/rochacbruno/bio
[web2py] Janrain Basic limited to 2500 users
I'm not sure if this is a new limitation, but I just noticed that the free Basic Janrain service is limited to 2500 registered users ( http://www.janrain.com/products/engage/get-janrain-engage). Since the book is pushing Janrain as the easiest way to incorporate OpenID and OAuth ( http://www.web2py.com/book/default/chapter/08#Integration-with-OpenID,-Facebook,-etc.), I thought it might be worth mentioning that limitation, so I added the following to the call-out box at the bottom of the Janrain section: Janrain's free Basic service allows up to 2500 unique registered users to sign in annually. Accommodating more users requires an upgrade to one of their paid service tiers. Anthony
[web2py] Re: Apache, Wsgi problem
You should really have db = DAL('postgres://name:password@localhost:5432/db',pool_size=20) The reason is that client-server databases may set a max to number of open connections and it takes time to perform the 3-way handshake to establish a new connection at every http request. Without pooling you may hit the max sooner than you should. This will also make your app faster. Massimo On Jan 17, 1:39 pm, VP vtp2...@gmail.com wrote: Here it is with private information replaced with generic information. if request.env.web2py_runtime_gae: # if running on Google App Engine db = DAL('gae') # connect to Google BigTable session.connect(request, response, db = db) # and store sessions and tickets there else: # else use a normal relational database db = DAL('postgres://name:password@localhost:5432/db') # db = DAL('sqlite://storage.sqlite') On Jan 17, 1:19 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Are you using connection pooling? Can I see the line db = DAL(...)? On Jan 16, 2:24 pm, VP vtp2...@gmail.com wrote: Kenneth (see post above) had the same problem with MySQL. On Jan 16, 3:55 am, ron_m ron.mco...@gmail.com wrote: Is there any chance to try another server based database such as MySQL. Since SQLite did not exhibit a problem that is a valid data point but it is an embedded database so called directly by the web2py server code instead of using a driver. There is a possibility there is a problem with the driver on PostgreSQL if the connections are being reused in a pool. This is very difficult to find without some further logging. I gather the page request you see failing as a user simply never completes. I saw this once while testing the application but the loading is only myself running tests. I use PostgreSQL in this app but I also have a version that runs on MySQL which has only a connection string difference plus the content of the databases directory. Maybe I can try this tomorrow, it is almost 2 am here so I don't want to start something new right now. I just need to learn how to use ab which I take it isn't going to be much to figure out.
Re: [web2py] Re: Plugin comments
I'm thinking to modified the exibhition app. With little improve we can adapt it. 2011/1/17 Massimo Di Pierro massimo.dipie...@gmail.com It would be great is somebody could improve the appliance app to handle plugin. Here is the source: http://www.web2py.com/appliances/static/web2py.app.appliances.w2p Massimo -- Pablo Martín Mulone (mar...@tecnodoc.com.ar) http://www.tecnodoc.com.ar/ Paraná, Entre Ríos, Argentina (CP 3100). My blog: http://martin.tecnodoc.com.ar Expert4Solution Profile: http://www.experts4solutions.com/e4s/default/expert/6
[web2py] Re: Table of Contents for plugin_wiki pages
Thank you, you made my code useless :) Anyway, have you thought about using something like this to feed a search engine? what about the soup.prettify to make the code well indented? Thanks On Jan 17, 4:25 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: http://code.google.com/p/samaxesjs/wiki/TableOfContentsPlugin On Jan 17, 5:31 am, blackthorne francisco@gmail.com wrote: Something that might interest plugin_wiki users, is the possibility to automatically generate tables of contents from a page based on headings and specially tagged divs. just put this on the page.html view of the plugin: {{extend 'layout.html'}} {{if page:}} {{if page.slug.startswith('meta-'):}}{{=CODE(page.body)}}{{else:}} {{import re}}{{from BeautifulSoup import BeautifulSoup}} {{content=plugin_wiki.render(page.body)}} {{soup = BeautifulSoup(str(content))}} {{toc = [(tag.name,tag.text) for tag in soup.findAll(name=re.compile(rh[1-3]))]}}{{pass}} now you have a list with a pair telling you the level of heading and its content so you can do things like this: div id=toc ul {{sublevel=0}}{{for index,(level,text) in enumerate(toc):}}{{if int(toc[index-1][0][1]) int(level[1]):}}{{sublevel+=1}} ul{{elif int(toc[index-1][0][1]) int(level[1]) and sublevel 0:}} {{sublevel-=1}}/ul{{pass}} li{{=text}}/li{{pass}}{{while sublevel 0:}}{{sublevel -=1}}/ ul{{pass}} /ul /div {{=content}} This can easily be adapted to more generic situations. All you need is the html content of the page in a variable so that you can parse it for headings. You can adjust the depth of headings to be displayed by changing the regular expression h[1-3] to h[1-6] if you want 6... Next step: add anchors in headings so that we can link the table of contents into it. Best regards
Re: [web2py] Re: Recommended Payment Gateway (besides PayPal)
But this is only going to work in GAE is that correct? On 01/17/2011 06:23 PM, Massimo Di Pierro wrote: http://web2py.appspot.com/plugin_checkout/default/checkout On Jan 17, 2:34 am, cjrhcaleb.hatti...@gmail.com wrote: I am looking for recommendations for payment gateways.I already know about PayPal, and Authorize.NET. The former seems expensive, and has not been well-supported in my country in the past, and the latter is plagued with horror stories from disgruntled customers.
[web2py] Re: social network idea
I am mostly thinking of the kids and parents' paranoia (like mine ;) ), where they need to start with something that is like what everyone else is doing, but safely and securely... I still think that the younger crowd are overlooked and excluded from the good stuff (and they do get the good stuff on their own...) but that's just my humble opinion :) Your social networking idea is great BTW! Mart ) On Jan 17, 3:01 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: True. But now we have that. We need to think of something different and better, not copy it. On Jan 17, 1:55 pm, Albert Abril albert.ab...@gmail.com wrote: IMHO, I think that the best feature of facebook is that you can share things (links, video, music), with a subgroup of friends. In example, you if you have a group of friends that you know that they love music, you share music videos with them. (and only with them). Another example, the familiar christhmas photos, you'll share only with members of your family (another subgroup of friends). Albert On Mon, Jan 17, 2011 at 8:43 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Most social network assue you know who your friends are and allow you to share info with your friends. How about the opposite? Something like a bookmarking app that tells me who my friends should be based on physical distance and recent common bookmarks? It seems to me the main problem to me is that a lot of people are alone they because do not necessarily share interests with their colleagues and family members. Facebook is popular because it allows people to connect with people that they knew and therefore assume had something in common. Until people find out time has passed by and there is not really much to talk about. You can be a scientist and soon find your page polluted with somebody's horoscope. - a bookmarking system likehttp://radbox.me/ - when you bookmark something you tag with fixed categories - a way to sort/organize and rate own bookmarks using mouse drag and drop. - you have a profile and public pages showing your bookmarks only (can be used by a prof to share links with students for example) - Once logged in you can see other users nearby that bookmarked - independently - the same links, and filter then by location, gender, age, bookmark category (could compete with match.com too) - You can then choose to be notified when a given person bookmarks something new (like twitter) - You can check who is following your bookmarks. Massimo
Re: [web2py] Basic Python ignorance? simplejson throwing TypeError(key + repr(key) + is not a string)
Your key is a tuple, which is ok in Python but not in JS, I think. On Jan 17, 2011, at 11:41 AM, Lorin Rivers lriv...@mosasaur.com wrote: No doubt this is my base Python ignorance being the problem. I've made some progress on my pivot problem, using this recipe http://code.activestate.com/recipes/334695-pivotcrosstabdenormalization-of-a-normalized-list/ (actually, the improved one from the comments). I'm getting what I want now (or close to it): [ { 'FreezeTime': datetime.datetime(2010, 12, 12, 21, 0), ('S',): 643.882600715039, ('S0001',): '', ('S0002',): 621.511925599709}, { 'FreezeTime': datetime.datetime(2010, 12, 12, 22, 0), ('S',): 159.230736027886, ('S0001',): '', ('S0002',): 166.628191452988}, ... ] But when I try to convert it to json using this in my view: var optimizerdata = {{response.write(json(optimizers), escape=False)}}; Where optimizers is a list that looks like this: It throws the error, saying this: TypeError: key ('S0001',) is not a string -- Lorin Rivers Mosasaur: Killer Technical Marketing http://www.mosasaur.com mailto:lriv...@mosasaur.com 512/203.3198 (m)
[web2py] Schema migration to GAE / Creating a Test Suite
I have a web2py app that has been running very well on Google App Engine (which also contains actual client's data). However, when I first deployed this app, I did not realize that in order to backup and synchronize the data, I needed to include a modified_on and uuid field on all my models. I just changed the data model (on my development server) to include these fields and have tested this on both web2py with sqlite, GAE's dev server and a test app (which is nearly identical to the production app) which is also running on GAE. Additionally, I also exported all the tables from the production app as individual csv files by way of web2py's appadmin. I also see that the web2py book includes an example for a script to export the entire database as one file: http://www.web2py.com/book/default/chapter/06#CSV-and-Remote-Database-Synchronization. I have included these functions in the appadmin for my development apps, and found I am able to export the data for the new models just fine. I would now like to migrate the legacy data into the new model but I am unsure as to the procedure I should follow. Does anyone have any suggestions for how I should best proceed? Massimo, do you know if there are any seasoned programmers who would be willing to field my questions as I work through this process... and would this be a question for the experts4solutions group?
Re: [web2py] Re: Plugin comments
This would be fantastic. 'plugins' and 'applications' are obviously well-defined, but I wonder if 'snippets', 'tips', and 'recipes' are sufficiently distinct to warrant separate categories (i.e., it might be difficult to decide if something is a snippet, tip, or recipe, and the user looking for help on a given topic probably doesn't care anyway). It might be helpful to allow older entries to be marked out-of-date or obsolete (and filtered out of listings/searches). At least sorting by date last modified would be a step in that direction. Also, I wonder if it's worth trying to incorporate the stuff at http://www.web2py.com/examples/default/examples and http://www.web2py.com/AlterEgo -- those materials are largely snippets/tips/recipes also. Anthony On Monday, January 17, 2011 3:17:08 PM UTC-5, rochacbruno wrote: 2011/1/17 Massimo Di Pierro massimo@gmail.com It would be great is somebody could improve the appliance app to handle plugin. Here is the source: I am working on a new *web2pyslices* my idea besides the new layout is to index every kind of slice related do web2py. I am planning a new layout and main areas of the site ['snippets','plugins','applications','tips','recipes'], everything on the same site. Nathan Freeze gave me the app + database dump, and I am already working on it. any ideas? Bruno Rocha http://about.me/rochacbruno/bio
[web2py] Re: Is there a way to remove application name from URL()?
In attempt to get some response I'll try to clarify/simplify my question. After rewriting with routes.py I have my app accessible as: http://127.0.0.1/ But all the internal links, created with the URL() function come as: http://127.0.0.1/myapp/ And obviously they don't work. Is there no way to tell the URL() function not to prepend app name to the URLs?
[web2py] Re: doesn't represents in a string format
with the latest version of web2py i have found that you have to use represent on the field as well. see my post here: https://groups.google.com/d/topic/web2py/dnqKwf9Zxv0/discussion i think it may be a bug though i'm not sure if the behavior is correct or not. cfh
[web2py] Re: Is there a way to remove application name from URL()?
i'm pretty sure there is a section in the book that covers this topic exactly. there is also new versions of routing since i last wrote this. anyhow, my routes info: routes_in = (('/admin(?Pf.*)', '/admin$f' ), #make the admin app work ('/','/ec'), #/ goes to the ec app ('.*:/favicon.ico','/ec/static/images/favicon.ico'), #fav icon for all things on this server ('/$c/(?Pf.*)', '/ec/$c/$f'), # remove the leading /ec from our URLs ('/$c', '/ec/$c')) #remove leading /ec, don't require a function name (default to index) routes_out = (('/admin/(?Pf.*)', '/admin/$f' ), # don't rewrite admin links ('/$a/static/(?Pf.*)', '/$a/static/$f'), #don't rewrite static links ('/$a/$c/index.html', '/$c/'), # removing leading /ec, and the index function if there are no params ('/$a/$c/index', '/$c/'), # removing leading /ec, and the index function if there are no params ('/$a/$c/(?Pf.*)', '/$c/$f')) # remove leading /ec note that your routes_out must remove the application from the URL generated by URL() for it to work. ec is my application name in this example. you may also wish to look at the more recent updates to the routing mechanism, they might be easier to use - i don't know myself yet. cfh
[web2py] Re: Recommended Payment Gateway (besides PayPal)
with and without. On Jan 17, 2:35 pm, Jason Brower encomp...@gmail.com wrote: But this is only going to work in GAE is that correct? On 01/17/2011 06:23 PM, Massimo Di Pierro wrote: http://web2py.appspot.com/plugin_checkout/default/checkout On Jan 17, 2:34 am, cjrhcaleb.hatti...@gmail.com wrote: I am looking for recommendations for payment gateways. I already know about PayPal, and Authorize.NET. The former seems expensive, and has not been well-supported in my country in the past, and the latter is plagued with horror stories from disgruntled customers.
Re: [web2py] Re: Is there a way to remove application name from URL()?
The easy way is to use init as your application name; It uses that by default. HTH. On 1/17/11 4:11 PM, howesc wrote: i'm pretty sure there is a section in the book that covers this topic exactly. there is also new versions of routing since i last wrote this. anyhow, my routes info: routes_in = (('/admin(?Pf.*)', '/admin$f' ), #make the admin app work ('/','/ec'), #/ goes to the ec app ('.*:/favicon.ico','/ec/static/images/favicon.ico'), #fav icon for all things on this server ('/$c/(?Pf.*)', '/ec/$c/$f'), # remove the leading /ec from our URLs ('/$c', '/ec/$c')) #remove leading /ec, don't require a function name (default to index) routes_out = (('/admin/(?Pf.*)', '/admin/$f' ), # don't rewrite admin links ('/$a/static/(?Pf.*)', '/$a/static/$f'), #don't rewrite static links ('/$a/$c/index.html', '/$c/'), # removing leading /ec, and the index function if there are no params ('/$a/$c/index', '/$c/'), # removing leading /ec, and the index function if there are no params ('/$a/$c/(?Pf.*)', '/$c/$f')) # remove leading /ec note that your routes_out must remove the application from the URL generated by URL() for it to work. ec is my application name in this example. you may also wish to look at the more recent updates to the routing mechanism, they might be easier to use - i don't know myself yet. cfh
[web2py] Re: social network idea
I agree this does not address your issue. On Jan 17, 2:44 pm, mart msenecal...@gmail.com wrote: I am mostly thinking of the kids and parents' paranoia (like mine ;) ), where they need to start with something that is like what everyone else is doing, but safely and securely... I still think that the younger crowd are overlooked and excluded from the good stuff (and they do get the good stuff on their own...) but that's just my humble opinion :) Your social networking idea is great BTW! Mart ) On Jan 17, 3:01 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: True. But now we have that. We need to think of something different and better, not copy it. On Jan 17, 1:55 pm, Albert Abril albert.ab...@gmail.com wrote: IMHO, I think that the best feature of facebook is that you can share things (links, video, music), with a subgroup of friends. In example, you if you have a group of friends that you know that they love music, you share music videos with them. (and only with them). Another example, the familiar christhmas photos, you'll share only with members of your family (another subgroup of friends). Albert On Mon, Jan 17, 2011 at 8:43 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Most social network assue you know who your friends are and allow you to share info with your friends. How about the opposite? Something like a bookmarking app that tells me who my friends should be based on physical distance and recent common bookmarks? It seems to me the main problem to me is that a lot of people are alone they because do not necessarily share interests with their colleagues and family members. Facebook is popular because it allows people to connect with people that they knew and therefore assume had something in common. Until people find out time has passed by and there is not really much to talk about. You can be a scientist and soon find your page polluted with somebody's horoscope. - a bookmarking system likehttp://radbox.me/ - when you bookmark something you tag with fixed categories - a way to sort/organize and rate own bookmarks using mouse drag and drop. - you have a profile and public pages showing your bookmarks only (can be used by a prof to share links with students for example) - Once logged in you can see other users nearby that bookmarked - independently - the same links, and filter then by location, gender, age, bookmark category (could compete with match.com too) - You can then choose to be notified when a given person bookmarks something new (like twitter) - You can check who is following your bookmarks. Massimo
[web2py] Re: doesn't represents in a string format
If there was a change of behavior can you please post code that has changed behavior? If this happened was a bug not intentional. There was a change of behavior in appadmin and that was intentional. On Jan 17, 3:07 pm, howesc how...@umich.edu wrote: with the latest version of web2py i have found that you have to use represent on the field as well. see my post here:https://groups.google.com/d/topic/web2py/dnqKwf9Zxv0/discussion i think it may be a bug though i'm not sure if the behavior is correct or not. cfh
[web2py] Re: TAG name and XML: maybe a solution?
Massimo, it works. I will post a link to my web2py app which converts Excel worksheets in xml files as soon as published. Now I am just curious to look into your changes in html.py..Thanks carlo On 17 Gen, 17:33, Massimo Di Pierro massimo.dipie...@gmail.com wrote: check trunk, please. I did it but a little differently. On Jan 17, 9:39 am, carlo syseng...@gmail.com wrote: As in my previous post, TAG with its xml serializer fails when both tag Name and Contents are unicode strings with non ascii chars. What about this trivial solution in html.py? def xml(self): generates the xml for this component. (fa, co) = self._xml() if not self.tag: return co if self.tag[-1:] == '/': # tag [attributes] / #should encode this as well return '%s%s /' % (self.tag[:-1], fa) # else: tag [attributes] inner components xml /tag #explicitly encoding self.tag return '%s%s%s/%s' % ((self.tag).encode('utf-8'), fa, co, (self.tag).encode('utf-8')) In my test code this is ok but I do not know if it breaks something else. Another thing I noticed is that even HTML attributes like u'some_non_ascii_chars' breaks _validate()..but this is a story much more complex than the TAG problem.
[web2py] Typo in compile_app() function in admin/controllers/default.py
Hello everybody, a wrongly set closing bracket seems to prevent output of the code in case of failed compilation of an application. In the function compile_app() in the file applications/admin/ controllers/default.py, line 266/267 truncate the function T(...) after 'app:'), and let CODE(c) be an argument to the DIV(...)- function: e.g.:session.flash = DIV(T('Cannot compile: there are errors in your app:'), CODE(c)) If you do so, the code is shown again if compilation fails. Greetings, Toni amue...@chartup.de http://www.chartup.de
[web2py] Re: social network idea
How about something for the tinkers? Something like one of those super malls but for social networking. A place as varied in its members as it is in content? For example, assuming that life is more than just being about sharing pictures and one-liners on somebody's wall (not that there's anything bad about that because it is always fun), the tinker may like to make use of tools (or mini-apps or usable plug-ins) to do things like hosting an amateur seminar on... well, hopefully on something interesting (what ever the field of interest may be), or have his/her own how-to-pages within their space, or some place to host an online withe-boarding session with friends, etc... Maybe something like this can get a few more folks involved in web2py? I don't know how or of this is something possible (or may even be a silly idea), but would certainly grab my attention, and if it were doable, the tinker may enjoy making use web2py built (pre-built) widgets and go a little beyond the usual Hi, this is me, and this is my picture, and I read books, and that's me 20 years ago, etc..., maybe place where he/she can announce Next wednesday, I will be hosting a talk followed by a QA on how to turn an old swing set into a collapsable bed-frame :) So, something that looks like content sharing, ownership and creation... Maybe a scaffolding app that has an api that easily (relatively speaking) integrates to a web2py-ish widgets? ANyways, just thinking, what would be a little more hands on and still offer the thrill of networking socially... and who knows, maybe the really smart guy/girls out there makes a widget to enable real time web conferencing for this app? then maybe folks out there are asking where's web2py and how do I get some? or disregard this post if wacky (and no, I do not sleep a lot) :) Mart :) On Jan 17, 4:13 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I agree this does not address your issue. On Jan 17, 2:44 pm, mart msenecal...@gmail.com wrote: I am mostly thinking of the kids and parents' paranoia (like mine ;) ), where they need to start with something that is like what everyone else is doing, but safely and securely... I still think that the younger crowd are overlooked and excluded from the good stuff (and they do get the good stuff on their own...) but that's just my humble opinion :) Your social networking idea is great BTW! Mart ) On Jan 17, 3:01 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: True. But now we have that. We need to think of something different and better, not copy it. On Jan 17, 1:55 pm, Albert Abril albert.ab...@gmail.com wrote: IMHO, I think that the best feature of facebook is that you can share things (links, video, music), with a subgroup of friends. In example, you if you have a group of friends that you know that they love music, you share music videos with them. (and only with them). Another example, the familiar christhmas photos, you'll share only with members of your family (another subgroup of friends). Albert On Mon, Jan 17, 2011 at 8:43 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Most social network assue you know who your friends are and allow you to share info with your friends. How about the opposite? Something like a bookmarking app that tells me who my friends should be based on physical distance and recent common bookmarks? It seems to me the main problem to me is that a lot of people are alone they because do not necessarily share interests with their colleagues and family members. Facebook is popular because it allows people to connect with people that they knew and therefore assume had something in common. Until people find out time has passed by and there is not really much to talk about. You can be a scientist and soon find your page polluted with somebody's horoscope. - a bookmarking system likehttp://radbox.me/ - when you bookmark something you tag with fixed categories - a way to sort/organize and rate own bookmarks using mouse drag and drop. - you have a profile and public pages showing your bookmarks only (can be used by a prof to share links with students for example) - Once logged in you can see other users nearby that bookmarked - independently - the same links, and filter then by location, gender, age, bookmark category (could compete with match.com too) - You can then choose to be notified when a given person bookmarks something new (like twitter) - You can check who is following your bookmarks. Massimo
[web2py] Unable to compile application with dynamic {{include ...}} directives
Hello Everybody, when trying to compile an application an error occurs, which seems to be caused by dynamic arguments of {{include ...}} statements within a view template e.g.: {{if session.language!=None:}} {{include 'pageheader_%s.html' % session.language}} {{else:}} {{include 'pageheader_%s.html' % session.preferredLanguage}} {{pass}} I would appreciate being able to compile an application even with such dynamic {{include}} statements. Any suggestions are welcome. Thanks, Toni amue...@chartup.de http://www.chartup.de
Re: [web2py] Re: Is there a way to remove application name from URL()?
On Jan 17, 2011, at 1:06 PM, Bob wrote: In attempt to get some response I'll try to clarify/simplify my question. After rewriting with routes.py I have my app accessible as: http://127.0.0.1/ But all the internal links, created with the URL() function come as: http://127.0.0.1/myapp/ And obviously they don't work. Is there no way to tell the URL() function not to prepend app name to the URLs? As David mentioned, you can rename your app 'init' and get some of this to happen. It won't delete all mention of the app name, though--only when it can also delete the controller and function name. If you don't want to change your app name, you can create (in web2py's base directory) a file named routes.py with nothing in it but this line: default_application = 'myapp' But to get the app name deleted on a more systematic basis, you'll need to write a more elaborate routes.py. There's a new version coming along, in beta in the trunk right now, that should be available for more general use pretty soon, so if you're not in a hurry, just go with one of the above solutions for now, and when the new rewrite logic is ready for prime time you can add a couple more lines in routes.py and be done with it. If you're in more of a hurry, use the existing rewrite logic; it's not going away, but it's a little trickier to set up.
[web2py] Problems with the list Appliances in the Web2py site
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, When I try to load some of the pages of the appliances I get messages like this on several of them: http://web2py.com/appliances/default/show/31 Internal error Ticket issued: appliances/190.157.197.120.2011-01-17.23-02-20.20e32423-67f9-4fa2-b843-8fc55502a40d I want to show web2py and its appliances to members of my local free software community here so any help is appreciated. Cheers, Offray -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJNNMmWAAoJEGiex2828ICwED4IANHaf8CBYNsp5PAQgJDGUR5C hJCgdP5y16BdD/CxslFVF+Tj2c37pkx00olQBUv2ebaCGr3H69CB0BsUHwZlukO/ Yv6Xni/ttlDXh/5sCD8QnjBDv1gcHudFlyQYxgKy512aGxoacNYSEf8ukL+1F8N6 B7tMEByerdPyhLfhvZ8Yow2SgnTDvkUED85fjY7jaY0xebLw5VeKEKOl8GTcOCxr ZFHbG7mRSnqJNc2Jknoy7veDN1jlZ18dRXgdtO22NVHeCAzwVdEiNzlBgk1/GfIB FcinD8Gut+32H01yMFio+96w/I54VN2LxdNGbLMWij3RRnEXFxt5yfAfCfK9imE= =p85t -END PGP SIGNATURE-
[web2py] Re: Apache, Wsgi problem
Thanks. I fixed this. The performance seems to be a little better (requests/second), but the error is still there. On Jan 17, 2:20 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You should really have db = DAL('postgres://name:password@localhost:5432/db',pool_size=20) The reason is that client-server databases may set a max to number of open connections and it takes time to perform the 3-way handshake to establish a new connection at every http request. Without pooling you may hit the max sooner than you should. This will also make your app faster. Massimo On Jan 17, 1:39 pm, VP vtp2...@gmail.com wrote: Here it is with private information replaced with generic information. if request.env.web2py_runtime_gae: # if running on Google App Engine db = DAL('gae') # connect to Google BigTable session.connect(request, response, db = db) # and store sessions and tickets there else: # else use a normal relational database db = DAL('postgres://name:password@localhost:5432/db') # db = DAL('sqlite://storage.sqlite') On Jan 17, 1:19 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Are you using connection pooling? Can I see the line db = DAL(...)? On Jan 16, 2:24 pm, VP vtp2...@gmail.com wrote: Kenneth (see post above) had the same problem with MySQL. On Jan 16, 3:55 am, ron_m ron.mco...@gmail.com wrote: Is there any chance to try another server based database such as MySQL. Since SQLite did not exhibit a problem that is a valid data point but it is an embedded database so called directly by the web2py server code instead of using a driver. There is a possibility there is a problem with the driver on PostgreSQL if the connections are being reused in a pool. This is very difficult to find without some further logging. I gather the page request you see failing as a user simply never completes. I saw this once while testing the application but the loading is only myself running tests. I use PostgreSQL in this app but I also have a version that runs on MySQL which has only a connection string difference plus the content of the databases directory. Maybe I can try this tomorrow, it is almost 2 am here so I don't want to start something new right now. I just need to learn how to use ab which I take it isn't going to be much to figure out.
[web2py] Re: Apache, Wsgi problem
I have pool_size=100, and get the error. On Jan 17, 12:20 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You should really have db = DAL('postgres://name:password@localhost:5432/db',pool_size=20) The reason is that client-server databases may set a max to number of open connections and it takes time to perform the 3-way handshake to establish a new connection at every http request. Without pooling you may hit the max sooner than you should. This will also make your app faster. Massimo On Jan 17, 1:39 pm, VP vtp2...@gmail.com wrote: Here it is with private information replaced with generic information. if request.env.web2py_runtime_gae: # if running on Google App Engine db = DAL('gae') # connect to Google BigTable session.connect(request, response, db = db) # and store sessions and tickets there else: # else use a normal relational database db = DAL('postgres://name:password@localhost:5432/db') # db = DAL('sqlite://storage.sqlite') On Jan 17, 1:19 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Are you using connection pooling? Can I see the line db = DAL(...)? On Jan 16, 2:24 pm, VP vtp2...@gmail.com wrote: Kenneth (see post above) had the same problem with MySQL. On Jan 16, 3:55 am, ron_m ron.mco...@gmail.com wrote: Is there any chance to try another server based database such as MySQL. Since SQLite did not exhibit a problem that is a valid data point but it is an embedded database so called directly by the web2py server code instead of using a driver. There is a possibility there is a problem with the driver on PostgreSQL if the connections are being reused in a pool. This is very difficult to find without some further logging. I gather the page request you see failing as a user simply never completes. I saw this once while testing the application but the loading is only myself running tests. I use PostgreSQL in this app but I also have a version that runs on MySQL which has only a connection string difference plus the content of the databases directory. Maybe I can try this tomorrow, it is almost 2 am here so I don't want to start something new right now. I just need to learn how to use ab which I take it isn't going to be much to figure out.
[web2py] Re: social network idea
What I proposed allows you post links and organize them. Why should the social network handle content? I can post a video on viemo,bookmark it with my network and find out who else is interested in it. I like the idea of being able to handle groups of users though. Facebook does it. In a sense a group is just like a user that does not correspond to a physical person. Massimo On Jan 17, 4:15 pm, mart msenecal...@gmail.com wrote: How about something for the tinkers? Something like one of those super malls but for social networking. A place as varied in its members as it is in content? For example, assuming that life is more than just being about sharing pictures and one-liners on somebody's wall (not that there's anything bad about that because it is always fun), the tinker may like to make use of tools (or mini-apps or usable plug-ins) to do things like hosting an amateur seminar on... well, hopefully on something interesting (what ever the field of interest may be), or have his/her own how-to-pages within their space, or some place to host an online withe-boarding session with friends, etc... Maybe something like this can get a few more folks involved in web2py? I don't know how or of this is something possible (or may even be a silly idea), but would certainly grab my attention, and if it were doable, the tinker may enjoy making use web2py built (pre-built) widgets and go a little beyond the usual Hi, this is me, and this is my picture, and I read books, and that's me 20 years ago, etc..., maybe place where he/she can announce Next wednesday, I will be hosting a talk followed by a QA on how to turn an old swing set into a collapsable bed-frame :) So, something that looks like content sharing, ownership and creation... Maybe a scaffolding app that has an api that easily (relatively speaking) integrates to a web2py-ish widgets? ANyways, just thinking, what would be a little more hands on and still offer the thrill of networking socially... and who knows, maybe the really smart guy/girls out there makes a widget to enable real time web conferencing for this app? then maybe folks out there are asking where's web2py and how do I get some? or disregard this post if wacky (and no, I do not sleep a lot) :) Mart :) On Jan 17, 4:13 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I agree this does not address your issue. On Jan 17, 2:44 pm, mart msenecal...@gmail.com wrote: I am mostly thinking of the kids and parents' paranoia (like mine ;) ), where they need to start with something that is like what everyone else is doing, but safely and securely... I still think that the younger crowd are overlooked and excluded from the good stuff (and they do get the good stuff on their own...) but that's just my humble opinion :) Your social networking idea is great BTW! Mart ) On Jan 17, 3:01 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: True. But now we have that. We need to think of something different and better, not copy it. On Jan 17, 1:55 pm, Albert Abril albert.ab...@gmail.com wrote: IMHO, I think that the best feature of facebook is that you can share things (links, video, music), with a subgroup of friends. In example, you if you have a group of friends that you know that they love music, you share music videos with them. (and only with them). Another example, the familiar christhmas photos, you'll share only with members of your family (another subgroup of friends). Albert On Mon, Jan 17, 2011 at 8:43 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Most social network assue you know who your friends are and allow you to share info with your friends. How about the opposite? Something like a bookmarking app that tells me who my friends should be based on physical distance and recent common bookmarks? It seems to me the main problem to me is that a lot of people are alone they because do not necessarily share interests with their colleagues and family members. Facebook is popular because it allows people to connect with people that they knew and therefore assume had something in common. Until people find out time has passed by and there is not really much to talk about. You can be a scientist and soon find your page polluted with somebody's horoscope. - a bookmarking system likehttp://radbox.me/ - when you bookmark something you tag with fixed categories - a way to sort/organize and rate own bookmarks using mouse drag and drop. - you have a profile and public pages showing your bookmarks only (can be used by a prof to share links with students for example) - Once logged in you can see other users nearby that bookmarked - independently - the same links, and filter then by location,
[web2py] Re: Typo in compile_app() function in admin/controllers/default.py
thanks. fixing in trunk. On Jan 17, 4:02 pm, anton.mue...@googlemail.com anton.mue...@googlemail.com wrote: Hello everybody, a wrongly set closing bracket seems to prevent output of the code in case of failed compilation of an application. In the function compile_app() in the file applications/admin/ controllers/default.py, line 266/267 truncate the function T(...) after 'app:'), and let CODE(c) be an argument to the DIV(...)- function: e.g.: session.flash = DIV(T('Cannot compile: there are errors in your app:'), CODE(c)) If you do so, the code is shown again if compilation fails. Greetings, Toni amue...@chartup.de http://www.chartup.de
[web2py] Re: Unable to compile application with dynamic {{include ...}} directives
this is not possible because includes and extends must be resolved before compilation, not at runtime On Jan 17, 4:44 pm, anton.mue...@googlemail.com anton.mue...@googlemail.com wrote: Hello Everybody, when trying to compile an application an error occurs, which seems to be caused by dynamic arguments of {{include ...}} statements within a view template e.g.: {{if session.language!=None:}} {{include 'pageheader_%s.html' % session.language}} {{else:}} {{include 'pageheader_%s.html' % session.preferredLanguage}} {{pass}} I would appreciate being able to compile an application even with such dynamic {{include}} statements. Any suggestions are welcome. Thanks, Toni amue...@chartup.de http://www.chartup.de
[web2py] Re: Apache, Wsgi problem
Can you share any more info you have about the errors? Does it happen with every action? Is there one in particular? What does it do? Do you use session? Do you use cache? Can you show us any code? Can you build a minimalist app to reproduce it? Are there a minimum number of steps to reproduce it? Massimo On Jan 17, 5:51 pm, Michael Toomim too...@gmail.com wrote: I have pool_size=100, and get the error. On Jan 17, 12:20 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You should really have db = DAL('postgres://name:password@localhost:5432/db',pool_size=20) The reason is that client-server databases may set a max to number of open connections and it takes time to perform the 3-way handshake to establish a new connection at every http request. Without pooling you may hit the max sooner than you should. This will also make your app faster. Massimo On Jan 17, 1:39 pm, VP vtp2...@gmail.com wrote: Here it is with private information replaced with generic information. if request.env.web2py_runtime_gae: # if running on Google App Engine db = DAL('gae') # connect to Google BigTable session.connect(request, response, db = db) # and store sessions and tickets there else: # else use a normal relational database db = DAL('postgres://name:password@localhost:5432/db') # db = DAL('sqlite://storage.sqlite') On Jan 17, 1:19 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Are you using connection pooling? Can I see the line db = DAL(...)? On Jan 16, 2:24 pm, VP vtp2...@gmail.com wrote: Kenneth (see post above) had the same problem with MySQL. On Jan 16, 3:55 am, ron_m ron.mco...@gmail.com wrote: Is there any chance to try another server based database such as MySQL. Since SQLite did not exhibit a problem that is a valid data point but it is an embedded database so called directly by the web2py server code instead of using a driver. There is a possibility there is a problem with the driver on PostgreSQL if the connections are being reused in a pool. This is very difficult to find without some further logging. I gather the page request you see failing as a user simply never completes. I saw this once while testing the application but the loading is only myself running tests. I use PostgreSQL in this app but I also have a version that runs on MySQL which has only a connection string difference plus the content of the databases directory. Maybe I can try this tomorrow, it is almost 2 am here so I don't want to start something new right now. I just need to learn how to use ab which I take it isn't going to be much to figure out.
[web2py] Re: Problems with the list Appliances in the Web2py site
oops. sorry fixed. My fault. I Changed something and saved incomplete. On Jan 17, 4:58 pm, Offray Vladimir Luna Cárdenas off...@riseup.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, When I try to load some of the pages of the appliances I get messages like this on several of them: http://web2py.com/appliances/default/show/31 Internal error Ticket issued: appliances/190.157.197.120.2011-01-17.23-02-20.20e32423-67f9-4fa2-b843-8fc5 5502a40d I want to show web2py and its appliances to members of my local free software community here so any help is appreciated. Cheers, Offray -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJNNMmWAAoJEGiex2828ICwED4IANHaf8CBYNsp5PAQgJDGUR5C hJCgdP5y16BdD/CxslFVF+Tj2c37pkx00olQBUv2ebaCGr3H69CB0BsUHwZlukO/ Yv6Xni/ttlDXh/5sCD8QnjBDv1gcHudFlyQYxgKy512aGxoacNYSEf8ukL+1F8N6 B7tMEByerdPyhLfhvZ8Yow2SgnTDvkUED85fjY7jaY0xebLw5VeKEKOl8GTcOCxr ZFHbG7mRSnqJNc2Jknoy7veDN1jlZ18dRXgdtO22NVHeCAzwVdEiNzlBgk1/GfIB FcinD8Gut+32H01yMFio+96w/I54VN2LxdNGbLMWij3RRnEXFxt5yfAfCfK9imE= =p85t -END PGP SIGNATURE-
Re: [web2py] Re: Testing the new router
On Jan 17, 2011, at 9:38 AM, Martín Mulone wrote: return LOAD('plugin_comments','comments.load',args=[tablename, record_id, page],ajax=True) File /home/martin/Repositorios/google_appengine/web2py/gluon/compileapp.py, line 145, in __call__ extension=extension) File /home/martin/Repositorios/google_appengine/web2py/gluon/html.py, line 262, in URL acf = rewrite.map_url_out(application, controller, function, args, r or _request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 867, in map_url_out map = MapUrlOut(application, controller, function, args, request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 722, in __init__ self.domain_application = self.request.env.domain_application AttributeError: 'NoneType' object has no attribute 'env' I start to test, but I have this error In GAE Hopefully this is now fixed in the trunk. I wasn't able to test it, but at the very least it should do no harm, and it should fix this particular problem.
[web2py] Re: upload widgets problem with nullable compound validators
Thanks for your support! Maybe the adopted one is much consistent. On 1月18日, 午前1:21, Massimo Di Pierro massimo.dipie...@gmail.com wrote: IS_NULL_OR([IS_XXX(..), IS_YYY(..), ..]) in trunk now. Good suggestion although I think an internal refactoring is in order. On Jan 16, 10:57 pm, kenji4569 hos...@s-cubism.jp wrote: I ended up with making a custom validator IS_ALL for the problem: IS_NULL_OR(IS_ALL([IS_XXX(..), IS_YYY(..), ..]) and it works. The alternatives could be to permit the follwoing interfaces, which need patches though: IS_NULL_OR([IS_XXX(..), IS_YYY(..), ..]) or [IS_NULL_OR(IS_XXX(..)), IS_NULL_OR(IS_YYY(..)), ..] (the first one) What do you think? Thanks in advance, Kenji On 1月12日, 午後10:57, Massimo Di Pierro massimo.dipie...@gmail.com wrote: good catch. Let me think about this... On Jan 12, 1:12 am, kenji4569 hos...@s-cubism.jp wrote: I applied the follwing validators for upload fields in version 1.91.6: requires = [ IS_NULL_OR(IS_UPLOAD_FILENAME(extension='pdf')), IS_NULL_OR(IS_LENGTH(1048576, 1024)), ] Everything was fine until I used a SQLFORM object with an upload keyword for editing. Then, a delete checkbox of an upload widget falsely disappeared which should be displayed with a link to the uploaded file. This is the result of the code in UploadWidget class of gluon/ sqlhtml.py: if requires == [] or isinstance(requires, IS_EMPTY_OR): inp = DIV(, ..., UploadWidget.ID_DELETE_SUFFIX), ...) And, the next patch would tentatively fix the problem: if (requires == [] or isinstance(requires, IS_EMPTY_OR) or (isinstance(requires, (list, tuple)) and reduce(lambda a,b:ab, [isinstance(r, IS_EMPTY_OR) for r in requires]))): ... But, I am not sure if the above patch is smart. Is there any way to implement such validation without patches nor custom validators?
[web2py] Re: Apache, Wsgi problem
The problem for me is that this occurs on a webapp used by mechanical turk, and it fails when I have hundreds of mechanical turkers using my app... which only happens when I pay them hundreds of dollars. So it's hard to reproduce right now without hundreds of dollars. I am excited to try using VP's ab benchmark to try to reproduce the error more cheaply. When I can do that, and get a minimal system exhibiting the error, I will let you know. I'm also currently using an older version of web2py. One pre-DAL. On Jan 17, 12:20 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You should really have db = DAL('postgres://name:password@localhost:5432/db',pool_size=20) The reason is that client-server databases may set a max to number of open connections and it takes time to perform the 3-way handshake to establish a new connection at every http request. Without pooling you may hit the max sooner than you should. This will also make your app faster. Massimo On Jan 17, 1:39 pm, VP vtp2...@gmail.com wrote: Here it is with private information replaced with generic information. if request.env.web2py_runtime_gae: # if running on Google App Engine db = DAL('gae') # connect to Google BigTable session.connect(request, response, db = db) # and store sessions and tickets there else: # else use a normal relational database db = DAL('postgres://name:password@localhost:5432/db') # db = DAL('sqlite://storage.sqlite') On Jan 17, 1:19 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Are you using connection pooling? Can I see the line db = DAL(...)? On Jan 16, 2:24 pm, VP vtp2...@gmail.com wrote: Kenneth (see post above) had the same problem with MySQL. On Jan 16, 3:55 am, ron_m ron.mco...@gmail.com wrote: Is there any chance to try another server based database such as MySQL. Since SQLite did not exhibit a problem that is a valid data point but it is an embedded database so called directly by the web2py server code instead of using a driver. There is a possibility there is a problem with the driver on PostgreSQL if the connections are being reused in a pool. This is very difficult to find without some further logging. I gather the page request you see failing as a user simply never completes. I saw this once while testing the application but the loading is only myself running tests. I use PostgreSQL in this app but I also have a version that runs on MySQL which has only a connection string difference plus the content of the databases directory. Maybe I can try this tomorrow, it is almost 2 am here so I don't want to start something new right now. I just need to learn how to use ab which I take it isn't going to be much to figure out.
[web2py] Re: Apache, Wsgi problem
How old web2py? We have had bugs in the past that may cause your problem. You should try upgrade. Massimo On Jan 17, 6:58 pm, Michael Toomim too...@gmail.com wrote: The problem for me is that this occurs on a webapp used by mechanical turk, and it fails when I have hundreds of mechanical turkers using my app... which only happens when I pay them hundreds of dollars. So it's hard to reproduce right now without hundreds of dollars. I am excited to try using VP's ab benchmark to try to reproduce the error more cheaply. When I can do that, and get a minimal system exhibiting the error, I will let you know. I'm also currently using an older version of web2py. One pre-DAL. On Jan 17, 12:20 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You should really have db = DAL('postgres://name:password@localhost:5432/db',pool_size=20) The reason is that client-server databases may set a max to number of open connections and it takes time to perform the 3-way handshake to establish a new connection at every http request. Without pooling you may hit the max sooner than you should. This will also make your app faster. Massimo On Jan 17, 1:39 pm, VP vtp2...@gmail.com wrote: Here it is with private information replaced with generic information. if request.env.web2py_runtime_gae: # if running on Google App Engine db = DAL('gae') # connect to Google BigTable session.connect(request, response, db = db) # and store sessions and tickets there else: # else use a normal relational database db = DAL('postgres://name:password@localhost:5432/db') # db = DAL('sqlite://storage.sqlite') On Jan 17, 1:19 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Are you using connection pooling? Can I see the line db = DAL(...)? On Jan 16, 2:24 pm, VP vtp2...@gmail.com wrote: Kenneth (see post above) had the same problem with MySQL. On Jan 16, 3:55 am, ron_m ron.mco...@gmail.com wrote: Is there any chance to try another server based database such as MySQL. Since SQLite did not exhibit a problem that is a valid data point but it is an embedded database so called directly by the web2py server code instead of using a driver. There is a possibility there is a problem with the driver on PostgreSQL if the connections are being reused in a pool. This is very difficult to find without some further logging. I gather the page request you see failing as a user simply never completes. I saw this once while testing the application but the loading is only myself running tests. I use PostgreSQL in this app but I also have a version that runs on MySQL which has only a connection string difference plus the content of the databases directory. Maybe I can try this tomorrow, it is almost 2 am here so I don't want to start something new right now. I just need to learn how to use ab which I take it isn't going to be much to figure out.
[web2py] Re: Apache, Wsgi problem
1.74.5. I will upgrade when I can reproduce the problem locally. On Jan 17, 5:13 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: How old web2py? We have had bugs in the past that may cause your problem. You should try upgrade. Massimo On Jan 17, 6:58 pm, Michael Toomim too...@gmail.com wrote: The problem for me is that this occurs on a webapp used by mechanical turk, and it fails when I have hundreds of mechanical turkers using my app... which only happens when I pay them hundreds of dollars. So it's hard to reproduce right now without hundreds of dollars. I am excited to try using VP's ab benchmark to try to reproduce the error more cheaply. When I can do that, and get a minimal system exhibiting the error, I will let you know. I'm also currently using an older version of web2py. One pre-DAL. On Jan 17, 12:20 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You should really have db = DAL('postgres://name:password@localhost:5432/db',pool_size=20) The reason is that client-server databases may set a max to number of open connections and it takes time to perform the 3-way handshake to establish a new connection at every http request. Without pooling you may hit the max sooner than you should. This will also make your app faster. Massimo On Jan 17, 1:39 pm, VP vtp2...@gmail.com wrote: Here it is with private information replaced with generic information. if request.env.web2py_runtime_gae: # if running on Google App Engine db = DAL('gae') # connect to Google BigTable session.connect(request, response, db = db) # and store sessions and tickets there else: # else use a normal relational database db = DAL('postgres://name:password@localhost:5432/db') # db = DAL('sqlite://storage.sqlite') On Jan 17, 1:19 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Are you using connection pooling? Can I see the line db = DAL(...)? On Jan 16, 2:24 pm, VP vtp2...@gmail.com wrote: Kenneth (see post above) had the same problem with MySQL. On Jan 16, 3:55 am, ron_m ron.mco...@gmail.com wrote: Is there any chance to try another server based database such as MySQL. Since SQLite did not exhibit a problem that is a valid data point but it is an embedded database so called directly by the web2py server code instead of using a driver. There is a possibility there is a problem with the driver on PostgreSQL if the connections are being reused in a pool. This is very difficult to find without some further logging. I gather the page request you see failing as a user simply never completes. I saw this once while testing the application but the loading is only myself running tests. I use PostgreSQL in this app but I also have a version that runs on MySQL which has only a connection string difference plus the content of the databases directory. Maybe I can try this tomorrow, it is almost 2 am here so I don't want to start something new right now. I just need to learn how to use ab which I take it isn't going to be much to figure out.
[web2py] Re: Testing the new router
Hi Jonathan, As it turns out I'd mistakenly left a handler in my app.yaml that was causing the problem. Really sorry to have wasted your time on this. Otherwise the new routing code seems to be working really well. Much simpler which is fantastic! Thanks again for your help, Matt On Jan 18, 1:21 pm, Jonathan Lundell jlund...@pobox.com wrote: On Jan 17, 2011, at 9:38 AM, Martín Mulone wrote: return LOAD('plugin_comments','comments.load',args=[tablename, record_id, page],ajax=True) File /home/martin/Repositorios/google_appengine/web2py/gluon/compileapp.py, line 145, in __call__ extension=extension) File /home/martin/Repositorios/google_appengine/web2py/gluon/html.py, line 262, in URL acf = rewrite.map_url_out(application, controller, function, args, r or _request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 867, in map_url_out map = MapUrlOut(application, controller, function, args, request) File /home/martin/Repositorios/google_appengine/web2py/gluon/rewrite.py, line 722, in __init__ self.domain_application = self.request.env.domain_application AttributeError: 'NoneType' object has no attribute 'env' I start to test, but I have this error In GAE Hopefully this is now fixed in the trunk. I wasn't able to test it, but at the very least it should do no harm, and it should fix this particular problem.
[web2py] Need web2py developer/consultant
My friend needs a web2py developer/consultant for a project. The person must be located in Singapore to participate in their brainstorming etc. (and since I am on the move, I am unable to do it) Any one interested, please contact Daniel by email: yarden...@gmail.com Regards Anand
[web2py] Need web2py developer/consultant
My friend needs a web2py proficient consultant/dev to handle the web2py portion of the project. The person must be located in Singapore (or maybe Malaysia and travel to SG) to participate in discussions etc. If you are interested please contact Dennis directly: yarden...@gmail.com
[web2py] Re: web2py tutorial at PyCon 2011 - important
Note, the PyCon early bird prices have been extended to Jan. 25, so it's not too late to get the lower rates. But apparently it's filling up fast (the conference overall, not necessarily the web2py tutorial), so don't wait. http://us.pycon.org/2011/blog/2011/01/17/pycon-early-bird-prices-extended-until-january-25t/ Anthony On Saturday, January 15, 2011 5:47:06 PM UTC-5, Massimo Di Pierro wrote: I will personally reimburse $70 to the first 5 attendees from this list who sign up for the web2py tutorial, if they sign up by next week and email me a proof of registration. Plus everybody who registers within Feb 9 will get a free copy of the printed book. Massimo On Jan 15, 2:49 pm, Anthony abas...@gmail.com wrote: And here's the link to sign up:https://www.cteusa.com/pycon4/(rates are shown here:http://us.pycon.org/2011/tickets/). Note, the tutorials are separate from the main conference, so if you want you can attend one or more tutorials without paying for the full conference. On Saturday, January 15, 2011 3:41:36 PM UTC-5, Anthony wrote: Just signed up for the web2py tutorial. :) Do it by Monday and save $50. Anthony On Saturday, January 15, 2011 3:00:47 PM UTC-5, Massimo Di Pierro wrote: If you are planning to attend, please sign up by next week. Tutorials that do not meet a minimum numbers of attendees by next week, will be cancelled. Massimo
[web2py] Re: account for each user
I found that this line is the error-prone one: records = db(auth.settings.table_user==auth.user).select(db.day.theauth, distinct=True, orderby=db.day.thedate) ...I tested the next version too, but it also gave an error: records = db(db.day.theauth==auth.user).select(db.day.ALL, orderby=db.day.thedate) ...The last version worked, but it doesn't fulfill the function I want it to have, namely to select records that are associated with the user that is logged in: records = db().select(db.day.ALL, orderby=db.day.thedate) Any ideas? On Jan 16, 9:54 pm, Rick sababa.sab...@gmail.com wrote: I suppose that the problem is that the records list isn't completely returned from the controller file to create.html and that the thedate field is lost in that process. On Jan 16, 9:32 pm, Rick sababa.sab...@gmail.com wrote: Hmmm... strange... the error disappeared, but it was replaced by another one: KeyError: 'thedate' ...and this error arises from the html-table in the create.html -- the code works when i delete the table. On Jan 16, 8:40 pm, Rick sababa.sab...@gmail.com wrote: Perhaps the previous post was a bit vague. I meant that create.html works when it only contains {{=form}}. On Jan 16, 8:35 pm, Rick sababa.sab...@gmail.com wrote: Yes, {{=form}} works without the other code. On Jan 16, 6:35 pm, Martín Mulone mulone.mar...@gmail.com wrote: to test, put only {{=form}} in create.html remove all the other. Now the error continue? 2011/1/16 Rick sababa.sab...@gmail.com thanks for the comments. I deleted the #. At the beginning of create.html there is this code: {{import datetime}} {{import uuid}} {{recording=datetime.date(2000,01,01)}} ...but the error remains :( On Jan 16, 2:13 pm, Martin.Mulone mulone.mar...@gmail.com wrote: in create.html #if recording!=record.thedate:} you commented this line but you hasn't commented the pass, the same to {{#session.uuid=record.uuid}} and what is recording??. -- Pablo Martín Mulone (mar...@tecnodoc.com.ar)http://www.tecnodoc.com.ar/ Paraná, Entre Ríos, Argentina (CP 3100). My blog:http://martin.tecnodoc.com.ar Expert4Solution Profile:http://www.experts4solutions.com/e4s/default/expert/6
Re: [web2py] Re: Testing the new router
On Jan 17, 2011, at 6:03 PM, Matt wrote: As it turns out I'd mistakenly left a handler in my app.yaml that was causing the problem. Really sorry to have wasted your time on this. Otherwise the new routing code seems to be working really well. Much simpler which is fantastic! Don't worry about it; I'm happy it's working for you.
Re: [web2py] social network idea
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, This discussion is in perfect timing for me. I'm coming back to this community and still I'm learning the basics, but I have already thought some project to make in order to learn web2py that are similar with this idea. I would talk about this projects and how they have changed, so this thought path may help to the discussion on this idea (none of them is actualy implemented or explored and I have just putting web2py online after exploring * My first project was trying to make a url shorter with social features, like tagging and sharing and some personalized information for registered users. The advantage was that I have not to create a a new social network but just connect the new one (url shorter) with the existing ones of microblogging (twitter, identica, etc). The problem here is to make explicit the added value of the social url shorter in the wide range of available options (not many of them have social features and are free software). The idea was adding some kind of p2p architecture to solve the main complain about url shorters as a single point of failure for web addresses. (For Spanish readers in [1] is the detailed description). [1] http://holonica.net/home/libertica/un-acortador-de-direcciones-diferente-distribuido-y-con-valor-agregado * The second project I thought was something like {Google Buzz / Soupio} + {Gitorius}. I don't like social networks, really I don't, because they're not designed for collective creation like wikis or code repositories, just socialization, which is fine, but not enough. That's why I use identi.ca frequently but I still am searching for something that has the dynamism of microblog/soupio/buzz but still let you fork or co-create things with the people you follow. I was thinking in something distributed, portable, self-contained and minimal as a back end, and that's why I asked about fossil-scm + web2py integration and pointed to the unhosted[2] project. I imagine flows of content being created, published, shared, forked and recombined by the users of this network. I have not seen something distributed that combines social networking and collective creation (diaspora is more like a distributed and privacy aware facebook). [2] http://unhosted.org/ Of course this are just newbie ideas and I don't know how difficult they're to implement or how valuable are for the rest of the community, but now that we're on brainstorming I want to put this on the table. Thanks, Offray El 17/01/11 14:43, Massimo Di Pierro escribió: Most social network assue you know who your friends are and allow you to share info with your friends. How about the opposite? Something like a bookmarking app that tells me who my friends should be based on physical distance and recent common bookmarks? It seems to me the main problem to me is that a lot of people are alone they because do not necessarily share interests with their colleagues and family members. Facebook is popular because it allows people to connect with people that they knew and therefore assume had something in common. Until people find out time has passed by and there is not really much to talk about. You can be a scientist and soon find your page polluted with somebody's horoscope. - a bookmarking system like http://radbox.me/ - when you bookmark something you tag with fixed categories - a way to sort/organize and rate own bookmarks using mouse drag and drop. - you have a profile and public pages showing your bookmarks only (can be used by a prof to share links with students for example) - Once logged in you can see other users nearby that bookmarked - independently - the same links, and filter then by location, gender, age, bookmark category (could compete with match.com too) - You can then choose to be notified when a given person bookmarks something new (like twitter) - You can check who is following your bookmarks. Massimo -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJNNRH5AAoJEGiex2828ICw9UcIAKy0b4c96CKI+Km0kOTkYZtG 2cyZNOHpNv2U9UK5IeRkKXzIIpZ7kmxfMZzZhyXEdlJUohyv1KmEvNHYUldgGd+B G2gjmLHbaCRRTiey0XJnj0yPaNGMBcrwZKu+LpAwpcq2IQhZSqeCHC4oyo4+3bob cCih8kqvwTQia999m4IxBbxzBJFIJ+zVk14Sk+KRcvUJ3Ectx19/vs7vKuRLu2AL IDswumDY1oLTaebmt8v7xgTObQWeH4+jlnJOWeYYnYVTwKUUn0sb7vrYrIyDxab8 WeuWMzRx8t7Fw3e2WmPOVvi5Pf+bZucvd2qb0KSQ81dq+KAkiyQmHwOkANYYUWo= =hkQu -END PGP SIGNATURE-
[web2py] Re: doesn't represents in a string format
nope, i did a test and confirmed that this behavior is the same for older and newer versions of web2py. so to get the name field from the referenced table to show, you need to add a represent parameter to your field construction: db.define_table('stuff', Field('name', 'string', notnull=True, unique=True, requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db,'stuff.name')]), format='%(name)s', migrate=migrate) db.define_table('refers_to_stuff', Field('stuff', db.stuff, requires=IS_IN_DB(db, db.stuff.id, '%(name)s'), represent=lambda x: db.stuff[x].name), migrate=migrate) and i confirmed that my other post was misguided. in older versions of web2py you need a represent on referenced read-only fields as well if you want them to display something other than the ID.
[web2py] Re: SQLFORM and read-only references
it seems that upon further testing this is not a problem. i don't know what i was doing when this showed up. sorry for the noise. cfh