[web2py] Re: built in web2py datepicker bug with Google Chrome
Hi everyone, Tips: the patch is accepted in trunk. But, hg pull; hg update is not enough to make it work. You need to tell web2py to reload the new scaffold app by manually touch a file /home/you/web2py/NEWINSTALL and then restart your web2py. On Jul1, 8:01pm, Iceberg iceb...@21cn.com wrote: I met this issue recently. And thank you so much for the nudge about suspecting Chrome. That gave me the direction, then I found comment 232 of this thread: http://www.dynarch.com/projects/calendar/old/ I think Massimo need to include that patch into web2py's welcome app. Regards, Iceberg
[web2py] Installation of a application fails
Hello, yesterday I tried to install Editable jqgrid from Eban software but I get 'unable to install application testing'. What I read on the web about this is that there is somekind of problem with read/write rights. Trying to solve this I used the chown apache:web2py * -R command on my web2py directory. I can´t find any logs where I could read why installation fails. Kenneth
[web2py] Re: Password verification - how to?
If you have a custom form, you should perform two steps: 1) manually insert the passoword 2 in the form tr thlabel for=password id=password{{=lbl.password}}/ label/th td{{=wdgt.password}}td /tr tr ...tdinput name=password2 /{{if form.errors.password2:}} div class=errorNO MATCH/div{{pass}}/td /tr 2) serverside you just do form.append(INPUT(_name='password2',requires=IS_EXPR('value=%s' % repr(request.vars.password))) On 6 Lug, 18:30, elfuego1 elfue...@gmail.com wrote: Password field in my form looks like this: tr thlabel for=password id=password{{=lbl.password}}/ label/th td{{=wdgt.password}}td /tr Next how should I invoke: form.element(_name='password').parent().append(INPUT(_name='password2',requires=IS_EXPR('value= %s' % repr(request.vars.password)) )) to recive next input field for password verification? How should I define TD=??? to have it working? On 6 Lip, 20:28, mdmcginn michael.d.mcgin...@gmail.com wrote: Seehttp://web2py.com/book/default/section/5/2fordocumentation on HTML Helpers. I believe Massimo's solution assumes there are tables in your form, which is the default for FORM and SQLFORM. If your form doesn't contain HTML elements such as tabletrtd, maybe you're using div or span instead. Look at your HTML - hopefully there is some semantic/DOM code in there that you could hook into. If you're depending on br to format your form instead, Massimo's solution probably won't help you much (and neither will CSS or AJAX). On Jul 6, 1:27 am, elfuego1 elfue...@gmail.com wrote: No, I don't. So does TD supposed to work as a variable or list? And what if I'd like to use form.element again? Do I append another form.element to TD and us it as a list? How do I address the value that is assigned to TD: TD[0], TD[1] and why is it TD in the first place? Is out there some description or example of this syntax? Best regards. On 6 Lip, 07:35, KR kaerbu...@gmail.com wrote: Do you have somewhere in your code TD=something ? On 6 juil, 01:18, elfuego1 elfue...@gmail.com wrote: Can you please tell me yet how to implement it, so it would start working in my form and verify thepassword? When I add it to view: user.html or controller default.py then I receive: TypeError: 'TD' object is not callable So please let me know how to use form.element syntax to make it work properly. On 4 Lip, 17:08, mdipierro mdipie...@cs.depaul.edu wrote: form.element(_name=='password').insert(INPUT(_name='password2',requires=IS_ EXPR('value= %s' % repr(request.vars.password)) )) should have been form.element(_name='password').parent().append(INPUT(_name='password2',requ ires=IS_EXPR('value= %s' % repr(request.vars.password)) )) form.element(_name='password') finds the INPUT(name=password) item form.element(_name='password').parent() finds the parent of such element, the TD() form.element(_name='password').parent().append(...) appends something to the TD() INPUT(_name='password2',) is the appened input name=password2 field This: requires=IS_EXPR('value=%s' % repr(request.vars.password)) sets the requirements. i.e. the value ofpasswordis the same as the value of fields request.vars,password On 4 Lug, 09:37, elfuego1 elfue...@gmail.com wrote: I'm trying to make a use of this piece of code but nothing works. Can you please tell me where can I find some fine documentation that shows exactly how to use it or maybe write me an example because I have no idea where to put it in my form to make it work. HELP PLEASE!! form.element(_name=='password').insert(INPUT(_name='password2',requires=IS_ EXPR('value= %s' % repr(request.vars.password)) )) or another example How do I use this piece of code to customize form field length??? form.element(_name='last_name')['_size']=20 Can anyone show me how to do that because there is no example in documentation, no properly written piece of code to meke use of. On 2 Lip, 12:25, elfuego1 elfue...@gmail.com wrote: Thank you for your speedy help!!! On 2 Lip, 12:13, mdipierro mdipie...@cs.depaul.edu wrote: you can do for example (assuming trunk) form.element(_name=='password').insert(INPUT(_name='password2',requires=IS_ EQUAL_TO(request.vars.password))) if you do not use trunk instead of IS_EQUAL_TO(request.vars.password) you can use IS_EXPR('value=%s' % repr(request.vars.password)) On 2 Lug, 04:58, elfuego1 elfue...@gmail.com wrote: Since I am customizing my registration form, can you tell me what to do to havepasswordverificationfunctionality? I don’t know
[web2py] Re: JQGrid Plugin with multiple Databases
The plugin would need to define a list of possible database and pass an index (pointing to an element in the list) during the ajax callback. It seems an un-necessary complication to be implemented in general. Massimo On 6 Lug, 11:59, AsmanCom d.as...@web.de wrote: Could you advise me a Workaround for that? THX Dieter Asman On 6 Jul., 18:16, mdipierro mdipie...@cs.depaul.edu wrote: I see there is a problem. There is no mechanism to pass the database via ajax at this time. On 6 Lug, 10:39, AsmanCom d.as...@web.de wrote: Hi, i´ve tried it, but it won´t work. Installed the new Version from -http://www.web2py.com/plugins/default/jqgrid controller- def jqgrid(): return dict(grid=plugin_jqgrid(db_1.maingrid)) model- db_1 = DAL(sqlite://db1.db) db_1.define_table('maingrid', Field('field1', 'string'), Field('field2', 'string'), Field('field3', 'string'), Field('field4', 'string'), Field('field5', 'string')) The colnames are right, but the Grid is empty. Do you know how I can get this to work? THX Dieter Asman On 5 Jul., 14:00, mdipierro mdipie...@cs.depaul.edu wrote: I have fixed it an uploaded. Please give it a try. On 5 Lug, 04:07, AsmanCom d.as...@web.de wrote: I´ve elready tried to change the controller/plugin_jqgrid.py, by replacing table=db[tablename] if request.vars.fieldname: dbset = db(table[request.vars.fieldname]==request.vars.fieldvalue) else: dbset = db(table.id0) with: table=db_1[tablename] if request.vars.fieldname: dbset = db_1(table[request.vars.fieldname]==request.vars.fieldvalue) else: dbset = db_1(table.id0) But without success. THX On Jul 5, 11:00 am, AsmanCom d.as...@web.de wrote: Hi, I try to get the JQGrid Plugin (http://www.web2py.com/plugins/default/ jqgrid) to work with multiple Databases. Like this: db_1 = DAL(sqlite://db1.db) db_2 = DAL(sqlite://db2.db) db_3 = DAL(sqlite://db3.db) plugin_jqgrid(db_1.shout) But the Grid is empty. If I do it like that, it works: db = DAL(sqlite://db1.db) plugin_jqgrid(db.shout) How to change the plugin to work with multiple Databases? P.S if I put db=db_1 in the model/plugin_jqgrid.py it works but only for 1 DB. Can anyone help? THX
[web2py] Re: web2py prod deployment
In the admin interface there is a button {upgrade now} and it will do this for you. Did you try it? On 6 Lug, 19:35, Jean-Guy jean...@gmail.com wrote: Hello, I already had deployed web2py 1.78.3 in prod with the ubuntu script... I would like to know what is the best way to deploy the web2py 1.79.2 over the already deployed web2py installation (1.78.3) : 1) update of web2py 1.78.3 from the admin interface 2) replace the web2py 1.78.3 folder by the web2py 1.79.2 folder in the www-data folder 3) re-execute the ubuntu script I have the complete control over my ubuntu server. Thanks in advance. Jonhy
[web2py] Re: Will rocket close connections if it takes long time?
Thank you for clarification, Timbo. Is not #3 a problem though? If Rocket doesn't terminate the request if it's running for too long, is not Rocket's thread pool going to be exhausted if it runs too many long running requests? The problem here is that one application could potentially exhaust all working thread, preventing rocket from serving request for other applications. It looks like this is what's happening to one of my server - see this discussion: http://groups.google.com/group/web2py/browse_thread/thread/34f5411692dcbd35 Am I missing something or is this how it's supposed to be? On Jul 5, 12:33 am, Timbo tfarr...@owassobible.org wrote: 1) True 2) Basically true. You seem to indicate that 1 2 should not co- exist or are somehow at odds with each other. If that's what you're indicating, I'm not following your logic as to why they should be mutually exclusive. Can you explain a little more? 3) In Rocket's case, no. While a client could disconnect at anytime, Rocket will allow the application server to run a request as long as it likes. If the client connection is still open when it's ready to send it's response, it will send successfully. Rocket does not kill threads that run for too long. 4) Rocket always applies the socket timeout (rocket.py line 854), this should override Py2.5's default (whatever it may be). Rocket enables Python's socket timeout protection on every Python platform that supports it. Does this clear things up? On Jul 4, 4:30 am, Iceberg iceb...@21cn.com wrote: Thanks for all these info, Tim. You said: The timeout ... is a timeout based on inactivity between http requests. So the long requests that Iceberg is seeing are perfectly normal and acceptable. According to my reading of the rocket-science code (and I could be wrong), here is my understanding and questions: 1. The timeout is a timeout based on inactivity since one request socket's latest select-and-readable event. The time gap could be caused by two http requests which somehow reuse the socket (because keep-alive?), or caused by one very slow http request from a client (possibly a DoS attack). 2. BUT the timeout check is only performed after the request's socket encountered socket.timeout exception. According to line 800 of rocket.py: if typ == SocketTimeout: self.err_log.debug('Socket timed out') self.wait_queue.put(self.conn) And then the request's control is transferred to the Monitor, the timeout check is at line 449 of rocket.py: if now - c.start_time = self.timeout: stale.add(c) 3. What if, a normal request is read from client side within seconds, then being calculated for quite some time on the server side, will this situation trigger the timeout protection? I guess not, because no socket.timeout will be raised during the calculation, although the final calculated result will probably not be sent due to the socket is already timeout or even closed from the client side. If this is true (is it?), then my maintenance scenario is still doable because no result is expected, I only need the maintenance job can be triggered and can run as long as it takes. 4. On the other hand, at least on Windows XP, python 2.5.4, by default, socket has no socket.timeout, so the above check is not performed at all, is it? So the rocket timeout protection is not activated anyway. -- Iceberg On Jul4, 9:26am, Timbo tfarr...@owassobible.org wrote: Rocket has a longer default wait time before it closes connections in comparison to CherryPy. You might check web2py code, it is not likely using the same default timeout as Rocket proper. See:http://packages.python.org/rocket/usage.html#timeout This is a DoS vulnerability on CherryPy but not Rocket because Rocket pushes waiting threads to a monitor queue so that they don't occupy worker threads. The monitor queue can easily handle the socket limit of connections. In this manner, Rocket can handle many thousands of connections without causing new connections to have to wait as CherryPy does. There is a limit on number of active connections, but that limit is the number of worker threads which is configurable:http://packages.python.org/rocket/usage.html#max-threads The timeout mentioned in the link above is a timeout based on inactivity between http requests. So the long requests that Iceberg is seeing are perfectly normal and acceptable. Browsers such as Chrome and FF will leave a connection open for quite some time or until the tab is closed (even if the user has browsed away from the Rocket-running server domain). Rocket basically wants to keep those connections open since they don't cost significantly to wait in the monitor queue. -tim On Jul 3, 9:35 am, mdipierro mdipie...@cs.depaul.edu wrote: Let's wait for Tim to
[web2py] markmin, t2, t3, cube9 etc. (important update)
# Preamble As you know T2 and T3 are deprecated. Some time ago I started a reimplementation of T3 called cube9. I got stuck. I now re-factored it completely - http://code.google.com/p/cube9/ (requires web2py trunk) - It uses markmin: - http://web2py.com/examples/static/markmin.html - cube9 is not completely finished by it works and it already much much better than T2/T3. # What is cube9? Cube 9 is a possible replacement for the welcome app. It is identical to welcome except that - has a different layout - contains a plugin called plugin_wiki (a plugin on steroids) - use a JS menu ## What is plugin_wiki? Plugin_wiki allows a developed (auth.user_id==1 or anybody member of group 'editor') to create dynamic pages on the fly by visiting ``http://127.0.0.1:8000/cube9/plugin_wiki/page/my-new-page-slug`` In fact you do not need cube9 to run plugin_wiki, you can use it for any web2py app. You can use it to add help pages. You can use to allow your users to edit pages. Pages are edited using markmin (via a modified markitup JS editor to support markmin). This email is written using markmin syntax. ## Why plugin_wiki is a plugin on steroids? Because it includes under one name (plugin_wiki) other plugins as embeddable widgets (mediaplyer, comments, tags, multiselect, and more) and there is a way to access them using the markmin syntax. ## A first example For example to include a youtube video in a page you do `` name: youtube code: x1w8hKTJ2Co ``:widget - The double reversed quotes tell markmin to deal with content in a special way. - The :widget tells plugin_wiki to override default behavior and treat this as an embedded widget - the content is treated as parameters (youtube being the name of the widget and x1w8hKTJ2Co being the name of the youtube video you want to embed). There are MANY widgets you can already embed. ## More examples ### Tagging `` name: tags ``:widget ### jqGrid list users `` name: jqgrid table: auth_user ``:widget ### Enbedding a form `` name: create table: auth_user ``:widget ### Embedding template code `` counting... {{for i in range(10):}}{{=i}}{{pass}} ``:template ## Inner workings For a list of widgets look into the static methods of PluginWikiWidgets in models/plugin_wiki.py. The arguments of the methods translate into variables. For example `` class PluginWikiWidgets: # in models/plugin_wiki @staticmethod def abd(x,y=6): ``:code_python is called by `` name: abc x=5 ``:widget (y is optional because y has a default, 6). ### List of Widgets Here is a list of widgets as of today: `` def read(table,record_id=None): ... def create(table,message='',next='',readonly_fields='',hidden_fields='',default_fields=''): ... def update(table,record_id='',message='',next='',readonly_fields='', hidden_fields='',default_fields=''): ... def select(table,query_field='',query_value='',fields=''): ... def search(table,fields=''): ... def jqgrid(table,fieldname=None,fieldvalue=None,col_widths='', _id=None,fields='',col_width=80,width=700,height=300): ... def pie_chart(data,names,width=300,height=150,align='center'): ... def bar_chart(data,names,width=300,height=150,align='center'): ... def youtube(code,width=400,height=250): ... def vimeo(code,width=400,height=250): ... def mediaplayer(src,width=400,height=250): ... def comments(table='None',record_id=None): ... def tags(table='None',record_id=None): ... def tag_cloud(): ... ``:code_python ### Global variables there are two important globals variables: + plugin_wiki_editor = True # or false to disable the wiki + plugin_wiki_level = 3 # for everything, 2 for wiki+widgets, 1 for normal wiki (no code, widgets) ## Conclusions: There is more to this already implemented and there is more to come. For start you can run everything on GAE. Some pages with slug meta-* have special meaning and can be used to edit header, footer, menu, sidebar of cube9 layout. meta-code can be used to define new tables, procedures and services. For security reasons code and widgets can be disabled. I will make a video about this as soon as I have the time (and free up enough memory). Please test it and send me comments. Enjoy! Massimo P.S. I apologize for these names.
[web2py] Re: Password verification - how to?
Serverside - you mean in the controller? On 7 Lip, 13:49, mdipierro mdipie...@cs.depaul.edu wrote: If you have a custom form, you should perform two steps: 1) manually insert the passoword 2 in the form tr thlabel for=password id=password{{=lbl.password}}/ label/th td{{=wdgt.password}}td /tr tr ...tdinput name=password2 /{{if form.errors.password2:}} div class=errorNO MATCH/div{{pass}}/td /tr 2) serverside you just do form.append(INPUT(_name='password2',requires=IS_EXPR('value=%s' % repr(request.vars.password))) On 6 Lug, 18:30, elfuego1 elfue...@gmail.com wrote: Password field in my form looks like this: tr thlabel for=password id=password{{=lbl.password}}/ label/th td{{=wdgt.password}}td /tr Next how should I invoke: form.element(_name='password').parent().append(INPUT(_name='password2',requires=IS_EXPR('value= %s' % repr(request.vars.password)) )) to recive next input field for password verification? How should I define TD=??? to have it working? On 6 Lip, 20:28, mdmcginn michael.d.mcgin...@gmail.com wrote: Seehttp://web2py.com/book/default/section/5/2fordocumentationon HTML Helpers. I believe Massimo's solution assumes there are tables in your form, which is the default for FORM and SQLFORM. If your form doesn't contain HTML elements such as tabletrtd, maybe you're using div or span instead. Look at your HTML - hopefully there is some semantic/DOM code in there that you could hook into. If you're depending on br to format your form instead, Massimo's solution probably won't help you much (and neither will CSS or AJAX). On Jul 6, 1:27 am, elfuego1 elfue...@gmail.com wrote: No, I don't. So does TD supposed to work as a variable or list? And what if I'd like to use form.element again? Do I append another form.element to TD and us it as a list? How do I address the value that is assigned to TD: TD[0], TD[1] and why is it TD in the first place? Is out there some description or example of this syntax? Best regards. On 6 Lip, 07:35, KR kaerbu...@gmail.com wrote: Do you have somewhere in your code TD=something ? On 6 juil, 01:18, elfuego1 elfue...@gmail.com wrote: Can you please tell me yet how to implement it, so it would start working in my form and verify thepassword? When I add it to view: user.html or controller default.py then I receive: TypeError: 'TD' object is not callable So please let me know how to use form.element syntax to make it work properly. On 4 Lip, 17:08, mdipierro mdipie...@cs.depaul.edu wrote: form.element(_name=='password').insert(INPUT(_name='password2',requires=IS_ EXPR('value= %s' % repr(request.vars.password)) )) should have been form.element(_name='password').parent().append(INPUT(_name='password2',requ ires=IS_EXPR('value= %s' % repr(request.vars.password)) )) form.element(_name='password') finds the INPUT(name=password) item form.element(_name='password').parent() finds the parent of such element, the TD() form.element(_name='password').parent().append(...) appends something to the TD() INPUT(_name='password2',) is the appened input name=password2 field This: requires=IS_EXPR('value=%s' % repr(request.vars.password)) sets the requirements. i.e. the value ofpasswordis the same as the value of fields request.vars,password On 4 Lug, 09:37, elfuego1 elfue...@gmail.com wrote: I'm trying to make a use of this piece of code but nothing works. Can you please tell me where can I find some fine documentation that shows exactly how to use it or maybe write me an example because I have no idea where to put it in my form to make it work. HELP PLEASE!! form.element(_name=='password').insert(INPUT(_name='password2',requires=IS_ EXPR('value= %s' % repr(request.vars.password)) )) or another example How do I use this piece of code to customize form field length??? form.element(_name='last_name')['_size']=20 Can anyone show me how to do that because there is no example in documentation, no properly written piece of code to meke use of. On 2 Lip, 12:25, elfuego1 elfue...@gmail.com wrote: Thank you for your speedy help!!! On 2 Lip, 12:13, mdipierro mdipie...@cs.depaul.edu wrote: you can do for example (assuming trunk) form.element(_name=='password').insert(INPUT(_name='password2',requires=IS_ EQUAL_TO(request.vars.password))) if you do not use trunk instead of IS_EQUAL_TO(request.vars.password) you can use IS_EXPR('value=%s' % repr(request.vars.password))
Re: [web2py] markmin, t2, t3, cube9 etc. (important update)
Hello Massimo, Looks very promising! Will try it today, as soon as I get home. Also I like the name too, better than T(n). :) A question: would it be possible to set *plugin_wiki_level* per page so you can have special system pages and other pages users can edit or create? Or even better, certain admin users could create full power pages and normal user could only create content pages. What do you think? Cheers, Julio Monteiro On Wed, Jul 7, 2010 at 9:27 AM, mdipierro mdipie...@cs.depaul.edu wrote: # Preamble As you know T2 and T3 are deprecated. Some time ago I started a reimplementation of T3 called cube9. I got stuck. I now re-factored it completely - http://code.google.com/p/cube9/ (requires web2py trunk) - It uses markmin: - http://web2py.com/examples/static/markmin.html - cube9 is not completely finished by it works and it already much much better than T2/T3. # What is cube9? Cube 9 is a possible replacement for the welcome app. It is identical to welcome except that - has a different layout - contains a plugin called plugin_wiki (a plugin on steroids) - use a JS menu ## What is plugin_wiki? Plugin_wiki allows a developed (auth.user_id==1 or anybody member of group 'editor') to create dynamic pages on the fly by visiting ``http://127.0.0.1:8000/cube9/plugin_wiki/page/my-new-page-slug`` In fact you do not need cube9 to run plugin_wiki, you can use it for any web2py app. You can use it to add help pages. You can use to allow your users to edit pages. Pages are edited using markmin (via a modified markitup JS editor to support markmin). This email is written using markmin syntax. ## Why plugin_wiki is a plugin on steroids? Because it includes under one name (plugin_wiki) other plugins as embeddable widgets (mediaplyer, comments, tags, multiselect, and more) and there is a way to access them using the markmin syntax. ## A first example For example to include a youtube video in a page you do `` name: youtube code: x1w8hKTJ2Co ``:widget - The double reversed quotes tell markmin to deal with content in a special way. - The :widget tells plugin_wiki to override default behavior and treat this as an embedded widget - the content is treated as parameters (youtube being the name of the widget and x1w8hKTJ2Co being the name of the youtube video you want to embed). There are MANY widgets you can already embed. ## More examples ### Tagging `` name: tags ``:widget ### jqGrid list users `` name: jqgrid table: auth_user ``:widget ### Enbedding a form `` name: create table: auth_user ``:widget ### Embedding template code `` counting... {{for i in range(10):}}{{=i}}{{pass}} ``:template ## Inner workings For a list of widgets look into the static methods of PluginWikiWidgets in models/plugin_wiki.py. The arguments of the methods translate into variables. For example `` class PluginWikiWidgets: # in models/plugin_wiki @staticmethod def abd(x,y=6): ``:code_python is called by `` name: abc x=5 ``:widget (y is optional because y has a default, 6). ### List of Widgets Here is a list of widgets as of today: `` def read(table,record_id=None): ... def create(table,message='',next='',readonly_fields='',hidden_fields='',default_fields=''): ... def update(table,record_id='',message='',next='',readonly_fields='', hidden_fields='',default_fields=''): ... def select(table,query_field='',query_value='',fields=''): ... def search(table,fields=''): ... def jqgrid(table,fieldname=None,fieldvalue=None,col_widths='', _id=None,fields='',col_width=80,width=700,height=300): ... def pie_chart(data,names,width=300,height=150,align='center'): ... def bar_chart(data,names,width=300,height=150,align='center'): ... def youtube(code,width=400,height=250): ... def vimeo(code,width=400,height=250): ... def mediaplayer(src,width=400,height=250): ... def comments(table='None',record_id=None): ... def tags(table='None',record_id=None): ... def tag_cloud(): ... ``:code_python ### Global variables there are two important globals variables: + plugin_wiki_editor = True # or false to disable the wiki + plugin_wiki_level = 3 # for everything, 2 for wiki+widgets, 1 for normal wiki (no code, widgets) ## Conclusions: There is more to this already implemented and there is more to come. For start you can run everything on GAE. Some pages with slug meta-* have special meaning and can be used to edit header, footer, menu, sidebar of cube9 layout. meta-code can be used to define new tables, procedures and services. For security reasons code and widgets can be disabled. I will make a video about this as soon as I have the time (and free up enough memory). Please test it and send me comments. Enjoy! Massimo P.S. I apologize for these names.
[web2py] Re: markmin, t2, t3, cube9 etc. (important update)
A few clarifications The plugin_wiki that ships with cube9 has full revision history and logging (including for pages that contain code) The philosophy is the same as T3. Evey URL is a wiki. You program by editing pages. You can widgets in the code (crud, media, social, etc) or native web2py template code. Everything is in the database. Pages can be public, private and roles (they set permissions using web2py role based access control) Pages can have attachments and link them. They are managed via model popup form. Some widgets use ajax under the hood. You can move plugin_wiki into your existing app and add pages/url this way. Massimo On 7 Lug, 07:27, mdipierro mdipie...@cs.depaul.edu wrote: # Preamble As you know T2 and T3 are deprecated. Some time ago I started a reimplementation of T3 called cube9. I got stuck. I now re-factored it completely - http://code.google.com/p/cube9/(requires web2py trunk) - It uses markmin: - http://web2py.com/examples/static/markmin.html - cube9 is not completely finished by it works and it already much much better than T2/T3. # What is cube9? Cube 9 is a possible replacement for the welcome app. It is identical to welcome except that - has a different layout - contains a plugin called plugin_wiki (a plugin on steroids) - use a JS menu ## What is plugin_wiki? Plugin_wiki allows a developed (auth.user_id==1 or anybody member of group 'editor') to create dynamic pages on the fly by visiting ``http://127.0.0.1:8000/cube9/plugin_wiki/page/my-new-page-slug`` In fact you do not need cube9 to run plugin_wiki, you can use it for any web2py app. You can use it to add help pages. You can use to allow your users to edit pages. Pages are edited using markmin (via a modified markitup JS editor to support markmin). This email is written using markmin syntax. ## Why plugin_wiki is a plugin on steroids? Because it includes under one name (plugin_wiki) other plugins as embeddable widgets (mediaplyer, comments, tags, multiselect, and more) and there is a way to access them using the markmin syntax. ## A first example For example to include a youtube video in a page you do `` name: youtube code: x1w8hKTJ2Co ``:widget - The double reversed quotes tell markmin to deal with content in a special way. - The :widget tells plugin_wiki to override default behavior and treat this as an embedded widget - the content is treated as parameters (youtube being the name of the widget and x1w8hKTJ2Co being the name of the youtube video you want to embed). There are MANY widgets you can already embed. ## More examples ### Tagging `` name: tags ``:widget ### jqGrid list users `` name: jqgrid table: auth_user ``:widget ### Enbedding a form `` name: create table: auth_user ``:widget ### Embedding template code `` counting... {{for i in range(10):}}{{=i}}{{pass}} ``:template ## Inner workings For a list of widgets look into the static methods of PluginWikiWidgets in models/plugin_wiki.py. The arguments of the methods translate into variables. For example `` class PluginWikiWidgets: # in models/plugin_wiki @staticmethod def abd(x,y=6): ``:code_python is called by `` name: abc x=5 ``:widget (y is optional because y has a default, 6). ### List of Widgets Here is a list of widgets as of today: `` def read(table,record_id=None): ... def create(table,message='',next='',readonly_fields='',hidden_fields='',default_fields=''): ... def update(table,record_id='',message='',next='',readonly_fields='', hidden_fields='',default_fields=''): ... def select(table,query_field='',query_value='',fields=''): ... def search(table,fields=''): ... def jqgrid(table,fieldname=None,fieldvalue=None,col_widths='', _id=None,fields='',col_width=80,width=700,height=300): ... def pie_chart(data,names,width=300,height=150,align='center'): ... def bar_chart(data,names,width=300,height=150,align='center'): ... def youtube(code,width=400,height=250): ... def vimeo(code,width=400,height=250): ... def mediaplayer(src,width=400,height=250): ... def comments(table='None',record_id=None): ... def tags(table='None',record_id=None): ... def tag_cloud(): ... ``:code_python ### Global variables there are two important globals variables: + plugin_wiki_editor = True # or false to disable the wiki + plugin_wiki_level = 3 # for everything, 2 for wiki+widgets, 1 for normal wiki (no code, widgets) ## Conclusions: There is more to this already implemented and there is more to come. For start you can run everything on GAE. Some pages with slug meta-* have special meaning and can be used to edit header, footer, menu, sidebar of cube9 layout. meta-code can be used to define new tables, procedures and services. For security reasons code and widgets can be disabled. I will make a
[web2py] Re: markmin, t2, t3, cube9 etc. (important update)
You can do that. Just create logic in db.py to determine which page is being requested and then set it. On 7 Lug, 07:42, Júlio Monteiro jmonte...@gmail.com wrote: Hello Massimo, Looks very promising! Will try it today, as soon as I get home. Also I like the name too, better than T(n). :) A question: would it be possible to set *plugin_wiki_level* per page so you can have special system pages and other pages users can edit or create? Or even better, certain admin users could create full power pages and normal user could only create content pages. What do you think? Cheers, Julio Monteiro On Wed, Jul 7, 2010 at 9:27 AM, mdipierro mdipie...@cs.depaul.edu wrote: # Preamble As you know T2 and T3 are deprecated. Some time ago I started a reimplementation of T3 called cube9. I got stuck. I now re-factored it completely - http://code.google.com/p/cube9/(requires web2py trunk) - It uses markmin: - http://web2py.com/examples/static/markmin.html - cube9 is not completely finished by it works and it already much much better than T2/T3. # What is cube9? Cube 9 is a possible replacement for the welcome app. It is identical to welcome except that - has a different layout - contains a plugin called plugin_wiki (a plugin on steroids) - use a JS menu ## What is plugin_wiki? Plugin_wiki allows a developed (auth.user_id==1 or anybody member of group 'editor') to create dynamic pages on the fly by visiting ``http://127.0.0.1:8000/cube9/plugin_wiki/page/my-new-page-slug`` In fact you do not need cube9 to run plugin_wiki, you can use it for any web2py app. You can use it to add help pages. You can use to allow your users to edit pages. Pages are edited using markmin (via a modified markitup JS editor to support markmin). This email is written using markmin syntax. ## Why plugin_wiki is a plugin on steroids? Because it includes under one name (plugin_wiki) other plugins as embeddable widgets (mediaplyer, comments, tags, multiselect, and more) and there is a way to access them using the markmin syntax. ## A first example For example to include a youtube video in a page you do `` name: youtube code: x1w8hKTJ2Co ``:widget - The double reversed quotes tell markmin to deal with content in a special way. - The :widget tells plugin_wiki to override default behavior and treat this as an embedded widget - the content is treated as parameters (youtube being the name of the widget and x1w8hKTJ2Co being the name of the youtube video you want to embed). There are MANY widgets you can already embed. ## More examples ### Tagging `` name: tags ``:widget ### jqGrid list users `` name: jqgrid table: auth_user ``:widget ### Enbedding a form `` name: create table: auth_user ``:widget ### Embedding template code `` counting... {{for i in range(10):}}{{=i}}{{pass}} ``:template ## Inner workings For a list of widgets look into the static methods of PluginWikiWidgets in models/plugin_wiki.py. The arguments of the methods translate into variables. For example `` class PluginWikiWidgets: # in models/plugin_wiki �...@staticmethod def abd(x,y=6): ``:code_python is called by `` name: abc x=5 ``:widget (y is optional because y has a default, 6). ### List of Widgets Here is a list of widgets as of today: `` def read(table,record_id=None): ... def create(table,message='',next='',readonly_fields='',hidden_fields='',default_fields=''): ... def update(table,record_id='',message='',next='',readonly_fields='', hidden_fields='',default_fields=''): ... def select(table,query_field='',query_value='',fields=''): ... def search(table,fields=''): ... def jqgrid(table,fieldname=None,fieldvalue=None,col_widths='', _id=None,fields='',col_width=80,width=700,height=300): ... def pie_chart(data,names,width=300,height=150,align='center'): ... def bar_chart(data,names,width=300,height=150,align='center'): ... def youtube(code,width=400,height=250): ... def vimeo(code,width=400,height=250): ... def mediaplayer(src,width=400,height=250): ... def comments(table='None',record_id=None): ... def tags(table='None',record_id=None): ... def tag_cloud(): ... ``:code_python ### Global variables there are two important globals variables: + plugin_wiki_editor = True # or false to disable the wiki + plugin_wiki_level = 3 # for everything, 2 for wiki+widgets, 1 for normal wiki (no code, widgets) ## Conclusions: There is more to this already implemented and there is more to come. For start you can run everything on GAE. Some pages with slug meta-* have special meaning and can be used to edit header, footer, menu, sidebar of cube9 layout. meta-code can be used to define new tables, procedures and services. For security
[web2py] Re: markmin, t2, t3, cube9 etc. (important update)
I am going to remane this cu29 since it has been brought to my attention that there is a cube9.net and we do not want problems On 7 Lug, 07:51, mdipierro mdipie...@cs.depaul.edu wrote: You can do that. Just create logic in db.py to determine which page is being requested and then set it. On 7 Lug, 07:42, Júlio Monteiro jmonte...@gmail.com wrote: Hello Massimo, Looks very promising! Will try it today, as soon as I get home. Also I like the name too, better than T(n). :) A question: would it be possible to set *plugin_wiki_level* per page so you can have special system pages and other pages users can edit or create? Or even better, certain admin users could create full power pages and normal user could only create content pages. What do you think? Cheers, Julio Monteiro On Wed, Jul 7, 2010 at 9:27 AM, mdipierro mdipie...@cs.depaul.edu wrote: # Preamble As you know T2 and T3 are deprecated. Some time ago I started a reimplementation of T3 called cube9. I got stuck. I now re-factored it completely - http://code.google.com/p/cube9/(requiresweb2py trunk) - It uses markmin: - http://web2py.com/examples/static/markmin.html - cube9 is not completely finished by it works and it already much much better than T2/T3. # What is cube9? Cube 9 is a possible replacement for the welcome app. It is identical to welcome except that - has a different layout - contains a plugin called plugin_wiki (a plugin on steroids) - use a JS menu ## What is plugin_wiki? Plugin_wiki allows a developed (auth.user_id==1 or anybody member of group 'editor') to create dynamic pages on the fly by visiting ``http://127.0.0.1:8000/cube9/plugin_wiki/page/my-new-page-slug`` In fact you do not need cube9 to run plugin_wiki, you can use it for any web2py app. You can use it to add help pages. You can use to allow your users to edit pages. Pages are edited using markmin (via a modified markitup JS editor to support markmin). This email is written using markmin syntax. ## Why plugin_wiki is a plugin on steroids? Because it includes under one name (plugin_wiki) other plugins as embeddable widgets (mediaplyer, comments, tags, multiselect, and more) and there is a way to access them using the markmin syntax. ## A first example For example to include a youtube video in a page you do `` name: youtube code: x1w8hKTJ2Co ``:widget - The double reversed quotes tell markmin to deal with content in a special way. - The :widget tells plugin_wiki to override default behavior and treat this as an embedded widget - the content is treated as parameters (youtube being the name of the widget and x1w8hKTJ2Co being the name of the youtube video you want to embed). There are MANY widgets you can already embed. ## More examples ### Tagging `` name: tags ``:widget ### jqGrid list users `` name: jqgrid table: auth_user ``:widget ### Enbedding a form `` name: create table: auth_user ``:widget ### Embedding template code `` counting... {{for i in range(10):}}{{=i}}{{pass}} ``:template ## Inner workings For a list of widgets look into the static methods of PluginWikiWidgets in models/plugin_wiki.py. The arguments of the methods translate into variables. For example `` class PluginWikiWidgets: # in models/plugin_wiki �...@staticmethod def abd(x,y=6): ``:code_python is called by `` name: abc x=5 ``:widget (y is optional because y has a default, 6). ### List of Widgets Here is a list of widgets as of today: `` def read(table,record_id=None): ... def create(table,message='',next='',readonly_fields='',hidden_fields='',default_fields=''): ... def update(table,record_id='',message='',next='',readonly_fields='', hidden_fields='',default_fields=''): ... def select(table,query_field='',query_value='',fields=''): ... def search(table,fields=''): ... def jqgrid(table,fieldname=None,fieldvalue=None,col_widths='', _id=None,fields='',col_width=80,width=700,height=300): ... def pie_chart(data,names,width=300,height=150,align='center'): ... def bar_chart(data,names,width=300,height=150,align='center'): ... def youtube(code,width=400,height=250): ... def vimeo(code,width=400,height=250): ... def mediaplayer(src,width=400,height=250): ... def comments(table='None',record_id=None): ... def tags(table='None',record_id=None): ... def tag_cloud(): ... ``:code_python ### Global variables there are two important globals variables: + plugin_wiki_editor = True # or false to disable the wiki + plugin_wiki_level = 3 # for everything, 2 for wiki+widgets, 1 for normal wiki (no code, widgets) ## Conclusions: There
Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)
Can we suggest names? What about cube2py or w2cube or even simply cube29? Julio Monteiro On Wed, Jul 7, 2010 at 10:15 AM, mdipierro mdipie...@cs.depaul.edu wrote: I am going to remane this cu29 since it has been brought to my attention that there is a cube9.net and we do not want problems On 7 Lug, 07:51, mdipierro mdipie...@cs.depaul.edu wrote: You can do that. Just create logic in db.py to determine which page is being requested and then set it. On 7 Lug, 07:42, Júlio Monteiro jmonte...@gmail.com wrote: Hello Massimo, Looks very promising! Will try it today, as soon as I get home. Also I like the name too, better than T(n). :) A question: would it be possible to set *plugin_wiki_level* per page so you can have special system pages and other pages users can edit or create? Or even better, certain admin users could create full power pages and normal user could only create content pages. What do you think? Cheers, Julio Monteiro On Wed, Jul 7, 2010 at 9:27 AM, mdipierro mdipie...@cs.depaul.edu wrote: # Preamble As you know T2 and T3 are deprecated. Some time ago I started a reimplementation of T3 called cube9. I got stuck. I now re-factored it completely - http://code.google.com/p/cube9/(requiresweb2py trunk) - It uses markmin: - http://web2py.com/examples/static/markmin.html - cube9 is not completely finished by it works and it already much much better than T2/T3. # What is cube9? Cube 9 is a possible replacement for the welcome app. It is identical to welcome except that - has a different layout - contains a plugin called plugin_wiki (a plugin on steroids) - use a JS menu ## What is plugin_wiki? Plugin_wiki allows a developed (auth.user_id==1 or anybody member of group 'editor') to create dynamic pages on the fly by visiting ``http://127.0.0.1:8000/cube9/plugin_wiki/page/my-new-page-slug`` In fact you do not need cube9 to run plugin_wiki, you can use it for any web2py app. You can use it to add help pages. You can use to allow your users to edit pages. Pages are edited using markmin (via a modified markitup JS editor to support markmin). This email is written using markmin syntax. ## Why plugin_wiki is a plugin on steroids? Because it includes under one name (plugin_wiki) other plugins as embeddable widgets (mediaplyer, comments, tags, multiselect, and more) and there is a way to access them using the markmin syntax. ## A first example For example to include a youtube video in a page you do `` name: youtube code: x1w8hKTJ2Co ``:widget - The double reversed quotes tell markmin to deal with content in a special way. - The :widget tells plugin_wiki to override default behavior and treat this as an embedded widget - the content is treated as parameters (youtube being the name of the widget and x1w8hKTJ2Co being the name of the youtube video you want to embed). There are MANY widgets you can already embed. ## More examples ### Tagging `` name: tags ``:widget ### jqGrid list users `` name: jqgrid table: auth_user ``:widget ### Enbedding a form `` name: create table: auth_user ``:widget ### Embedding template code `` counting... {{for i in range(10):}}{{=i}}{{pass}} ``:template ## Inner workings For a list of widgets look into the static methods of PluginWikiWidgets in models/plugin_wiki.py. The arguments of the methods translate into variables. For example `` class PluginWikiWidgets: # in models/plugin_wiki @staticmethod def abd(x,y=6): ``:code_python is called by `` name: abc x=5 ``:widget (y is optional because y has a default, 6). ### List of Widgets Here is a list of widgets as of today: `` def read(table,record_id=None): ... def create(table,message='',next='',readonly_fields='',hidden_fields='',default_fields=''): ... def update(table,record_id='',message='',next='',readonly_fields='', hidden_fields='',default_fields=''): ... def select(table,query_field='',query_value='',fields=''): ... def search(table,fields=''): ... def jqgrid(table,fieldname=None,fieldvalue=None,col_widths='', _id=None,fields='',col_width=80,width=700,height=300): ... def pie_chart(data,names,width=300,height=150,align='center'): ... def bar_chart(data,names,width=300,height=150,align='center'): ... def youtube(code,width=400,height=250): ... def vimeo(code,width=400,height=250): ... def mediaplayer(src,width=400,height=250): ... def comments(table='None',record_id=None): ... def
Re: [web2py] Re: Will rocket close connections if it takes long time?
I have different opinion, Candid. As Timbo and I have discussed in this thread, rocket differentiates long running requests, seeing it is caused by client side or server side. Rocket only terminates long request comes from the client side, say, a very slow http request from a client (possibly a DoS attack). On the contrary, on the server side, it is the app (a.k.a. its developer) 's responsibility to ensure most requests can be served quickly, and it is also developer's right to occasionally do long time calculation whenever needed. Rocket gives developer the flexibility to choose what they want. That is better than killing a (long) running thread unconditionally. I love rocket. :-) Best regards, Iceberg, 2010-Jul-07, 21:47(PM), Wed --- Original Message --- From:Candid roman.bat...@gmail.com Sender: web2py@googlegroups.com To: web2py-users web2py@googlegroups.com Date:Wed, 7 Jul 2010 05:21:16 -0700 (PDT) Subject: [web2py] Re: Will rocket close connections if it takes long time? --- Thank you for clarification, Timbo. Is not #3 a problem though? If Rocket doesn't terminate the request if it's running for too long, is not Rocket's thread pool going to be exhausted if it runs too many long running requests? The problem here is that one application could potentially exhaust all working thread, preventing rocket from serving request for other applications. It looks like this is what's happening to one of my server - see this discussion: http://groups.google.com/group/web2py/browse_thread/thread/34f5411692dcbd35 Am I missing something or is this how it's supposed to be? On Jul 5, 12:33�am, Timbo tfarr...@owassobible.org wrote: 1) True 2) Basically true. �You seem to indicate that 1 2 should not co- exist or are somehow at odds with each other. �If that's what you're indicating, I'm not following your logic as to why they should be mutually exclusive. �Can you explain a little more? 3) In Rocket's case, no. �While a client could disconnect at anytime, Rocket will allow the application server to run a request as long as it likes. �If the client connection is still open when it's ready to send it's response, it will send successfully. �Rocket does not kill threads that run for too long. 4) Rocket always applies the socket timeout (rocket.py line 854), this should override Py2.5's default (whatever it may be). �Rocket enables Python's socket timeout protection on every Python platform that supports it. Does this clear things up? On Jul 4, 4:30�am, Iceberg iceb...@21cn.com wrote: Thanks for all these info, Tim. You said: � � The timeout ... is a timeout based on inactivity between http requests. �So the long requests that Iceberg is seeing are perfectly normal and acceptable. According to my reading of the rocket-science code (and I could be wrong), here is my understanding and questions: � � 1. The timeout is a timeout based on inactivity since one request socket's latest select-and-readable event. The time gap could be caused by two http requests which somehow reuse the socket (because keep-alive?), or caused by one very slow http request from a client (possibly a DoS attack). � � 2. BUT the timeout check is only performed after the request's socket encountered socket.timeout exception. According to line 800 of rocket.py: � � � � if typ == SocketTimeout: � � � � � � self.err_log.debug('Socket timed out') � � � � � � self.wait_queue.put(self.conn) And then the request's control is transferred to the Monitor, the timeout check is at line 449 of rocket.py: � � � � if now - c.start_time = self.timeout: � � � � � � � � � � � � stale.add(c) � � 3. What if, a normal request is read from client side within seconds, then being calculated for quite some time on the server side, will this situation trigger the timeout protection? I guess not, because no socket.timeout will be raised during the calculation, although the final calculated result will probably not be sent due to the socket is already timeout or even closed from the client side. If this is true (is it?), then my maintenance scenario is still doable because no result is expected, I only need the maintenance job can be triggered and can run as long as it takes. � � 4. On the other hand, at least on Windows XP, python 2.5.4, by default, socket has no socket.timeout, so the above check is not performed at all, is it? So the rocket timeout protection is not activated anyway. -- Iceberg On Jul4, 9:26am, Timbo tfarr...@owassobible.org wrote: Rocket has a longer default wait time before it closes connections in comparison to CherryPy. �You might check web2py code, it is not likely using the same default timeout as Rocket proper.
Re: [web2py] Re: markmin
On Wed, Jul 7, 2010 at 02:15, mdmcginn michael.d.mcgin...@gmail.com wrote: Massimo also announced this at http://groups.google.com/group/comp.lang.python.announce/browse_thread/thread/216e52e03e1a0120/4e9404e70bdeed0e#4e9404e70bdeed0e but didn't include a link to http://www.web2py.com/examples/static/markmin.html. No comments yet. No. New project, new repository. On Jul 6, 11:47 pm, Jason Brower encomp...@gmail.com wrote: Markdown has no classes and it's annoying. I have been hoping for something like this. And didn't they say it was faster? Why do we need Python when we can do everything in C? Then again, I am no expert. And about the seporate project. It kind of is now, but it is just included with the web2py package. It can be removed if needed. (Hence another reason to have a plugin like manager. We could install stuff for that web2py install and manage it as well. All from the admin pages.) --Jason On Tue, 2010-07-06 at 23:34 -0300, Álvaro Justen wrote: Another thoughts: *why* do we need another markup language? Markdown is not enough? It is so boring to learn a lot of languages (rest, markdown, markmin...). On Tue, Jul 6, 2010 at 23:32, Álvaro Justen alv...@justen.eng.br wrote: On Mon, Jul 5, 2010 at 19:42, mdipierro mdipie...@cs.depaul.edu wrote: http://www.web2py.com/examples/static/markmin.html As you created it, it is in contrib, it doesn't depend on web2py and maybe useful to other people, I think we should create another project to maintain markmin. Other ideia is to integrate the template system with markmin. For example: create a applications/myapp/views/default/somepage.markmin if somepage.html does not exist, web2py should use markmin to generate HTML instead. We have tests! Great! \o/ :-) -- Álvaro Justen - @turicas http://blog.justen.eng.br/ 21 9898-0141 -- Álvaro Justen - @turicas http://blog.justen.eng.br/ 21 9898-0141
[web2py] Fwd: web2py prod deployment
It's happen sometime that my emails are blocked somewhere... I is the case for this one... My question down there. Jonhy Original Message Subject:web2py prod deployment Date: Tue, 06 Jul 2010 20:35:20 -0400 From: Jean-Guy jean...@gmail.com To: web2py@googlegroups.com Hello, I already had deployed web2py 1.78.3 in prod with the ubuntu script... I would like to know what is the best way to deploy the web2py 1.79.2 over the already deployed web2py installation (1.78.3) : 1) update of web2py 1.78.3 from the admin interface 2) replace the web2py 1.78.3 folder by the web2py 1.79.2 folder in the www-data folder 3) re-execute the ubuntu script I have the complete control over my ubuntu server. Thanks in advance. Jonhy
Re: [web2py] Re: web2py prod deployment
Ok, I am sorry for the foward, it should be a thunderbird pb of sync with gmail... I will try it, I have other problem with legacy database to overcome with sequence issue... So it seems that if a update can do the job, replacing the web2py folder with the new web2py build and chown on the subfolders will do the job... Jonhy 2010/7/7 mdipierro mdipie...@cs.depaul.edu In the admin interface there is a button {upgrade now} and it will do this for you. Did you try it? On 6 Lug, 19:35, Jean-Guy jean...@gmail.com wrote: Hello, I already had deployed web2py 1.78.3 in prod with the ubuntu script... I would like to know what is the best way to deploy the web2py 1.79.2 over the already deployed web2py installation (1.78.3) : 1) update of web2py 1.78.3 from the admin interface 2) replace the web2py 1.78.3 folder by the web2py 1.79.2 folder in the www-data folder 3) re-execute the ubuntu script I have the complete control over my ubuntu server. Thanks in advance. Jonhy
Re: [web2py] markmin, t2, t3, cube9 etc. (important update)
On Jul 7, 2010, at 5:27 AM, mdipierro wrote: As you know T2 and T3 are deprecated. Some time ago I started a reimplementation of T3 called cube9. I got stuck. I now re-factored it completely - http://code.google.com/p/cube9/ (requires web2py trunk) - It uses markmin: - http://web2py.com/examples/static/markmin.html - With markmin (or perhaps cu29 -- why that?), how does one reference local wiki pages without using their full URL? For example, in Wikipedia, this is a link: [[web2py]]. But in markmin it creates an anchor.
Re: [web2py] Re: sequence name issue postgresql
I don't understand how I can download the trunk build of web2py... Maybe I am not getting it, do I have to copy only the files (sql.py and dal.py) with the mods you had made??? Richard 2010/7/1 mdipierro mdipie...@cs.depaul.edu Actually the mercurial one should be in sync with bazaar one. I have had google code problems with a different project. On 1 Lug, 13:04, Richard Vézina ml.richard.vez...@gmail.com wrote: I will look at it... Do we need to be on launchpad for accessing the bazaar trunk (can't find the download able package) since the mercurial seems to be out dated?? Maybe I have to import it with bazaar? Richard 2010/7/1 mdipierro mdipie...@cs.depaul.edu Hi Richard, I am not convinced this is a good solution. The reason is that two processes perform insert at the same that may not return the ID of previous insert but the last one, therefore the same value. I may be wrong. I have just added to trunk another solution: db.define_table(,sequence_name='table_pk_Seq') so that you can specify your sequence name. This is compatible to what we do for other databases. Please check it and see if it works for you. Massimo On 1 Lug, 10:39, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello Massimo, I hired some guys a couples of weeks ago for fixing sequence name issue with Postgres related to this thread : http://groups.google.com/group/web2py/browse_thread/thread/b4577a0347... They come with patch to dal.py and sql.py (from the thread actually) and it work just fine with 1.78.3... I just migrate to 1.79.2 and the flaw with Postgres sequence is still there. I applied again the patch to the dal.py and sql.py of the 1.79.2 and it solve the problem. I am using web2py with those patchs since more of a mounth and I have had no troubles. Do you plan to apply them in web2py in the future releases... I join my patched dal.py and sql.py of 1.79.2 version... Cheers Richard CC.: Lennon Rubin PS.: Here are the changes : sql.py changes around line 1935 : #the following was updated by Eschaton Systems for dynamic sequence support on 5/28/2010: self._db._execute(select column_default from information_schema.columns where table_name='%s'; THERE IS A LINE BETWEEN HERE... get_currval_string ='select ' + self._db._cursor.fetchone()[0].replace('nextval', 'currval') self._db._execute(get_currval_string) dal.py changes around line 1014 : def lastrowid(self,tablename): #the following was updated by Eschaton Systems for dynamic sequence support on 5/28/2010: self.execute(select column_default from information_schema.columns where table_name='%s'; %tablename) get_currval_string ='select ' + self.cursor.fetchone()[0].replace('nextval', 'currval') self.execute(get_currval_string) dal.py 189KVisualizzaScarica sql.py 195KVisualizzaScarica
Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)
On Jul 7, 2010, at 5:42 AM, mdipierro wrote: The philosophy is the same as T3. Every URL is a wiki. Would you elaborate a little on that statement, please?
[web2py] Re: Fwd: web2py prod deployment
I responded to this press the upgrade button in admin. On 7 Lug, 09:47, Jean-Guy jean...@gmail.com wrote: It's happen sometime that my emails are blocked somewhere... I is the case for this one... My question down there. Jonhy Original Message Subject: web2py prod deployment Date: Tue, 06 Jul 2010 20:35:20 -0400 From: Jean-Guy jean...@gmail.com To: web2py@googlegroups.com Hello, I already had deployed web2py 1.78.3 in prod with the ubuntu script... I would like to know what is the best way to deploy the web2py 1.79.2 over the already deployed web2py installation (1.78.3) : 1) update of web2py 1.78.3 from the admin interface 2) replace the web2py 1.78.3 folder by the web2py 1.79.2 folder in the www-data folder 3) re-execute the ubuntu script I have the complete control over my ubuntu server. Thanks in advance. Jonhy
[web2py] Re: web2py prod deployment
Sorry I got confused with the two threads. ;-) Yes, you can just unzip one folder over the other. On 7 Lug, 09:59, Jean Guy jean...@gmail.com wrote: Ok, I am sorry for the foward, it should be a thunderbird pb of sync with gmail... I will try it, I have other problem with legacy database to overcome with sequence issue... So it seems that if a update can do the job, replacing the web2py folder with the new web2py build and chown on the subfolders will do the job... Jonhy 2010/7/7 mdipierro mdipie...@cs.depaul.edu In the admin interface there is a button {upgrade now} and it will do this for you. Did you try it? On 6 Lug, 19:35, Jean-Guy jean...@gmail.com wrote: Hello, I already had deployed web2py 1.78.3 in prod with the ubuntu script... I would like to know what is the best way to deploy the web2py 1.79.2 over the already deployed web2py installation (1.78.3) : 1) update of web2py 1.78.3 from the admin interface 2) replace the web2py 1.78.3 folder by the web2py 1.79.2 folder in the www-data folder 3) re-execute the ubuntu script I have the complete control over my ubuntu server. Thanks in advance. Jonhy
[web2py] Re: sequence name issue postgresql
The trunk will be the nightly built (in the link below) http://web2py.com/examples/default/download in 5 minutes. On 7 Lug, 10:05, Richard Vézina ml.richard.vez...@gmail.com wrote: I don't understand how I can download the trunk build of web2py... Maybe I am not getting it, do I have to copy only the files (sql.py and dal.py) with the mods you had made??? Richard 2010/7/1 mdipierro mdipie...@cs.depaul.edu Actually the mercurial one should be in sync with bazaar one. I have had google code problems with a different project. On 1 Lug, 13:04, Richard Vézina ml.richard.vez...@gmail.com wrote: I will look at it... Do we need to be on launchpad for accessing the bazaar trunk (can't find the download able package) since the mercurial seems to be out dated?? Maybe I have to import it with bazaar? Richard 2010/7/1 mdipierro mdipie...@cs.depaul.edu Hi Richard, I am not convinced this is a good solution. The reason is that two processes perform insert at the same that may not return the ID of previous insert but the last one, therefore the same value. I may be wrong. I have just added to trunk another solution: db.define_table(,sequence_name='table_pk_Seq') so that you can specify your sequence name. This is compatible to what we do for other databases. Please check it and see if it works for you. Massimo On 1 Lug, 10:39, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello Massimo, I hired some guys a couples of weeks ago for fixing sequence name issue with Postgres related to this thread : http://groups.google.com/group/web2py/browse_thread/thread/b4577a0347... They come with patch to dal.py and sql.py (from the thread actually) and it work just fine with 1.78.3... I just migrate to 1.79.2 and the flaw with Postgres sequence is still there. I applied again the patch to the dal.py and sql.py of the 1.79.2 and it solve the problem. I am using web2py with those patchs since more of a mounth and I have had no troubles. Do you plan to apply them in web2py in the future releases... I join my patched dal.py and sql.py of 1.79.2 version... Cheers Richard CC.: Lennon Rubin PS.: Here are the changes : sql.py changes around line 1935 : #the following was updated by Eschaton Systems for dynamic sequence support on 5/28/2010: self._db._execute(select column_default from information_schema.columns where table_name='%s'; THERE IS A LINE BETWEEN HERE... get_currval_string ='select ' + self._db._cursor.fetchone()[0].replace('nextval', 'currval') self._db._execute(get_currval_string) dal.py changes around line 1014 : def lastrowid(self,tablename): #the following was updated by Eschaton Systems for dynamic sequence support on 5/28/2010: self.execute(select column_default from information_schema.columns where table_name='%s'; %tablename) get_currval_string ='select ' + self.cursor.fetchone()[0].replace('nextval', 'currval') self.execute(get_currval_string) dal.py 189KVisualizzaScarica sql.py 195KVisualizzaScarica
Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)
This looks really awesome! Name suggestion: Cube^2 -- Thadeus On Wed, Jul 7, 2010 at 10:18 AM, Jonathan Lundell jlund...@pobox.com wrote: On Jul 7, 2010, at 5:42 AM, mdipierro wrote: The philosophy is the same as T3. Every URL is a wiki. Would you elaborate a little on that statement, please?
Re: [web2py] Re: markmin
I wish web2py was modular, so that this could be a separate project, and you can ``easy_install markmin`` and then web2py will pick up the existance or non-existance of the package and use or not use it automatically. This way we don't have to install markmin if we don't want to, but it is only one command away. I know this makes it harder to maintain when you have multiple packages, however allows for people who use other web frameworks to take advantage of it! -- Thadeus On Wed, Jul 7, 2010 at 9:45 AM, Álvaro Justen alv...@justen.eng.br wrote: On Wed, Jul 7, 2010 at 02:15, mdmcginn michael.d.mcgin...@gmail.com wrote: Massimo also announced this at http://groups.google.com/group/comp.lang.python.announce/browse_thread/thread/216e52e03e1a0120/4e9404e70bdeed0e#4e9404e70bdeed0e but didn't include a link to http://www.web2py.com/examples/static/markmin.html. No comments yet. No. New project, new repository. On Jul 6, 11:47 pm, Jason Brower encomp...@gmail.com wrote: Markdown has no classes and it's annoying. I have been hoping for something like this. And didn't they say it was faster? Why do we need Python when we can do everything in C? Then again, I am no expert. And about the seporate project. It kind of is now, but it is just included with the web2py package. It can be removed if needed. (Hence another reason to have a plugin like manager. We could install stuff for that web2py install and manage it as well. All from the admin pages.) --Jason On Tue, 2010-07-06 at 23:34 -0300, Álvaro Justen wrote: Another thoughts: *why* do we need another markup language? Markdown is not enough? It is so boring to learn a lot of languages (rest, markdown, markmin...). On Tue, Jul 6, 2010 at 23:32, Álvaro Justen alv...@justen.eng.br wrote: On Mon, Jul 5, 2010 at 19:42, mdipierro mdipie...@cs.depaul.edu wrote: http://www.web2py.com/examples/static/markmin.html As you created it, it is in contrib, it doesn't depend on web2py and maybe useful to other people, I think we should create another project to maintain markmin. Other ideia is to integrate the template system with markmin. For example: create a applications/myapp/views/default/somepage.markmin if somepage.html does not exist, web2py should use markmin to generate HTML instead. We have tests! Great! \o/ :-) -- Álvaro Justen - @turicas http://blog.justen.eng.br/ 21 9898-0141 -- Álvaro Justen - @turicas http://blog.justen.eng.br/ 21 9898-0141
[web2py] Re: markmin, t2, t3, cube9 etc. (important update)
The idea is that any web app is a set of pages that contain stuff. Some are public some are not, some have other permissions, some are listed in a hierarchical menu some not. Therefore it should be possible to develop as app as one creates a wiki, by adding pages and filling the pages. In web2py every URL is mapped into a action. An action is a function + template. In cu29 every URL (technically only those URL managed by the plugin_wiki/page action) is a page. The page is described by the markmin syntax and it can contain stuff because markmin allows to include high level widgets (not to be confused with db.table.field.widget). You can have both together if you apply plugin_wiki from cu29 to your apps. Hope it makes sense. On 7 Lug, 10:18, Jonathan Lundell jlund...@pobox.com wrote: On Jul 7, 2010, at 5:42 AM, mdipierro wrote: The philosophy is the same as T3. Every URL is a wiki. Would you elaborate a little on that statement, please?
Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)
On Jul 7, 2010, at 8:30 AM, mdipierro wrote: The idea is that any web app is a set of pages that contain stuff. Some are public some are not, some have other permissions, some are listed in a hierarchical menu some not. Therefore it should be possible to develop as app as one creates a wiki, by adding pages and filling the pages. In web2py every URL is mapped into a action. An action is a function + template. In cu29 every URL (technically only those URL managed by the plugin_wiki/page action) is a page. The page is described by the markmin syntax and it can contain stuff because markmin allows to include high level widgets (not to be confused with db.table.field.widget). You can have both together if you apply plugin_wiki from cu29 to your apps. Hope it makes sense. Yes, thanks. One more thing, for those of us who haven't followed the whole history (two more things, I guess): why 'cube'? why '9'?
[web2py] Re: markmin
Right now markmin is a single file and does not depend on web2py so you can use it with other frameworks. Just copy the file in the path. I include it in web2py for convenience and because I made a new helper MARKMIN and I hope people will use it instead of WIKI from now on. The plugin_wiki is implemented on top of web2py and exposes some web2py syntax but, apart for ````:template and meta-code everything else is to the user web2py independent and it should be possible to re-implement it in other frameworks. I also modified markitup.js to support markmin (used by cu29 and plugin_wiki). I sent the patch to the markitup developer but got no reply yet. Massimo On 7 Lug, 10:27, Thadeus Burgess thade...@thadeusb.com wrote: I wish web2py was modular, so that this could be a separate project, and you can ``easy_install markmin`` and then web2py will pick up the existance or non-existance of the package and use or not use it automatically. This way we don't have to install markmin if we don't want to, but it is only one command away. I know this makes it harder to maintain when you have multiple packages, however allows for people who use other web frameworks to take advantage of it! -- Thadeus On Wed, Jul 7, 2010 at 9:45 AM, Álvaro Justen alv...@justen.eng.br wrote: On Wed, Jul 7, 2010 at 02:15, mdmcginn michael.d.mcgin...@gmail.com wrote: Massimo also announced this at http://groups.google.com/group/comp.lang.python.announce/browse_threa... but didn't include a link tohttp://www.web2py.com/examples/static/markmin.html. No comments yet. No. New project, new repository. On Jul 6, 11:47 pm, Jason Brower encomp...@gmail.com wrote: Markdown has no classes and it's annoying. I have been hoping for something like this. And didn't they say it was faster? Why do we need Python when we can do everything in C? Then again, I am no expert. And about the seporate project. It kind of is now, but it is just included with the web2py package. It can be removed if needed. (Hence another reason to have a plugin like manager. We could install stuff for that web2py install and manage it as well. All from the admin pages.) --Jason On Tue, 2010-07-06 at 23:34 -0300, Álvaro Justen wrote: Another thoughts: *why* do we need another markup language? Markdown is not enough? It is so boring to learn a lot of languages (rest, markdown, markmin...). On Tue, Jul 6, 2010 at 23:32, Álvaro Justen alv...@justen.eng.br wrote: On Mon, Jul 5, 2010 at 19:42, mdipierro mdipie...@cs.depaul.edu wrote: http://www.web2py.com/examples/static/markmin.html As you created it, it is in contrib, it doesn't depend on web2py and maybe useful to other people, I think we should create another project to maintain markmin. Other ideia is to integrate the template system with markmin. For example: create a applications/myapp/views/default/somepage.markmin if somepage.html does not exist, web2py should use markmin to generate HTML instead. We have tests! Great! \o/ :-) -- Álvaro Justen - @turicas http://blog.justen.eng.br/ 21 9898-0141 -- Álvaro Justen - @turicas http://blog.justen.eng.br/ 21 9898-0141
[web2py] Re: markmin, t2, t3, cube9 etc. (important update)
I just made them up. In my IT departement they use the world cubes to diffrent ways to view the same data. Mixing numbers and text makes it less likely the name is trademarked. Turned out it is trademarked. :-( cu29 refers to copper. It does not seem to be taken. I am very bad with names. I am not attached to any of them. My only concern is that I have been threatened to be sued before for trademark issues and want to prevent that from happening again. Massimo On 7 Lug, 10:42, Jonathan Lundell jlund...@pobox.com wrote: On Jul 7, 2010, at 8:30 AM, mdipierro wrote: The idea is that any web app is a set of pages that contain stuff. Some are public some are not, some have other permissions, some are listed in a hierarchical menu some not. Therefore it should be possible to develop as app as one creates a wiki, by adding pages and filling the pages. In web2py every URL is mapped into a action. An action is a function + template. In cu29 every URL (technically only those URL managed by the plugin_wiki/page action) is a page. The page is described by the markmin syntax and it can contain stuff because markmin allows to include high level widgets (not to be confused with db.table.field.widget). You can have both together if you apply plugin_wiki from cu29 to your apps. Hope it makes sense. Yes, thanks. One more thing, for those of us who haven't followed the whole history (two more things, I guess): why 'cube'? why '9'?
Re: [web2py] Re: sequence name issue postgresql
Not solving the problem : Traceback (most recent call last): File /nigthly_build/web2py/gluon/restricted.py, line 178, in restricted exec ccode in environment File /nigthly_build/web2py/applications/app/controllers/test.py /admin/default/edit/devGUImdg1/controllers/test.py, line 785, in module File /nigthly_build/web2py/gluon/globals.py, line 96, in lambda self._caller = lambda f: f() File /nigthly_build/web2py/gluon/tools.py, line 2170, in f return action(*a, **b) File /nigthly_build/web2py/applications/ /admin/default/edit/devGUImdg1/controllers/test.pyapp /admin/default/edit/devGUImdg1/controllers/test.py/controllers/test.py /admin/default/edit/devGUImdg1/controllers/test.py, line 149, in activity if form.accepts(request.vars, session): File /nigthly_build/web2py/gluon/sqlhtml.py, line 1019, in accepts self.vars.id = self.table.insert(**fields) File /nigthly_build/web2py/gluon/sql.py, line 1935, in insert self._db._execute(select currval('%s') % self._sequence_name) File /nigthly_build/web2py/gluon/sql.py, line 960, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) ProgrammingError: ERREUR: la relation « test_test_id_seq » n'existe pas LINE 1: select currval('test_test_id_Seq') Here is the version of the web2py build I download : web2py Version 1.79.2 (2010-07-05 23:18:02) Richard 2010/7/7 mdipierro mdipie...@cs.depaul.edu The trunk will be the nightly built (in the link below) http://web2py.com/examples/default/download in 5 minutes. On 7 Lug, 10:05, Richard Vézina ml.richard.vez...@gmail.com wrote: I don't understand how I can download the trunk build of web2py... Maybe I am not getting it, do I have to copy only the files (sql.py and dal.py) with the mods you had made??? Richard 2010/7/1 mdipierro mdipie...@cs.depaul.edu Actually the mercurial one should be in sync with bazaar one. I have had google code problems with a different project. On 1 Lug, 13:04, Richard Vézina ml.richard.vez...@gmail.com wrote: I will look at it... Do we need to be on launchpad for accessing the bazaar trunk (can't find the download able package) since the mercurial seems to be out dated?? Maybe I have to import it with bazaar? Richard 2010/7/1 mdipierro mdipie...@cs.depaul.edu Hi Richard, I am not convinced this is a good solution. The reason is that two processes perform insert at the same that may not return the ID of previous insert but the last one, therefore the same value. I may be wrong. I have just added to trunk another solution: db.define_table(,sequence_name='table_pk_Seq') so that you can specify your sequence name. This is compatible to what we do for other databases. Please check it and see if it works for you. Massimo On 1 Lug, 10:39, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello Massimo, I hired some guys a couples of weeks ago for fixing sequence name issue with Postgres related to this thread : http://groups.google.com/group/web2py/browse_thread/thread/b4577a0347. .. They come with patch to dal.py and sql.py (from the thread actually) and it work just fine with 1.78.3... I just migrate to 1.79.2 and the flaw with Postgres sequence is still there. I applied again the patch to the dal.py and sql.py of the 1.79.2 and it solve the problem. I am using web2py with those patchs since more of a mounth and I have had no troubles. Do you plan to apply them in web2py in the future releases... I join my patched dal.py and sql.py of 1.79.2 version... Cheers Richard CC.: Lennon Rubin PS.: Here are the changes : sql.py changes around line 1935 : #the following was updated by Eschaton Systems for dynamic sequence support on 5/28/2010: self._db._execute(select column_default from information_schema.columns where table_name='%s'; THERE IS A LINE BETWEEN HERE... get_currval_string ='select ' + self._db._cursor.fetchone()[0].replace('nextval', 'currval') self._db._execute(get_currval_string) dal.py changes around line 1014 : def lastrowid(self,tablename): #the following was updated by Eschaton Systems for dynamic sequence support on 5/28/2010: self.execute(select column_default from information_schema.columns where table_name='%s'; %tablename) get_currval_string ='select ' + self.cursor.fetchone()[0].replace('nextval', 'currval') self.execute(get_currval_string) dal.py 189KVisualizzaScarica sql.py 195KVisualizzaScarica
[web2py] Re: sequence name issue postgresql
Can you help debug? Is test_test_seq_Id the name of the sequence? If not, what is the name? Did you create the sequence? How did you specify the name? Massimo On 7 Lug, 10:48, Richard Vézina ml.richard.vez...@gmail.com wrote: Not solving the problem : Traceback (most recent call last): File /nigthly_build/web2py/gluon/restricted.py, line 178, in restricted exec ccode in environment File /nigthly_build/web2py/applications/app/controllers/test.py /admin/default/edit/devGUImdg1/controllers/test.py, line 785, in module File /nigthly_build/web2py/gluon/globals.py, line 96, in lambda self._caller = lambda f: f() File /nigthly_build/web2py/gluon/tools.py, line 2170, in f return action(*a, **b) File /nigthly_build/web2py/applications/ /admin/default/edit/devGUImdg1/controllers/test.pyapp /admin/default/edit/devGUImdg1/controllers/test.py/controllers/test.py /admin/default/edit/devGUImdg1/controllers/test.py, line 149, in activity if form.accepts(request.vars, session): File /nigthly_build/web2py/gluon/sqlhtml.py, line 1019, in accepts self.vars.id = self.table.insert(**fields) File /nigthly_build/web2py/gluon/sql.py, line 1935, in insert self._db._execute(select currval('%s') % self._sequence_name) File /nigthly_build/web2py/gluon/sql.py, line 960, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) ProgrammingError: ERREUR: la relation « test_test_id_seq » n'existe pas LINE 1: select currval('test_test_id_Seq') Here is the version of the web2py build I download : web2py Version 1.79.2 (2010-07-05 23:18:02) Richard 2010/7/7 mdipierro mdipie...@cs.depaul.edu The trunk will be the nightly built (in the link below) http://web2py.com/examples/default/download in 5 minutes. On 7 Lug, 10:05, Richard Vézina ml.richard.vez...@gmail.com wrote: I don't understand how I can download the trunk build of web2py... Maybe I am not getting it, do I have to copy only the files (sql.py and dal.py) with the mods you had made??? Richard 2010/7/1 mdipierro mdipie...@cs.depaul.edu Actually the mercurial one should be in sync with bazaar one. I have had google code problems with a different project. On 1 Lug, 13:04, Richard Vézina ml.richard.vez...@gmail.com wrote: I will look at it... Do we need to be on launchpad for accessing the bazaar trunk (can't find the download able package) since the mercurial seems to be out dated?? Maybe I have to import it with bazaar? Richard 2010/7/1 mdipierro mdipie...@cs.depaul.edu Hi Richard, I am not convinced this is a good solution. The reason is that two processes perform insert at the same that may not return the ID of previous insert but the last one, therefore the same value. I may be wrong. I have just added to trunk another solution: db.define_table(,sequence_name='table_pk_Seq') so that you can specify your sequence name. This is compatible to what we do for other databases. Please check it and see if it works for you. Massimo On 1 Lug, 10:39, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello Massimo, I hired some guys a couples of weeks ago for fixing sequence name issue with Postgres related to this thread : http://groups.google.com/group/web2py/browse_thread/thread/b4577a0347. .. They come with patch to dal.py and sql.py (from the thread actually) and it work just fine with 1.78.3... I just migrate to 1.79.2 and the flaw with Postgres sequence is still there. I applied again the patch to the dal.py and sql.py of the 1.79.2 and it solve the problem. I am using web2py with those patchs since more of a mounth and I have had no troubles. Do you plan to apply them in web2py in the future releases... I join my patched dal.py and sql.py of 1.79.2 version... Cheers Richard CC.: Lennon Rubin PS.: Here are the changes : sql.py changes around line 1935 : #the following was updated by Eschaton Systems for dynamic sequence support on 5/28/2010: self._db._execute(select column_default from information_schema.columns where table_name='%s'; THERE IS A LINE BETWEEN HERE... get_currval_string ='select ' + self._db._cursor.fetchone()[0].replace('nextval', 'currval') self._db._execute(get_currval_string) dal.py changes around line 1014 : def lastrowid(self,tablename): #the following was updated by Eschaton Systems for dynamic sequence support on 5/28/2010: self.execute(select column_default from information_schema.columns where table_name='%s'; %tablename)
[web2py] Re: markmin, t2, t3, cube9 etc. (important update)
I've just loaded this from the mercurial source listed on google code. Running on GAE (local dev server) and using the Web2py trunk I'm getting: ReservedWordError: Cannot define property using reserved word 'parent'. If you would like to use this name in the datastore consider using a different name like parent_ and adding name='parent' to the parameter list of the property definition. code object module at 03EE4E78, file C:\Users\chris.sanders \Documents\Misc\workspace\WebDev\applications\cube9/models/ db_cube9.py, line 1 I'm not sure if that's an issue of me not having the absolute latest trunk, but it seems like it's just an incompatibility with GAE in the current varriable definition. On Jul 7, 10:30 am, mdipierro mdipie...@cs.depaul.edu wrote: The idea is that any web app is a set of pages that contain stuff. Some are public some are not, some have other permissions, some are listed in a hierarchical menu some not. Therefore it should be possible to develop as app as one creates a wiki, by adding pages and filling the pages. In web2py every URL is mapped into a action. An action is a function + template. In cu29 every URL (technically only those URL managed by the plugin_wiki/page action) is a page. The page is described by the markmin syntax and it can contain stuff because markmin allows to include high level widgets (not to be confused with db.table.field.widget). You can have both together if you apply plugin_wiki from cu29 to your apps. Hope it makes sense. On 7 Lug, 10:18, Jonathan Lundell jlund...@pobox.com wrote: On Jul 7, 2010, at 5:42 AM, mdipierro wrote: The philosophy is the same as T3. Every URL is a wiki. Would you elaborate a little on that statement, please?
Re: [web2py] Re: sequence name issue postgresql
There is a different version number for the windows build : web2py Version 1.79.2 (2010-07-05 23:18:02) I download the src build since I am under linux. Maybe the problem is still there cause of that... test_test is the name of my table. I use this to define my model : db.define_table('test_test', Field('test_id','id'), Field('field1'), Field('field2'),migrate=False) Sequence name are generated automatically by Postgresql : test_test_test_id_seq test_test_test_id_seq table name : test_test table id name : test_id I create my database with pdAdminIII. Richard 2010/7/7 mdipierro mdipie...@cs.depaul.edu Can you help debug? Is test_test_seq_Id the name of the sequence? If not, what is the name? Did you create the sequence? How did you specify the name? Massimo On 7 Lug, 10:48, Richard Vézina ml.richard.vez...@gmail.com wrote: Not solving the problem : Traceback (most recent call last): File /nigthly_build/web2py/gluon/restricted.py, line 178, in restricted exec ccode in environment File /nigthly_build/web2py/applications/app/controllers/test.py /admin/default/edit/devGUImdg1/controllers/test.py, line 785, in module File /nigthly_build/web2py/gluon/globals.py, line 96, in lambda self._caller = lambda f: f() File /nigthly_build/web2py/gluon/tools.py, line 2170, in f return action(*a, **b) File /nigthly_build/web2py/applications/ /admin/default/edit/devGUImdg1/controllers/test.pyapp /admin/default/edit/devGUImdg1/controllers/test.py/controllers/test.py /admin/default/edit/devGUImdg1/controllers/test.py, line 149, in activity if form.accepts(request.vars, session): File /nigthly_build/web2py/gluon/sqlhtml.py, line 1019, in accepts self.vars.id = self.table.insert(**fields) File /nigthly_build/web2py/gluon/sql.py, line 1935, in insert self._db._execute(select currval('%s') % self._sequence_name) File /nigthly_build/web2py/gluon/sql.py, line 960, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) ProgrammingError: ERREUR: la relation « test_test_id_seq » n'existe pas LINE 1: select currval('test_test_id_Seq') Here is the version of the web2py build I download : web2py Version 1.79.2 (2010-07-05 23:18:02) Richard 2010/7/7 mdipierro mdipie...@cs.depaul.edu The trunk will be the nightly built (in the link below) http://web2py.com/examples/default/download in 5 minutes. On 7 Lug, 10:05, Richard Vézina ml.richard.vez...@gmail.com wrote: I don't understand how I can download the trunk build of web2py... Maybe I am not getting it, do I have to copy only the files (sql.py and dal.py) with the mods you had made??? Richard 2010/7/1 mdipierro mdipie...@cs.depaul.edu Actually the mercurial one should be in sync with bazaar one. I have had google code problems with a different project. On 1 Lug, 13:04, Richard Vézina ml.richard.vez...@gmail.com wrote: I will look at it... Do we need to be on launchpad for accessing the bazaar trunk (can't find the download able package) since the mercurial seems to be out dated?? Maybe I have to import it with bazaar? Richard 2010/7/1 mdipierro mdipie...@cs.depaul.edu Hi Richard, I am not convinced this is a good solution. The reason is that two processes perform insert at the same that may not return the ID of previous insert but the last one, therefore the same value. I may be wrong. I have just added to trunk another solution: db.define_table(,sequence_name='table_pk_Seq') so that you can specify your sequence name. This is compatible to what we do for other databases. Please check it and see if it works for you. Massimo On 1 Lug, 10:39, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello Massimo, I hired some guys a couples of weeks ago for fixing sequence name issue with Postgres related to this thread : http://groups.google.com/group/web2py/browse_thread/thread/b4577a0347. .. They come with patch to dal.py and sql.py (from the thread actually) and it work just fine with 1.78.3... I just migrate to 1.79.2 and the flaw with Postgres sequence is still there. I applied again the patch to the dal.py and sql.py of the 1.79.2 and it solve the problem. I am using web2py with those patchs since more of a mounth and I have had no troubles. Do you plan to apply them in web2py in the future releases... I join my patched dal.py and sql.py of 1.79.2 version... Cheers Richard CC.: Lennon Rubin PS.: Here are the changes : sql.py changes around line 1935 : #the following was updated by Eschaton
[web2py] Exception on unknown header when sending mail
Hello, I've got an exception on encode_header in tools.py. This patch seems to correct the problem. Best regards, -Mathieu diff -r a75ecb072248 gluon/tools.py --- a/gluon/tools.py Tue Jul 06 19:22:00 2010 -0500 +++ b/gluon/tools.py Wed Jul 07 18:19:27 2010 +0200 @@ -283,7 +283,7 @@ def encode_header(key): if [c for c in key if 32ord(c) or ord(c)127]: -return header.Header(key.encode('utf-8'),'utf-8') +return Header.Header(key.encode('utf-8'),'utf-8') else: return key diff -r a75ecb072248 gluon/tools.py --- a/gluon/tools.py Tue Jul 06 19:22:00 2010 -0500 +++ b/gluon/tools.py Wed Jul 07 18:19:27 2010 +0200 @@ -283,7 +283,7 @@ def encode_header(key): if [c for c in key if 32ord(c) or ord(c)127]: -return header.Header(key.encode('utf-8'),'utf-8') +return Header.Header(key.encode('utf-8'),'utf-8') else: return key
[web2py] Re: markmin, t2, t3, cube9 etc. (important update)
There should not be a db_cube9.py in the project. Massimo On 7 Lug, 10:55, Chris S sanders.ch...@gmail.com wrote: I've just loaded this from the mercurial source listed on google code. Running on GAE (local dev server) and using the Web2py trunk I'm getting: ReservedWordError: Cannot define property using reserved word 'parent'. If you would like to use this name in the datastore consider using a different name like parent_ and adding name='parent' to the parameter list of the property definition. code object module at 03EE4E78, file C:\Users\chris.sanders \Documents\Misc\workspace\WebDev\applications\cube9/models/ db_cube9.py, line 1 I'm not sure if that's an issue of me not having the absolute latest trunk, but it seems like it's just an incompatibility with GAE in the current varriable definition. On Jul 7, 10:30 am, mdipierro mdipie...@cs.depaul.edu wrote: The idea is that any web app is a set of pages that contain stuff. Some are public some are not, some have other permissions, some are listed in a hierarchical menu some not. Therefore it should be possible to develop as app as one creates a wiki, by adding pages and filling the pages. In web2py every URL is mapped into a action. An action is a function + template. In cu29 every URL (technically only those URL managed by the plugin_wiki/page action) is a page. The page is described by the markmin syntax and it can contain stuff because markmin allows to include high level widgets (not to be confused with db.table.field.widget). You can have both together if you apply plugin_wiki from cu29 to your apps. Hope it makes sense. On 7 Lug, 10:18, Jonathan Lundell jlund...@pobox.com wrote: On Jul 7, 2010, at 5:42 AM, mdipierro wrote: The philosophy is the same as T3. Every URL is a wiki. Would you elaborate a little on that statement, please?
[web2py] Re: markmin, t2, t3, cube9 etc. (important update)
http://vimeo.com/13154869 On 7 Lug, 07:27, mdipierro mdipie...@cs.depaul.edu wrote: # Preamble As you know T2 and T3 are deprecated. Some time ago I started a reimplementation of T3 called cube9. I got stuck. I now re-factored it completely - http://code.google.com/p/cube9/(requires web2py trunk) - It uses markmin: - http://web2py.com/examples/static/markmin.html - cube9 is not completely finished by it works and it already much much better than T2/T3. # What is cube9? Cube 9 is a possible replacement for the welcome app. It is identical to welcome except that - has a different layout - contains a plugin called plugin_wiki (a plugin on steroids) - use a JS menu ## What is plugin_wiki? Plugin_wiki allows a developed (auth.user_id==1 or anybody member of group 'editor') to create dynamic pages on the fly by visiting ``http://127.0.0.1:8000/cube9/plugin_wiki/page/my-new-page-slug`` In fact you do not need cube9 to run plugin_wiki, you can use it for any web2py app. You can use it to add help pages. You can use to allow your users to edit pages. Pages are edited using markmin (via a modified markitup JS editor to support markmin). This email is written using markmin syntax. ## Why plugin_wiki is a plugin on steroids? Because it includes under one name (plugin_wiki) other plugins as embeddable widgets (mediaplyer, comments, tags, multiselect, and more) and there is a way to access them using the markmin syntax. ## A first example For example to include a youtube video in a page you do `` name: youtube code: x1w8hKTJ2Co ``:widget - The double reversed quotes tell markmin to deal with content in a special way. - The :widget tells plugin_wiki to override default behavior and treat this as an embedded widget - the content is treated as parameters (youtube being the name of the widget and x1w8hKTJ2Co being the name of the youtube video you want to embed). There are MANY widgets you can already embed. ## More examples ### Tagging `` name: tags ``:widget ### jqGrid list users `` name: jqgrid table: auth_user ``:widget ### Enbedding a form `` name: create table: auth_user ``:widget ### Embedding template code `` counting... {{for i in range(10):}}{{=i}}{{pass}} ``:template ## Inner workings For a list of widgets look into the static methods of PluginWikiWidgets in models/plugin_wiki.py. The arguments of the methods translate into variables. For example `` class PluginWikiWidgets: # in models/plugin_wiki @staticmethod def abd(x,y=6): ``:code_python is called by `` name: abc x=5 ``:widget (y is optional because y has a default, 6). ### List of Widgets Here is a list of widgets as of today: `` def read(table,record_id=None): ... def create(table,message='',next='',readonly_fields='',hidden_fields='',default_fields=''): ... def update(table,record_id='',message='',next='',readonly_fields='', hidden_fields='',default_fields=''): ... def select(table,query_field='',query_value='',fields=''): ... def search(table,fields=''): ... def jqgrid(table,fieldname=None,fieldvalue=None,col_widths='', _id=None,fields='',col_width=80,width=700,height=300): ... def pie_chart(data,names,width=300,height=150,align='center'): ... def bar_chart(data,names,width=300,height=150,align='center'): ... def youtube(code,width=400,height=250): ... def vimeo(code,width=400,height=250): ... def mediaplayer(src,width=400,height=250): ... def comments(table='None',record_id=None): ... def tags(table='None',record_id=None): ... def tag_cloud(): ... ``:code_python ### Global variables there are two important globals variables: + plugin_wiki_editor = True # or false to disable the wiki + plugin_wiki_level = 3 # for everything, 2 for wiki+widgets, 1 for normal wiki (no code, widgets) ## Conclusions: There is more to this already implemented and there is more to come. For start you can run everything on GAE. Some pages with slug meta-* have special meaning and can be used to edit header, footer, menu, sidebar of cube9 layout. meta-code can be used to define new tables, procedures and services. For security reasons code and widgets can be disabled. I will make a video about this as soon as I have the time (and free up enough memory). Please test it and send me comments. Enjoy! Massimo P.S. I apologize for these names.
[web2py] Re: markmin, t2, t3, cube9 etc. (important update)
The google code repository is corrupted. There are lots of files that do not belong there I will close it and open a new one later today. Let's agree on a new name. On 7 Lug, 12:31, mdipierro mdipie...@cs.depaul.edu wrote: http://vimeo.com/13154869 On 7 Lug, 07:27, mdipierro mdipie...@cs.depaul.edu wrote: # Preamble As you know T2 and T3 are deprecated. Some time ago I started a reimplementation of T3 called cube9. I got stuck. I now re-factored it completely - http://code.google.com/p/cube9/(requiresweb2py trunk) - It uses markmin: - http://web2py.com/examples/static/markmin.html - cube9 is not completely finished by it works and it already much much better than T2/T3. # What is cube9? Cube 9 is a possible replacement for the welcome app. It is identical to welcome except that - has a different layout - contains a plugin called plugin_wiki (a plugin on steroids) - use a JS menu ## What is plugin_wiki? Plugin_wiki allows a developed (auth.user_id==1 or anybody member of group 'editor') to create dynamic pages on the fly by visiting ``http://127.0.0.1:8000/cube9/plugin_wiki/page/my-new-page-slug`` In fact you do not need cube9 to run plugin_wiki, you can use it for any web2py app. You can use it to add help pages. You can use to allow your users to edit pages. Pages are edited using markmin (via a modified markitup JS editor to support markmin). This email is written using markmin syntax. ## Why plugin_wiki is a plugin on steroids? Because it includes under one name (plugin_wiki) other plugins as embeddable widgets (mediaplyer, comments, tags, multiselect, and more) and there is a way to access them using the markmin syntax. ## A first example For example to include a youtube video in a page you do `` name: youtube code: x1w8hKTJ2Co ``:widget - The double reversed quotes tell markmin to deal with content in a special way. - The :widget tells plugin_wiki to override default behavior and treat this as an embedded widget - the content is treated as parameters (youtube being the name of the widget and x1w8hKTJ2Co being the name of the youtube video you want to embed). There are MANY widgets you can already embed. ## More examples ### Tagging `` name: tags ``:widget ### jqGrid list users `` name: jqgrid table: auth_user ``:widget ### Enbedding a form `` name: create table: auth_user ``:widget ### Embedding template code `` counting... {{for i in range(10):}}{{=i}}{{pass}} ``:template ## Inner workings For a list of widgets look into the static methods of PluginWikiWidgets in models/plugin_wiki.py. The arguments of the methods translate into variables. For example `` class PluginWikiWidgets: # in models/plugin_wiki @staticmethod def abd(x,y=6): ``:code_python is called by `` name: abc x=5 ``:widget (y is optional because y has a default, 6). ### List of Widgets Here is a list of widgets as of today: `` def read(table,record_id=None): ... def create(table,message='',next='',readonly_fields='',hidden_fields='',default_fields=''): ... def update(table,record_id='',message='',next='',readonly_fields='', hidden_fields='',default_fields=''): ... def select(table,query_field='',query_value='',fields=''): ... def search(table,fields=''): ... def jqgrid(table,fieldname=None,fieldvalue=None,col_widths='', _id=None,fields='',col_width=80,width=700,height=300): ... def pie_chart(data,names,width=300,height=150,align='center'): ... def bar_chart(data,names,width=300,height=150,align='center'): ... def youtube(code,width=400,height=250): ... def vimeo(code,width=400,height=250): ... def mediaplayer(src,width=400,height=250): ... def comments(table='None',record_id=None): ... def tags(table='None',record_id=None): ... def tag_cloud(): ... ``:code_python ### Global variables there are two important globals variables: + plugin_wiki_editor = True # or false to disable the wiki + plugin_wiki_level = 3 # for everything, 2 for wiki+widgets, 1 for normal wiki (no code, widgets) ## Conclusions: There is more to this already implemented and there is more to come. For start you can run everything on GAE. Some pages with slug meta-* have special meaning and can be used to edit header, footer, menu, sidebar of cube9 layout. meta-code can be used to define new tables, procedures and services. For security reasons code and widgets can be disabled. I will make a video about this as soon as I have the time (and free up enough memory). Please test it and send me comments. Enjoy! Massimo P.S. I apologize for these names.
Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)
I should say that the template used (seen in the video) is very pretty. On Wed, Jul 7, 2010 at 7:35 PM, mdipierro mdipie...@cs.depaul.edu wrote: The google code repository is corrupted. There are lots of files that do not belong there I will close it and open a new one later today. Let's agree on a new name. On 7 Lug, 12:31, mdipierro mdipie...@cs.depaul.edu wrote: http://vimeo.com/13154869 On 7 Lug, 07:27, mdipierro mdipie...@cs.depaul.edu wrote: # Preamble As you know T2 and T3 are deprecated. Some time ago I started a reimplementation of T3 called cube9. I got stuck. I now re-factored it completely - http://code.google.com/p/cube9/(requiresweb2py trunk) - It uses markmin: - http://web2py.com/examples/static/markmin.html - cube9 is not completely finished by it works and it already much much better than T2/T3. # What is cube9? Cube 9 is a possible replacement for the welcome app. It is identical to welcome except that - has a different layout - contains a plugin called plugin_wiki (a plugin on steroids) - use a JS menu ## What is plugin_wiki? Plugin_wiki allows a developed (auth.user_id==1 or anybody member of group 'editor') to create dynamic pages on the fly by visiting ``http://127.0.0.1:8000/cube9/plugin_wiki/page/my-new-page-slug`` In fact you do not need cube9 to run plugin_wiki, you can use it for any web2py app. You can use it to add help pages. You can use to allow your users to edit pages. Pages are edited using markmin (via a modified markitup JS editor to support markmin). This email is written using markmin syntax. ## Why plugin_wiki is a plugin on steroids? Because it includes under one name (plugin_wiki) other plugins as embeddable widgets (mediaplyer, comments, tags, multiselect, and more) and there is a way to access them using the markmin syntax. ## A first example For example to include a youtube video in a page you do `` name: youtube code: x1w8hKTJ2Co ``:widget - The double reversed quotes tell markmin to deal with content in a special way. - The :widget tells plugin_wiki to override default behavior and treat this as an embedded widget - the content is treated as parameters (youtube being the name of the widget and x1w8hKTJ2Co being the name of the youtube video you want to embed). There are MANY widgets you can already embed. ## More examples ### Tagging `` name: tags ``:widget ### jqGrid list users `` name: jqgrid table: auth_user ``:widget ### Enbedding a form `` name: create table: auth_user ``:widget ### Embedding template code `` counting... {{for i in range(10):}}{{=i}}{{pass}} ``:template ## Inner workings For a list of widgets look into the static methods of PluginWikiWidgets in models/plugin_wiki.py. The arguments of the methods translate into variables. For example `` class PluginWikiWidgets: # in models/plugin_wiki @staticmethod def abd(x,y=6): ``:code_python is called by `` name: abc x=5 ``:widget (y is optional because y has a default, 6). ### List of Widgets Here is a list of widgets as of today: `` def read(table,record_id=None): ... def create(table,message='',next='',readonly_fields='',hidden_fields='',default_fields=''): ... def update(table,record_id='',message='',next='',readonly_fields='', hidden_fields='',default_fields=''): ... def select(table,query_field='',query_value='',fields=''): ... def search(table,fields=''): ... def jqgrid(table,fieldname=None,fieldvalue=None,col_widths='', _id=None,fields='',col_width=80,width=700,height=300): ... def pie_chart(data,names,width=300,height=150,align='center'): ... def bar_chart(data,names,width=300,height=150,align='center'): ... def youtube(code,width=400,height=250): ... def vimeo(code,width=400,height=250): ... def mediaplayer(src,width=400,height=250): ... def comments(table='None',record_id=None): ... def tags(table='None',record_id=None): ... def tag_cloud(): ... ``:code_python ### Global variables there are two important globals variables: + plugin_wiki_editor = True # or false to disable the wiki + plugin_wiki_level = 3 # for everything, 2 for wiki+widgets, 1 for normal wiki (no code, widgets) ## Conclusions: There is more to this already implemented and there is more to come. For start you can run everything on GAE. Some pages with slug meta-* have special meaning and can be used to edit header, footer, menu, sidebar of cube9 layout. meta-code can be used to define new tables, procedures and services. For security reasons code and widgets can be
Re: [web2py] Re: Initiating table
The recent piece of code doesn't give any error when I load the default/index page, but there are no input fields on default/data/create/A and when I click on submit on this page I get an error. I suppose the problem lies in either the pointer-like call *fields or in the way I try to redefine fields . Perhaps I should import the ctype library? On 7/6/10, Rick Hultgren sababa.sab...@gmail.com wrote: ooops... this should be the correct code: letters=['A', 'B', 'C'] fields=[] for letter in letters: db.define_table(letter, *fields) fields=[Field(item+'_id', db[item]) for item in letters] ...sorry for the bad code int the previous message. On 7/6/10, Rick Hultgren sababa.sab...@gmail.com wrote: ...so these tables: db.define_table( 'A', Field( 'A_id', db.A), Field( 'B_id', db.B), Field( 'C_id', db.C)) db.define_table( 'B', Field( 'A_id', db.A), Field( 'B_id', db.B), Field( 'C_id', db.C)) db.define_table( 'C', Field( 'A_id', db.A), Field( 'B_id', db.B), Field( 'C_id', db.C)) ...can be generated with this code: letters=['A', 'B', 'C'] fields=[] for letter in letters: db.define_table(letter, *fields) fields=[Field(item) for item in letters] Thanks a lot for the help! On 7/4/10, mdipierro mdipie...@cs.depaul.edu wrote: No. Given db.define_table('sometable',*fields), you cannot add fields outside this statement but you can call the statement in a separate http request and add fields to the *fields list. On 4 Lug, 13:45, Rick Hultgren sababa.sab...@gmail.com wrote: ...with other words -- how to add fields to a table that is already declared? Is it possible? On 7/4/10, Rick Hultgren sababa.sab...@gmail.com wrote: perhaps the table names will be changed, so please don't bother about before and after...the point is -- how to refer/link to the table name locus, when that table is not yet created/declared/made? On 7/4/10, Rick Hultgren sababa.sab...@gmail.com wrote: Thanks for the answers. I'm trying to create these tables: db.define_table( 'substance', Field( 'substance', db.substance), Field( 'process', db.process), Field( 'condition', db.condition), Field( 'locus', db.locus), Field( 'name'), Field( 'main_name')) db.define_table( 'process', Field( 'substance', db.substance), Field( 'process', db.process), Field( 'condition', db.condition), Field( 'locus', db.locus), Field( 'name'), Field( 'main_name')) db.define_table( 'condition', Field( 'substance', db.substance), Field( 'process', db.process), Field( 'condition', db.condition), Field( 'locus', db.locus), Field( 'name'), Field( 'main_name')) db.define_table( 'locus', Field( 'substance', db.substance), Field( 'process', db.process), Field( 'condition', db.condition), Field( 'locus', db.locus), Field( 'name'), Field( 'main_name')) On 7/4/10, mdipierro mdipie...@cs.depaul.edu wrote: Could you explain to us in English what you are trying to model? I am sure there is a simpler solution using link tables. On 3 Lug, 12:14, Rick Hultgren sababa.sab...@gmail.com wrote: Thanks for the link. My actual problem is more complicated than the example I gave. I realize that I need to link a field to a table that isn't initiated yet (item2): objects = ['substance', 'process', 'condition', 'locus'] linksubobjects = ['locus', 'before', 'after'] unlinksubobjects = ['name', 'main_name'] for object in objects: for item1 in linksubobjects+unlinksubobjects: for item2 in objects: fields=[Field(item1, 'reference item2')] db.define_table(object,*fields) I suppose the solution would be to initiate the table names and then add the fields either in db.py, or in the controller file. But I have no idea how to do this. On 7/3/10, Yarko Tymciurak resultsinsoftw...@gmail.com wrote: The online book has a fairly useful search; For your question, see: http://web2py.com/book/default/section/6/13 Regards, - Yarko On Jul 3, 8:45 am, Rick sababa.sab...@gmail.com wrote: Hi, I would like to link a table to its own model like this: db.define_table('person', Field('name'), Field('child', db.person)) I understand that I should first initiate the table and then link it to itself. But how to do that? Thanks in advance for help!
Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)
On Jul 7, 2010, at 8:25 AM, mdipierro wrote: you link pages with [[this is the link text page:this-is-the-slug]] So page: is recognized by the wiki plugin? If I'm understanding the syntax, and I may not be, I have a suggestion. [[name]] and [[name#anchor]] should be wiki links; [[#anchor]] remains a link to a local anchor, wiki or not. [[=name]] defines an anchor. So (again if I'm following you), [[name]] would be a shortcut for [[name page:name]]. My reasoning is that [[link]] is so established (and convenient) a wiki notation that it should be preserved, and that defining an anchor is much less frequent, so the extra '=' is not much of a burden. and you include attachments with [[this is an image attachment:id center 200px]] On 7 Lug, 10:05, Jonathan Lundell jlund...@pobox.com wrote: On Jul 7, 2010, at 5:27 AM, mdipierro wrote: As you know T2 and T3 are deprecated. Some time ago I started a reimplementation of T3 called cube9. I got stuck. I now re-factored it completely - http://code.google.com/p/cube9/(requires web2py trunk) - It uses markmin: - http://web2py.com/examples/static/markmin.html - With markmin (or perhaps cu29 -- why that?), how does one reference local wiki pages without using their full URL? For example, in Wikipedia, this is a link: [[web2py]]. But in markmin it creates an anchor.
Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)
Back to naming, should we vote? Here are the suggestions so far: 1) cu29 2) cube2py 3) w2cube 4) cube29 5) Cube^2 For me +1 for cube2py and +1 for cube29. Which ones do you people prefer? Cheers, Julio Monteiro
[web2py] web2py performance issue or rather my fault?
I had prepared some mini-portal, I have 1000 unique visits a day but there is a performance issue bandwidth is ok memory is ok processor load is ok cache.ram is set for almost all of the queries, and is set for 1 hour but sometimes, once every few hits, it loads signifacantly slower weirdest thing is when you re-click the link it loads instantly, when you left it working to load on itself, it is slow.. like 4 to 8 seconds what could it be? where to look for an answer? I think some of you had to see this before.. -- Kuba
[web2py] permission on particular column
Hello, 0 at auth_permission.record_id meens all the table... How may I specify permission only on particular column ?? Thanks Jonhy
[web2py] Re: markmin, t2, t3, cube9 etc. (important update)
I vote +1 cube2py and Cube^2 +1 Kenneth
[web2py] new web2py site in Poland!
Hi, people, I would like to present you WRSZW project http://wrszw.pl it is about events in Warsaw, capital of Poland, fully non-commercial initiative of places in my city. polish only but english is coming, web2py rocks. it was a pleasure to make it happen :) -- Kuba
Re: [web2py] web2py performance issue or rather my fault?
I have experienced this under high capacity on my web2py sites. I have not found a solution to the issue as of yet. All I can say is I have done AB testing comparing different python web frameworks with a basic database IO, web2py just doesn't perform under high load. Perhaps it is a coding issue with *how* you are caching your queries. When caching in ram, *each* web2py process has to cache its own version of the select. So if you reload a couple of times, apache( or your web server ) might determine it needs to spawn another process, which then in turn needs to cache all of the queries again. Solution: A) Use memcached B) or cache on disk AND ram, so if a new process starts, doesn't have it cached in ram, it will pull from the disk much quicker than re-executing the query. A is better. -- Thadeus On Wed, Jul 7, 2010 at 3:04 PM, Kuba Kucharski kuba.kuchar...@gmail.com wrote: I had prepared some mini-portal, I have 1000 unique visits a day but there is a performance issue bandwidth is ok memory is ok processor load is ok cache.ram is set for almost all of the queries, and is set for 1 hour but sometimes, once every few hits, it loads signifacantly slower weirdest thing is when you re-click the link it loads instantly, when you left it working to load on itself, it is slow.. like 4 to 8 seconds what could it be? where to look for an answer? I think some of you had to see this before.. -- Kuba
Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)
Same as Kenneth I vote +1 cube2py and Cube^2 +1 On Wed, Jul 7, 2010 at 10:31 PM, Kenneth kenneth.t.lundst...@gmail.comwrote: I vote +1 cube2py and Cube^2 +1 Kenneth
[web2py] ajax call to controller function from within a view
greetings all, i'm looking for some advice regarding using ajax to call a function, from a view within the same controller. so for example, i'm in the view /app/controller/view1, and from the view 'view1' i would like to call another function/view from within 'view1' without leaving 'view1'. i hope this makes sense. :) to explain the scenario in a little more detail. when i access 'view1', i instantiate an object which is an SSH client. this object needs to be available to all the functions within the controller, in order to maintain it's state (an active SSH session). i would like to do this without leaving the view i arrived on 'view1', and update that same view based on results/states of that object. i'm hoping that ajax can help out with this. thanks for reading!
[web2py] Re: markmin, t2, t3, cube9 etc. (important update)
From those I prefer cube2py because of similarity with web2py and the most important, sound! I would like to sugest too, how about mix a little bit and come with Wube ? On 7 jul, 17:31, Kenneth kenneth.t.lundst...@gmail.com wrote: I vote +1 cube2py and Cube^2 +1 Kenneth
[web2py] Re: Will rocket close connections if it takes long time?
Candid and I discussed this off list. The sum-up is this: Iceberg, you hit the nail on the head with my position. However, it's clear that not everyone uses this feature and it may be more useful to others if it had a configurable thread-timeout. I told Candid that I'd investigate the effort it would take to add this feature. Stay tuned. Whether or not Massimo thinks this feature would be good for web2py is up to him, but even if added, it would not be the Rocket default. -tim On Jul 7, 9:13 am, Iceberg iceb...@21cn.com wrote: I have different opinion, Candid. As Timbo and I have discussed in this thread, rocket differentiates long running requests, seeing it is caused by client side or server side. Rocket only terminates long request comes from the client side, say, a very slow http request from a client (possibly a DoS attack). On the contrary, on the server side, it is the app (a.k.a. its developer) 's responsibility to ensure most requests can be served quickly, and it is also developer's right to occasionally do long time calculation whenever needed. Rocket gives developer the flexibility to choose what they want. That is better than killing a (long) running thread unconditionally. I love rocket. :-) Best regards, Iceberg, 2010-Jul-07, 21:47(PM), Wed --- Original Message --- From: Candid roman.bat...@gmail.com Sender: web2py@googlegroups.com To: web2py-users web2py@googlegroups.com Date: Wed, 7 Jul 2010 05:21:16 -0700 (PDT) Subject: [web2py] Re: Will rocket close connections if it takes long time? --- Thank you for clarification, Timbo. Is not #3 a problem though? If Rocket doesn't terminate the request if it's running for too long, is not Rocket's thread pool going to be exhausted if it runs too many long running requests? The problem here is that one application could potentially exhaust all working thread, preventing rocket from serving request for other applications. It looks like this is what's happening to one of my server - see this discussion:http://groups.google.com/group/web2py/browse_thread/thread/34f5411692... Am I missing something or is this how it's supposed to be? On Jul 5, 12:33 am, Timbo tfarr...@owassobible.org wrote: 1) True 2) Basically true. You seem to indicate that 1 2 should not co- exist or are somehow at odds with each other. If that's what you're indicating, I'm not following your logic as to why they should be mutually exclusive. Can you explain a little more? 3) In Rocket's case, no. While a client could disconnect at anytime, Rocket will allow the application server to run a request as long as it likes. If the client connection is still open when it's ready to send it's response, it will send successfully. Rocket does not kill threads that run for too long. 4) Rocket always applies the socket timeout (rocket.py line 854), this should override Py2.5's default (whatever it may be). Rocket enables Python's socket timeout protection on every Python platform that supports it. Does this clear things up? On Jul 4, 4:30 am, Iceberg iceb...@21cn.com wrote: Thanks for all these info, Tim. You said: The timeout ... is a timeout based on inactivity between http requests. So the long requests that Iceberg is seeing are perfectly normal and acceptable. According to my reading of the rocket-science code (and I could be wrong), here is my understanding and questions: 1. The timeout is a timeout based on inactivity since one request socket's latest select-and-readable event. The time gap could be caused by two http requests which somehow reuse the socket (because keep-alive?), or caused by one very slow http request from a client (possibly a DoS attack). 2. BUT the timeout check is only performed after the request's socket encountered socket.timeout exception. According to line 800 of rocket.py: if typ == SocketTimeout: self.err_log.debug('Socket timed out') self.wait_queue.put(self.conn) And then the request's control is transferred to the Monitor, the timeout check is at line 449 of rocket.py: if now - c.start_time = self.timeout: stale.add(c) 3. What if, a normal request is read from client side within seconds, then being calculated for quite some time on the server side, will this situation trigger the timeout protection? I guess not, because no socket.timeout will be raised during the calculation, although the final calculated result will probably not be sent due to the socket is already timeout or even closed from the client side. If this is true (is it?), then my maintenance scenario is still doable because no result is expected, I only need the maintenance job can
[web2py] Re: permission on particular column
This is not supported On 7 Lug, 15:19, Jean-Guy jean...@gmail.com wrote: Hello, 0 at auth_permission.record_id meens all the table... How may I specify permission only on particular column ?? Thanks Jonhy
[web2py] Re: permission on particular column
Actually. You can do it you implement it yourself auth.add_permission(group_id,'read','tablename.fieldname') then check for permissions @auth.has_permission('read','tablename.fieldname') On 7 Lug, 15:19, Jean-Guy jean...@gmail.com wrote: Hello, 0 at auth_permission.record_id meens all the table... How may I specify permission only on particular column ?? Thanks Jonhy
[web2py] Re: web2py performance issue or rather my fault?
Can you tell us more about the setting of this test. Did you use apache or the built-in server? Did you use the same server in all cases? Massimo On 7 Lug, 16:06, Thadeus Burgess thade...@thadeusb.com wrote: I have experienced this under high capacity on my web2py sites. I have not found a solution to the issue as of yet. All I can say is I have done AB testing comparing different python web frameworks with a basic database IO, web2py just doesn't perform under high load. Perhaps it is a coding issue with *how* you are caching your queries. When caching in ram, *each* web2py process has to cache its own version of the select. So if you reload a couple of times, apache( or your web server ) might determine it needs to spawn another process, which then in turn needs to cache all of the queries again. Solution: A) Use memcached B) or cache on disk AND ram, so if a new process starts, doesn't have it cached in ram, it will pull from the disk much quicker than re-executing the query. A is better. -- Thadeus On Wed, Jul 7, 2010 at 3:04 PM, Kuba Kucharski kuba.kuchar...@gmail.com wrote: I had prepared some mini-portal, I have 1000 unique visits a day but there is a performance issue bandwidth is ok memory is ok processor load is ok cache.ram is set for almost all of the queries, and is set for 1 hour but sometimes, once every few hits, it loads signifacantly slower weirdest thing is when you re-click the link it loads instantly, when you left it working to load on itself, it is slow.. like 4 to 8 seconds what could it be? where to look for an answer? I think some of you had to see this before.. -- Kuba
[web2py] Re: markmin, t2, t3, cube9 etc. (important update)
Right now you can do links with url [[name url]] [[name #anchor]] [[name url#anchor]] [[name page:slug]] and define an anchor with [[anchor]] If I understand your suggestions: 1) also allow [[url]] [[url#anchor]] [[#anchor]] [[page:slug]] to allow un-named links. Q: how can a link not have a name? 2) use [[=anchor]] to define an anchor to avoid conflict with 1. if we do 1, we must do 2 but I would prefer [[!anchor]] then. Massimo On 7 Lug, 13:20, Jonathan Lundell jlund...@pobox.com wrote: On Jul 7, 2010, at 8:25 AM, mdipierro wrote: If I'm understanding the syntax, and I may not be, I have a suggestion. [[name]] and [[name#anchor]] should be wiki links; [[#anchor]] remains a link to a local anchor, wiki or not. [[=name]] defines an anchor.
Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)
On Jul 7, 2010, at 3:14 PM, mdipierro wrote: Right now you can do links with url [[name url]] [[name #anchor]] [[name url#anchor]] [[name page:slug]] and define an anchor with [[anchor]] If I understand your suggestions: 1) also allow [[url]] [[url#anchor]] [[#anchor]] [[page:slug]] to allow un-named links. Q: how can a link not have a name? In your notation, I was thinking: [[slug]] would imply [[slug page:slug]] 'slug' would be used verbatim as the name, and with slug-encoding as the slug. A link would always have a name; it would just be implicit. That's the Mediawiki convention, though they use a vertical bar to separate an optional name from the slug. 2) use [[=anchor]] to define an anchor to avoid conflict with 1. if we do 1, we must do 2 but I would prefer [[!anchor]] then. Sure. Or [name:anchor], which corresponds to the html that it generates.
[web2py] Re: markmin, t2, t3, cube9 etc. (important update)
I do not have a strong opposition and I see the advantages in terms of notation but I have two problems: The page:slug notation is handled by plugin_wiki, not by markmin. markmin just treats url, #anchor, url#anchor, page:slug all in the same way. plugin_wiki replaces the page:.. with /app/plugin_wiki/ page/ after markmin has done its job. This decoupling was intentional to allow markmin to work without web2py and without plugin_wiki conventions. Your first suggestion would introduce coupling. Moreover it would provide a shortcut that encourage users to display the slug as text of the link. I am not convinced this is a good idea. Massimo On 7 Lug, 17:24, Jonathan Lundell jlund...@pobox.com wrote: On Jul 7, 2010, at 3:14 PM, mdipierro wrote: Right now you can do links with url [[name url]] [[name #anchor]] [[name url#anchor]] [[name page:slug]] and define an anchor with [[anchor]] If I understand your suggestions: 1) also allow [[url]] [[url#anchor]] [[#anchor]] [[page:slug]] to allow un-named links. Q: how can a link not have a name? In your notation, I was thinking: [[slug]] would imply [[slug page:slug]] 'slug' would be used verbatim as the name, and with slug-encoding as the slug. A link would always have a name; it would just be implicit. That's the Mediawiki convention, though they use a vertical bar to separate an optional name from the slug. 2) use [[=anchor]] to define an anchor to avoid conflict with 1. if we do 1, we must do 2 but I would prefer [[!anchor]] then. Sure. Or [name:anchor], which corresponds to the html that it generates.
[web2py] Re: new web2py site in Poland!
I like the design but do not understand a word. can you tell us more about what it is about? On 7 Lug, 15:46, Kuba Kucharski kuba.kuchar...@gmail.com wrote: Hi, people, I would like to present you WRSZW project http://wrszw.pl it is about events in Warsaw, capital of Poland, fully non-commercial initiative of places in my city. polish only but english is coming, web2py rocks. it was a pleasure to make it happen :) -- Kuba
[web2py] Re: ajax call to controller function from within a view
On 7 Lug, 16:11, Jacques van der Merwe vanderme...@gmail.com wrote: greetings all, i'm looking for some advice regarding using ajax to call a function, from a view within the same controller. so for example, i'm in the view /app/controller/view1, and from the view 'view1' i would like to call another function/view from within 'view1' without leaving 'view1'. i hope this makes sense. :) This can be done but does not solve your problem below because to explain the scenario in a little more detail. when i access 'view1', i instantiate an object which is an SSH client. this object needs to be available to all the functions within the controller, in order to maintain it's state (an active SSH session). This cannot be done. In a production environment the web server starts and stops processes and threads at will. You cannot preserve the state of an SSH connection. You need a separate process running in background that does this and communicates with the app somehow, perhaps via xmlrpc. i would like to do this without leaving the view i arrived on 'view1', and update that same view based on results/states of that object. i'm hoping that ajax can help out with this. thanks for reading!
Re: [web2py] Re: new web2py site in Poland!
cultural clubs, coffe places, museums, organizations, theatres, old-school cinemas, ngos are the actors here. they set they info, profile etc, and add events they organize. so people from Warsaw can have information about those events - fast and easier than facebook or (overloaded with ads and to much data) standard portals.. when you click on the event it opens and show you more detailed data and graphics/photo/movie/text etc. places can use html inside event description. simple. click the aktualnosci link on the upper-left and you will see all the events next week. sorry for not being able to show you the english version.
[web2py] Re: new web2py site in Poland!
Awesome work, I always enjoy seeing a production site using web2py. On a side note - Google translate did a pretty good job translating it for me - in case anyone else was interested in seeing the site in an english form. On Jul 7, 6:06 pm, Kuba Kucharski kuba.kuchar...@gmail.com wrote: cultural clubs, coffe places, museums, organizations, theatres, old-school cinemas, ngos are the actors here. they set they info, profile etc, and add events they organize. so people from Warsaw can have information about those events - fast and easier than facebook or (overloaded with ads and to much data) standard portals.. when you click on the event it opens and show you more detailed data and graphics/photo/movie/text etc. places can use html inside event description. simple. click the aktualnosci link on the upper-left and you will see all the events next week. sorry for not being able to show you the english version.
Re: [web2py] ajax call to controller function from within a view
unsubscribe On Thu, Jul 8, 2010 at 12:11 AM, Jacques van der Merwe vanderme...@gmail.com wrote: greetings all, i'm looking for some advice regarding using ajax to call a function, from a view within the same controller. so for example, i'm in the view /app/controller/view1, and from the view 'view1' i would like to call another function/view from within 'view1' without leaving 'view1'. i hope this makes sense. :) to explain the scenario in a little more detail. when i access 'view1', i instantiate an object which is an SSH client. this object needs to be available to all the functions within the controller, in order to maintain it's state (an active SSH session). i would like to do this without leaving the view i arrived on 'view1', and update that same view based on results/states of that object. i'm hoping that ajax can help out with this. thanks for reading!
[web2py] Re: ajax call to controller function from within a view
thanks for the reply. my other alternative is to recreate the SSH session everytime i jump into a new function. i just need to work out how to call these functions in the controller using ajax and remaining in the view. any ideas? On Jul 8, 12:51 am, mdipierro mdipie...@cs.depaul.edu wrote: On 7 Lug, 16:11, Jacques van der Merwe vanderme...@gmail.com wrote: greetings all, i'm looking for some advice regarding using ajax to call a function, from a view within the same controller. so for example, i'm in the view /app/controller/view1, and from the view 'view1' i would like to call another function/view from within 'view1' without leaving 'view1'. i hope this makes sense. :) This can be done but does not solve your problem below because to explain the scenario in a little more detail. when i access 'view1', i instantiate an object which is an SSH client. this object needs to be available to all the functions within the controller, in order to maintain it's state (an active SSH session). This cannot be done. In a production environment the web server starts and stops processes and threads at will. You cannot preserve the state of an SSH connection. You need a separate process running in background that does this and communicates with the app somehow, perhaps via xmlrpc. i would like to do this without leaving the view i arrived on 'view1', and update that same view based on results/states of that object. i'm hoping that ajax can help out with this. thanks for reading!
[web2py] Re: Password verification - how to?
OK. I had managed to display INPUT field for password verification in my form BUT it's not encrypted. The values I write in this field are readable instead of dots or stars: **. Can you tell me how to add that part to the form field? On 7 Lip, 13:49, mdipierro mdipie...@cs.depaul.edu wrote: If you have a custom form, you should perform two steps: 1) manually insert the passoword 2 in the form tr thlabel for=password id=password{{=lbl.password}}/ label/th td{{=wdgt.password}}td /tr tr ...tdinput name=password2 /{{if form.errors.password2:}} div class=errorNO MATCH/div{{pass}}/td /tr 2) serverside you just do form.append(INPUT(_name='password2',requires=IS_EXPR('value=%s' % repr(request.vars.password))) On 6 Lug, 18:30, elfuego1 elfue...@gmail.com wrote: Passwordfield in my form looks like this: tr thlabel for=password id=password{{=lbl.password}}/ label/th td{{=wdgt.password}}td /tr Next how should I invoke: form.element(_name='password').parent().append(INPUT(_name='password2',requires=IS_EXPR('value= %s' % repr(request.vars.password)) )) to recive next input field forpasswordverification? How should I define TD=??? to have it working? On 6 Lip, 20:28, mdmcginn michael.d.mcgin...@gmail.com wrote: Seehttp://web2py.com/book/default/section/5/2fordocumentationon HTML Helpers. I believe Massimo's solution assumes there are tables in your form, which is the default for FORM and SQLFORM. If your form doesn't contain HTML elements such as tabletrtd, maybe you're using div or span instead. Look at your HTML - hopefully there is some semantic/DOM code in there that you could hook into. If you're depending on br to format your form instead, Massimo's solution probably won't help you much (and neither will CSS or AJAX). On Jul 6, 1:27 am, elfuego1 elfue...@gmail.com wrote: No, I don't. So does TD supposed to work as a variable or list? And what if I'd like to use form.element again? Do I append another form.element to TD and us it as a list? How do I address the value that is assigned to TD: TD[0], TD[1] and why is it TD in the first place? Is out there some description or example of this syntax? Best regards. On 6 Lip, 07:35, KR kaerbu...@gmail.com wrote: Do you have somewhere in your code TD=something ? On 6 juil, 01:18, elfuego1 elfue...@gmail.com wrote: Can you please tell me yet how to implement it, so it would start working in my form and verify thepassword? When I add it to view: user.html or controller default.py then I receive: TypeError: 'TD' object is not callable So please let me know how to use form.element syntax to make it work properly. On 4 Lip, 17:08, mdipierro mdipie...@cs.depaul.edu wrote: form.element(_name=='password').insert(INPUT(_name='password2',requires=IS_ EXPR('value= %s' % repr(request.vars.password)) )) should have been form.element(_name='password').parent().append(INPUT(_name='password2',requ ires=IS_EXPR('value= %s' % repr(request.vars.password)) )) form.element(_name='password') finds the INPUT(name=password) item form.element(_name='password').parent() finds the parent of such element, the TD() form.element(_name='password').parent().append(...) appends something to the TD() INPUT(_name='password2',) is the appened input name=password2 field This: requires=IS_EXPR('value=%s' % repr(request.vars.password)) sets the requirements. i.e. the value ofpasswordis the same as the value of fields request.vars,password On 4 Lug, 09:37, elfuego1 elfue...@gmail.com wrote: I'm trying to make a use of this piece of code but nothing works. Can you please tell me where can I find some fine documentation that shows exactly how to use it or maybe write me an example because I have no idea where to put it in my form to make it work. HELP PLEASE!! form.element(_name=='password').insert(INPUT(_name='password2',requires=IS_ EXPR('value= %s' % repr(request.vars.password)) )) or another example How do I use this piece of code to customize form field length??? form.element(_name='last_name')['_size']=20 Can anyone show me how to do that because there is no example in documentation, no properly written piece of code to meke use of. On 2 Lip, 12:25, elfuego1 elfue...@gmail.com wrote: Thank you for your speedy help!!! On 2 Lip, 12:13, mdipierro mdipie...@cs.depaul.edu wrote: you can do for example (assuming trunk) form.element(_name=='password').insert(INPUT(_name='password2',requires=IS_
[web2py] Beginner Question
I apologize for a seemingly simple question, but what exactly does '% (title)s' do? I ran across it in the book in the wiki section, the whole line reads. db.document.page_id.requires = IS_IN_DB(db, 'page.id', '%(title)s') Thanks in advance, ra3don.
Re: [web2py] Beginner Question
Take a look to the String Formating and String Interpolation in Python Documentation http://docs.python.org/library/stdtypes.html#string-formatting-operations 2010/7/7 ra3don ra3do...@gmail.com: I apologize for a seemingly simple question, but what exactly does '% (title)s' do? I ran across it in the book in the wiki section, the whole line reads. db.document.page_id.requires = IS_IN_DB(db, 'page.id', '%(title)s') Thanks in advance, ra3don. -- http://rochacbruno.com.br
Re: [web2py] Beginner Question
Open a Python terminal, and try this example d = {'id':1,'title':'web2py'} d {'id': 1, 'title': 'web2py'} Title for id %(id)s is %(title)s % d 'Title for id 1 is web2py ' 2010/7/7 Bruno Rocha rochacbr...@gmail.com: Take a look to the String Formating and String Interpolation in Python Documentation http://docs.python.org/library/stdtypes.html#string-formatting-operations 2010/7/7 ra3don ra3do...@gmail.com: I apologize for a seemingly simple question, but what exactly does '% (title)s' do? I ran across it in the book in the wiki section, the whole line reads. db.document.page_id.requires = IS_IN_DB(db, 'page.id', '%(title)s') Thanks in advance, ra3don. -- http://rochacbruno.com.br -- http://rochacbruno.com.br