[web2py] Re: db define error
Mind that you have written db.define.table instead of db.define_table Paolo On Friday, June 5, 2015 at 6:26:00 AM UTC+2, Dan Hett wrote: I am getting an error for this table creation: db.define.table('blade_location', Field('bladeID','reference blade'), Field('locationID','integer'), Field('widgetID','integer'), Field('moduleType')) Getting this error: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. Traceback (most recent call last): File C:\web2py\gluon\restricted.py, line 227, in restricted exec ccode in environment File C:/web2py/applications/dan/models/db.py http://127.0.0.1:8000/admin/default/edit/dan/models/db.py, line 75, in module db.define.table('blade_location', File C:\web2py\gluon\packages\dal\pydal\base.py, line 906, in __getattr__ return super(DAL, self).__getattr__(key) File C:\web2py\gluon\packages\dal\pydal\helpers\classes.py, line 348, in __getattr__ raise AttributeError Attr Table before this one looks like this: db.define_table('blade', auth.signature, Field('topicID','integer','default=0'), Field('layoutType'), Field('name'), Field('description'), Field('rateUp','boolean'), Field('rateOK','boolean'), Field('rateDown','boolean'), Field('views','integer'), Field('weight','integer'), Field('privateLevel','integer')) Any ideas? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Web2py mobile app using Kivy
QT is ok if you can code in c++ but kivy works in python and using qml a powerful language to create your interface. Cordova is great if you want a webpage in your phone. I don't like how slow it is. On Fri, Jun 5, 2015 at 7:25 AM Gary Cowell gary.cow...@gmail.com wrote: This UI independence is the most important thing, actually (for me) There's the 'Visual Basic' way of coding, where each control component will contain the business logic for the thing that happens when you press the button. I see this so often. But better, is to have a module, or modules, that perform the business logic, interact with other web services, and have web2py call upon these module functions when UI interactions take place. In this way, you can build useful things using your business rules, from command line admin tools, to web apps using 'framework of the day', to desktop or mobile GUI apps in Kivy or anything else, and you're always leveraging your module code. Example, I was working on a tool to interact with Amazon Web Services, cloudformation stack creation etc. Originally I built the app using pyqt, but then I switched to pyside, not a huge change there, but still. Then I built a new UI in kivy and deployed an android version. Finally the production version I built with web2py and it's there still. I could have used django at that point, or turbogears, or whatever (although I most like web2py for web development in python). Point is though, I didn't have to rewrite 80% of my code each time. Just the UI parts, and learning things like ajax reloading in web2py. This was developing the entire app on a new platform. If I'd started with web2py, and built and deployed the first version on that platform as you have done, then any mobile development would most likely have used web services exposed by my web2py app, and interacted with those. Seeing you already have a web2py app running, exposing some services you want to access via mobile seems like the way to do it to me. On Tuesday, 2 June 2015 00:36:09 UTC+1, Encompass solutions wrote: The best thing to do here is abstract your interface. Web2py does a fine job of it. Most likely your wanting to make the app and then communicate over json objects in post requests. With Kivy you should be able to make something pretty interesting and you can use the same skills you have learned in python there. And then QML is pretty awesome stuff. I used to work for Qt so I would know. :) I haven't seen Kivy in production code yet, but you can be a first. :) On Mon, Jun 1, 2015 at 9:04 PM eric cuver amihaco...@gmail.com wrote: good question I am also interested in the answer Le lundi 1 juin 2015 16:19:56 UTC+2, Joe a écrit : I developed a web app with Web2py. It works great, I thing Web2py is fantastic. I want to create a mobile app from my web app and I am not sure what is the best approach. Does anyone have any experience using Kivy? Does it work with Web2py? Or, is there a alternative solution to Kivy? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: My son made a new web2py logo
Commendable effort! But I second the folks who don't want any logo or name changes for the time being. Thanks. On Monday, June 1, 2015 at 11:06:16 AM UTC-7, Massimo Di Pierro wrote: Time to revamp the web site? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] markmin, pyfpdf, qr and utf-8-code
It seem so. There is a lot of nice tools, but they do not work together. I have to split my text into paragraphs, headlines and so, format each part, put it into a list and create my files out of this list. It works, but it is not very comfortable. 2015-06-05 9:12 GMT+02:00 José Luis Redrejo jredr...@gmail.com: I don't think you can mix markmin with fpdf (using the html to pdf functions). You will have to build your pdf in the controller picking up the text from the html. 2015-06-04 23:27 GMT+02:00 Martin Weissenboeck mweis...@gmail.com: What I want to do: - I want to write some pages using markmin. - Headlines should be centered and the date should be aligned right. - These pages contain non-ASCII-characters, therefore I need utf-8. - There should be a qr-code on the first page. - At the end I want to get these pages as HTML-code and as pdf. I have found: - right-aligned text: I have written something like t=markmin(``text``:right, extra=dict(right=lambda t: P(t, _align=right))) - pyfpdf needs pdf.add_font(..., uni=True), but pdf.write_html does not understand this font. I have to use pdf.write_html(font face='DejaVu'%s/font % t) - A qr in markmin creates a nice qr-picture, but the pyfpdf command write_html does not accept it. All these steps are a little bit complicated. It seems that it is not possible to combine all these requests in a simple way. Or has anybody a better solution? Regards., Martin -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] All messed up
Grrr. I just upgraded postgresql to the latest version 9.4 on Windows. I was surprised to see that it didn't overwrite the Postgres 9.2 install on my system. So I backed up my 9.2 db, created a new db under 9.4 and restored the 9.2 db into the 9.4 db. Everything seemed OK. But web2py wouldn't connect. So, I rebooted. No connect to 9.4. I then removed Postgres 9.2. No connect to 9.4. Then I upgraded to the latest source version of web2py for Windows. Still no connect. And now, I'm getting an invalid URL when I try to go to http://127.0.0.1:8000/admin. So now I have 2 problems: can't get to admin page, can't connect to Postgres. Anybody have any ideas how to proceed? I seem to be dead in the water. Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] All messed up
* Take a look at your web2py error logs - it usually gives you the reason as to what is wrong (even if your admin app does not work, just open the error logs in a text editor and view it) * Did you try running web2py from the console - python web2py -S some-test-app-name Then you can try to do the usual db=DAL(postgresql connection string) to see if the connect works. * If it does, then try to work with your application and its models from the console - python web2py -S your app -M (to load the models), and try some operations from within there Kiran Subbaraman http://subbaraman.wordpress.com/about/ On Fri, 05-06-2015 2:50 PM, weheh wrote: Grrr. I just upgraded postgresql to the latest version 9.4 on Windows. I was surprised to see that it didn't overwrite the Postgres 9.2 install on my system. So I backed up my 9.2 db, created a new db under 9.4 and restored the 9.2 db into the 9.4 db. Everything seemed OK. But web2py wouldn't connect. So, I rebooted. No connect to 9.4. I then removed Postgres 9.2. No connect to 9.4. Then I upgraded to the latest source version of web2py for Windows. Still no connect. And now, I'm getting an invalid URL when I try to go to http://127.0.0.1:8000/admin. So now I have 2 problems: can't get to admin page, can't connect to Postgres. Anybody have any ideas how to proceed? I seem to be dead in the water. Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com mailto:web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] All messed up
* Take a look at your web2py error logs - it usually gives you the reason as to what is wrong (even if your admin app does not work, just open the error logs in a text editor and view it) * Did you try running web2py from the console - python web2py -S some-test-app-name Then you can try to do the usual db=DAL(postgresql connection string) to see if the connect works. * If it does, then try to work with your application and its models from the console - python web2py -S your app -M (to load the models), and try some operations from within there Kiran Subbaraman http://subbaraman.wordpress.com/about/ On Fri, 05-06-2015 2:50 PM, weheh wrote: Grrr. I just upgraded postgresql to the latest version 9.4 on Windows. I was surprised to see that it didn't overwrite the Postgres 9.2 install on my system. So I backed up my 9.2 db, created a new db under 9.4 and restored the 9.2 db into the 9.4 db. Everything seemed OK. But web2py wouldn't connect. So, I rebooted. No connect to 9.4. I then removed Postgres 9.2. No connect to 9.4. Then I upgraded to the latest source version of web2py for Windows. Still no connect. And now, I'm getting an invalid URL when I try to go to http://127.0.0.1:8000/admin. So now I have 2 problems: can't get to admin page, can't connect to Postgres. Anybody have any ideas how to proceed? I seem to be dead in the water. Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com mailto:web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] markmin, pyfpdf, qr and utf-8-code
I don't think you can mix markmin with fpdf (using the html to pdf functions). You will have to build your pdf in the controller picking up the text from the html. 2015-06-04 23:27 GMT+02:00 Martin Weissenboeck mweis...@gmail.com: What I want to do: - I want to write some pages using markmin. - Headlines should be centered and the date should be aligned right. - These pages contain non-ASCII-characters, therefore I need utf-8. - There should be a qr-code on the first page. - At the end I want to get these pages as HTML-code and as pdf. I have found: - right-aligned text: I have written something like t=markmin(``text``:right, extra=dict(right=lambda t: P(t, _align=right))) - pyfpdf needs pdf.add_font(..., uni=True), but pdf.write_html does not understand this font. I have to use pdf.write_html(font face='DejaVu'%s/font % t) - A qr in markmin creates a nice qr-picture, but the pyfpdf command write_html does not accept it. All these steps are a little bit complicated. It seems that it is not possible to combine all these requests in a simple way. Or has anybody a better solution? Regards., Martin -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] All messed up
Hi Kiran, thanks for the response. Unfortunately, I can't see my error files now because I can't get through to web2py admin. Before updating web2py, there were absolutely no error messages about not being able to connect to postgres. And yes, I have run from the console but still no luck in getting through to web2py. On Friday, June 5, 2015 at 2:27:40 AM UTC-7, Kiran Subbaraman wrote: - Take a look at your web2py error logs - it usually gives you the reason as to what is wrong (even if your admin app does not work, just open the error logs in a text editor and view it) - Did you try running web2py from the console - python web2py -S some-test-app-name Then you can try to do the usual db=DAL(postgresql connection string) to see if the connect works. - If it does, then try to work with your application and its models from the console - python web2py -S your app -M (to load the models), and try some operations from within there Kiran Subbaramanhttp://subbaraman.wordpress.com/about/ On Fri, 05-06-2015 2:50 PM, weheh wrote: Grrr. I just upgraded postgresql to the latest version 9.4 on Windows. I was surprised to see that it didn't overwrite the Postgres 9.2 install on my system. So I backed up my 9.2 db, created a new db under 9.4 and restored the 9.2 db into the 9.4 db. Everything seemed OK. But web2py wouldn't connect. So, I rebooted. No connect to 9.4. I then removed Postgres 9.2. No connect to 9.4. Then I upgraded to the latest source version of web2py for Windows. Still no connect. And now, I'm getting an invalid URL when I try to go to http://127.0.0.1:8000/admin. So now I have 2 problems: can't get to admin page, can't connect to Postgres. Anybody have any ideas how to proceed? I seem to be dead in the water. Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]
Thanks Ron. I'm just using customised bootstrap 3 with customized welcome app layout.html file. When I started working on this project web2py didn't support boostrap 3 out-of-box and I really wanted to use some bootstrap 3 features. Couple of months later bootstrap 3 was implemented with web2py. I didn't have time to change test/use official bootstrap implementation yet. On Friday, 5 June 2015 02:24:26 UTC+2, Ron Chatterjee wrote: This is really nice! What did you use to create the layout like that? Or it came with the bootstrap? Just curious. Good job! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] TAG select and parsing
To parsing A tag: h = ''' div class=operations a class=cheque href=/report/cheque.action?transaction=5315416947amp;direction=OUT target=_blank Show this /a /div ''' h = TAG(h) op_id = h.element('div.operations a.cheque') op_id = '%s' % op_id op_id = TAG(op_id) op_id1 = op_id[0]['_href'] op_id2 = op_id[0][0] print op_id[0], op_id[0]['_href'], op_id[0][0] -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]
Thanks Jorge On Friday, 5 June 2015 00:28:57 UTC+2, JorgeH wrote: Looks good ;) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] All messed up
Alright. I took the error message over to another machine that has an older version of web2py running. Looks pretty fundamental. CountFileError10_0_globals.pyAttributeError: type object 'DAL' has no attribute 'Field' http://127.0.0.1:8000/admin/errors/admin#+ details http://127.0.0.1:8000/admin/ticket/admin/127.0.0.1.2015-06-05.02-55-08.02729837-2dc6-4e87-abb3-9875cf7b3015 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. Traceback (most recent call last): File G:\web2py\gluon\restricted.py, line 227, in restricted exec ccode in environment File G:\web2py\applications\myapp\models\0_0_globals.py, line 18, in module from gluon.tools import * File G:\web2py\gluon\custom_import.py, line 108, in custom_importer return NATIVE_IMPORTER(name, globals, locals, fromlist, level) File G:\web2py\gluon\tools.py, line 50, in module Field = DAL.Field AttributeError: type object 'DAL' has no attribute 'Field' -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]
I agree, any example that might be beneficial should be here. When I started with web2py I remember tinkering alot about some simple stuff, for example {{block}}. Such a useful and powerful feature when it comes to design :) What do you mean by active state? On Friday, 5 June 2015 04:11:23 UTC+2, Ron Chatterjee wrote: On that note, may be that will be a good example to capture on the site. How do we use different kind of layout for the look and feel of it. Create active state etc... Even though, its not web2py specific but more of design feature but still, we use them. Just some thoughts...: -) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]
Thanks Massimo. I'm glad you like it. I didn't expect that! I see this site as a supplement to web2py book, slices and other resources. What is happening with web2pyslices.com? I hope slices is not being abandoned. This is maybe a topic for another thread, what is the future for web2pyslices? At the moment I can only think of two ways how to transfer examples to w2pREF, manual entry or CSV import. Manual entry will be a project by itself. Thanks Ivica On Friday, 5 June 2015 06:30:31 UTC+2, Massimo Di Pierro wrote: This is fantastic! Now if you could somehow include the examples from web2pyslices.com I'd be happy to redirect web2pyslices.com to your site. Massimo On Thursday, 4 June 2015 16:40:14 UTC-5, Ivica Kralj wrote: Hi All, This is my little personal project I have worked on for the last few months. www.web2pyref.com Project is in beta and I'm still adding and fixing features, functionalities and content, whenever I get a chance. Please, feel free to express your opinions or constructive suggestions. Service is open to all. You can register and contribute by adding more examples. Idea behind the service is to link particular web2py reference to a multiple web2py examples. This will enable web2py users to learn or remind them-self how to use certain web2py functionality by examining multiple examples. System should automatically link every reference to web2py examples' records. When I started playing with web2py, I always wanted to have this type of resource, so I believe new web2py users will find the project beneficial. If you will add new examples, please keep in mind following criteria: examples should be relevant and *functional. *Accepted example types are snippets, apps, plugins or modules. Also, if you copy and paste example's code, example should be fully operational in your web2py environment. Functionalities so far: - Add/edit web2py references and examples. - Save/follow records - Rate records - Comment - Private user page where you can access your own, commented, rated and saved references and examples records. - Search - Tags - 3.5 step wizard form Regards, Ivica p.s. If you are planing to test the app, please do not publish irrelevant or uncompleted records...(google remembers everything) :) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Allow users to comment only for certain period of time
it's so difficult without seeing any code, but you can use timedelta for it e.g. not tested duedate = blog.created_by + datetime.timedelta(7) editable = True if request.now duedate else False best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Upgrade to Web2py 2.10.4 breaks date field search in sqlform.grid
Please open a ticket about this. On Thursday, 4 June 2015 23:26:00 UTC-5, Mat Miles wrote: I upgraded Web2py to version 2.10.4 on Pythonanywhere which has created a problem with SQLFORM.grid. I have a table that has a date field. When you attempt to search by this date field in a SQLFORM.grid, the date picker no longer appears, just a test box. Date fields are still working fine when using SQLFORM.factory. The proper date picker still displays. Has anyone else seen this problem? If so, do you know how to resolve it? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: My son made a new web2py logo
I think www.web2py.com needs a more appealing CSS design . 2015-06-05 13:56 GMT+01:00 Massimo Di Pierro massimo.dipie...@gmail.com: There will be no name change. I did not propose any name change. All I asked is if we should revamp the web site. Feel free to submit proposals. About the logo. Web2py does not have a logo. It has many logos. Everybody can use the one they like. On Friday, 5 June 2015 04:24:32 UTC-5, weheh wrote: Commendable effort! But I second the folks who don't want any logo or name changes for the time being. Thanks. On Monday, June 1, 2015 at 11:06:16 AM UTC-7, Massimo Di Pierro wrote: Time to revamp the web site? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: How to pass arguments with a form
can you share the code you have at the moment? or at least a screenshot of the webpage you mention.. On Thursday, June 4, 2015 at 11:26:00 PM UTC-5, Chaitu P wrote: I have a situation where I have several questions displayed on a page and below each of the question there will be a form like student name and email. Once the student clicks on the submit button I want to pass the corresponding question id in the URL. I have seen several examples to pass arguments through a hyperlink. But Iam not sure how to do this. Can anyone please please let me know... -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: My son made a new web2py logo
There will be no name change. I did not propose any name change. All I asked is if we should revamp the web site. Feel free to submit proposals. About the logo. Web2py does not have a logo. It has many logos. Everybody can use the one they like. On Friday, 5 June 2015 04:24:32 UTC-5, weheh wrote: Commendable effort! But I second the folks who don't want any logo or name changes for the time being. Thanks. On Monday, June 1, 2015 at 11:06:16 AM UTC-7, Massimo Di Pierro wrote: Time to revamp the web site? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] web2py ajax javascript function question regarding return from post request
Appreciate any help one can offer. I have an web2py application where I need to perform using the custom web2py ajax function provided with web2py: ajax(url, [name1, name2, ...], targetFunction). The post works fine on the server side but I was wondering if there is a way to use this function to catch the new ID (pkey) field value that I need to return and use on the updated webpage. I can always go the $.post option but this function has a very clean syntax and is very convenient so I would like to stay with this function. Any help greatly appreciated. Bill -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: My son made a new web2py logo
+1 for Ractive.js W3 Massimo app work effort to bring it to live... I fall miserabily trying to work on it, I had some time then get squeeze by so much stuff and have to give up... I try to integrate with Semantic ui but realize that didn't know it pretty well :) I would like to help, but only have small amount of time. Richard On Fri, Jun 5, 2015 at 9:26 AM, JorgeH jorgeh...@gmail.com wrote: I think in the next version of the main site, it would be good to implement the integration with Ractive.js that Massimo has been working on. To project a more modern feeling. On Friday, June 5, 2015 at 7:56:21 AM UTC-5, Massimo Di Pierro wrote: There will be no name change. I did not propose any name change. All I asked is if we should revamp the web site. Feel free to submit proposals. About the logo. Web2py does not have a logo. It has many logos. Everybody can use the one they like. On Friday, 5 June 2015 04:24:32 UTC-5, weheh wrote: Commendable effort! But I second the folks who don't want any logo or name changes for the time being. Thanks. On Monday, June 1, 2015 at 11:06:16 AM UTC-7, Massimo Di Pierro wrote: Time to revamp the web site? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: My son made a new web2py logo
I think in the next version of the main site, it would be good to implement the integration with Ractive.js that Massimo has been working on. To project a more modern feeling. On Friday, June 5, 2015 at 7:56:21 AM UTC-5, Massimo Di Pierro wrote: There will be no name change. I did not propose any name change. All I asked is if we should revamp the web site. Feel free to submit proposals. About the logo. Web2py does not have a logo. It has many logos. Everybody can use the one they like. On Friday, 5 June 2015 04:24:32 UTC-5, weheh wrote: Commendable effort! But I second the folks who don't want any logo or name changes for the time being. Thanks. On Monday, June 1, 2015 at 11:06:16 AM UTC-7, Massimo Di Pierro wrote: Time to revamp the web site? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: How to display Google Maps (iFrame?)
please take a look at web2py book about components and plugins ref: http://web2py.com/books/default/chapter/29/12/components-and-plugins#Components--LOAD-and-Ajax best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: web2py ajax javascript function question regarding return from post request
It's not quite clear what you are asking. Note, the third argument to ajax() is not a function but the CSS id of the DOM element where the returned HTML should be inserted. If instead of returning and inserting some HTML you would like to run some Javascript code upon completion of the Ajax call, you can specify :eval as the third argument, in which case, the Ajax return value will be treated as Javascript code and run. Anthony On Friday, June 5, 2015 at 9:08:27 AM UTC-4, wdtnh wrote: Appreciate any help one can offer. I have an web2py application where I need to perform using the custom web2py ajax function provided with web2py: ajax(url, [name1, name2, ...], targetFunction). The post works fine on the server side but I was wondering if there is a way to use this function to catch the new ID (pkey) field value that I need to return and use on the updated webpage. I can always go the $.post option but this function has a very clean syntax and is very convenient so I would like to stay with this function. Any help greatly appreciated. Bill -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]
The element of design you have their, the color choice and everything...stand out really well. What I mean by active state is when you hoover your mouse over to a topic it highlights. Again, design feature. Not development. Hopefully someone will put some design examples in the site. On Friday, June 5, 2015 at 6:31:00 AM UTC-4, Ivica Kralj wrote: Thanks Massimo. I'm glad you like it. I didn't expect that! I see this site as a supplement to web2py book, slices and other resources. What is happening with web2pyslices.com? I hope slices is not being abandoned. This is maybe a topic for another thread, what is the future for web2pyslices? At the moment I can only think of two ways how to transfer examples to w2pREF, manual entry or CSV import. Manual entry will be a project by itself. Thanks Ivica On Friday, 5 June 2015 06:30:31 UTC+2, Massimo Di Pierro wrote: This is fantastic! Now if you could somehow include the examples from web2pyslices.com I'd be happy to redirect web2pyslices.com to your site. Massimo On Thursday, 4 June 2015 16:40:14 UTC-5, Ivica Kralj wrote: Hi All, This is my little personal project I have worked on for the last few months. www.web2pyref.com Project is in beta and I'm still adding and fixing features, functionalities and content, whenever I get a chance. Please, feel free to express your opinions or constructive suggestions. Service is open to all. You can register and contribute by adding more examples. Idea behind the service is to link particular web2py reference to a multiple web2py examples. This will enable web2py users to learn or remind them-self how to use certain web2py functionality by examining multiple examples. System should automatically link every reference to web2py examples' records. When I started playing with web2py, I always wanted to have this type of resource, so I believe new web2py users will find the project beneficial. If you will add new examples, please keep in mind following criteria: examples should be relevant and *functional. *Accepted example types are snippets, apps, plugins or modules. Also, if you copy and paste example's code, example should be fully operational in your web2py environment. Functionalities so far: - Add/edit web2py references and examples. - Save/follow records - Rate records - Comment - Private user page where you can access your own, commented, rated and saved references and examples records. - Search - Tags - 3.5 step wizard form Regards, Ivica p.s. If you are planing to test the app, please do not publish irrelevant or uncompleted records...(google remembers everything) :) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: How to use record.id in upload path?
I know about uploadseparate option. I was looking for kind of solution where I could define the folder structure for uploaded files (from different forms). I will try to implement my own logic. Thanks. Theres On Monday, 25 May 2015 23:02:09 UTC+2, Anthony wrote: It looks like each project has only one photo associated with it -- do you really need a separate folder for each project just to store a single photo? If you are worried about OS performance issues with large numbers of files in a single directory, you should instead do: Field('photo', 'upload', uploadseparate=True, autodelete=True) web2py will automatically create many sub-folders to divide up the files. Anyway, what you ask is tricky because the record ID is not known until after a record has been inserted, so instead of relying on web2py's built-in upload mechanism, you would have to manually manage the uploads after record insertion. Anthony On Monday, May 25, 2015 at 11:29:54 AM UTC-4, Najtsirk wrote: Dear all, let's say the model is: import os db.define_table('project', Field('title', 'string'), Field('photo','upload', uploadfolder=os.path.join(request.folder,'upload/project/'), autodelete=True)) How can I include record.id in the uploadfolder path so a can have separatesubfolders, like os.path.join(request.folder,'upload/project/*$record.id http://record.id*'). Best, Kristjan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: My son made a new web2py logo
I know the feeling. Using ractive (or angular) with other js libraries is a bit of a pain. On Friday, 5 June 2015 08:31:07 UTC-5, Richard wrote: +1 for Ractive.js W3 Massimo app work effort to bring it to live... I fall miserabily trying to work on it, I had some time then get squeeze by so much stuff and have to give up... I try to integrate with Semantic ui but realize that didn't know it pretty well :) I would like to help, but only have small amount of time. Richard On Fri, Jun 5, 2015 at 9:26 AM, JorgeH jorgeh...@gmail.com wrote: I think in the next version of the main site, it would be good to implement the integration with Ractive.js that Massimo has been working on. To project a more modern feeling. On Friday, June 5, 2015 at 7:56:21 AM UTC-5, Massimo Di Pierro wrote: There will be no name change. I did not propose any name change. All I asked is if we should revamp the web site. Feel free to submit proposals. About the logo. Web2py does not have a logo. It has many logos. Everybody can use the one they like. On Friday, 5 June 2015 04:24:32 UTC-5, weheh wrote: Commendable effort! But I second the folks who don't want any logo or name changes for the time being. Thanks. On Monday, June 1, 2015 at 11:06:16 AM UTC-7, Massimo Di Pierro wrote: Time to revamp the web site? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: TAG select and parsing
You don't need to serialize and then apply TAG a second time. Just do: h = TAG(h) op_id = h.element('div.operations a.cheque') print op_id, op_id['_href'], op_id[0] Anthony On Friday, June 5, 2015 at 7:40:50 AM UTC-4, Dmitry Ermolaev wrote: To parsing A tag: h = ''' div class=operations a class=cheque href=/report/cheque.action?transaction=5315416947amp;direction=OUT target=_blank Show this /a /div ''' h = TAG(h) op_id = h.element('div.operations a.cheque') op_id = '%s' % op_id op_id = TAG(op_id) op_id1 = op_id[0]['_href'] op_id2 = op_id[0][0] print op_id[0], op_id[0]['_href'], op_id[0][0] -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Field decimal default widget
You can submit a Github issue. Adding the number type seems fine, but we should not add the step attribute. Anthony On Friday, June 5, 2015 at 12:26:00 AM UTC-4, Pavel Tyurikov wrote: Thanks for advice. I meen isn't it would be nice to have a defautl widget with right attrs set? I developing mobile-app and notiсed that if INPUT has a number type, the phone shows a numeric keyboard, on clicking on it. So I want to ask to add this functionality as deafult too. понедельник, 1 июня 2015 г., 21:19:28 UTC+3 пользователь Anthony написал: You can create a custom widget and then do: Field(..., widget=my_custom_widget) Alternatively, if you want to change all decimal widgets generated by SQLFORM without having to bother specifying a custom widget for each field, you could monkey patch gluon.sqlhtml.DecimalWidget or gluon.sqlhtml.SQLFORM.widgets (change the decimal value to a custom class). Anthony On Monday, June 1, 2015 at 2:04:23 PM UTC-4, Pavel Tyurikov wrote: Is it possible to make SQLFORM default widget for decimal field like this: Field('quantity', 'decimal(5,2)', label = 'Price') input type=number step=0.01 -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] SMARTGRID wirh linked_tables shows only the view buttons
Hy guys! I use a SMARTGRID with a linked_table argument. But only the view button is displayed on item level. This on level parent and child. Even adding the argument editable=True has no impact - anyway this is already default. Thanks for help! Beat -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: SMARTGRID and linked_tables - no buttons to edit, delete - only view
You either have to be logged in or set user_signature=False. Anthony On Friday, June 5, 2015 at 12:26:00 AM UTC-4, Beat Kohler wrote: Hey guys! on a SMARTGRID I added a linked_table argument. ... no I have only the view button left. No way to modify neither the parent nor the child. What goes wrong.. sorry, what I made wrong? Coding: grid = SQLFORM.smartgrid(db.CUSTOMER, linked_tables=['CUST_PEOPLE'], editable=True) (the editable argument I added later ... no effect) Table definitions: db.define_table(CUSTOMER, Field(CUSTNAME, string, length=30, label=T(Customer Name), notnull=True, default=None), Field(DESCRIPTION, text, label=T(Customer Description), notnull=True, default=None), Field(COMMUNICATION, text, label=T(Access Description), notnull=True, default=None), Field(LOGINNET, text, label=T(Login Network), notnull=True, default=None), Field(DOCU, upload, label=T(Documentation Access)), Field(DOCU2, upload, label=T(Documentation Access 2)), Field(DOCU3, upload, label=T(Documentation Access 3)), migrate=True, format='%(CUSTNAME)s') db.define_table(CUST_PEOPLE, Field(id_CUSTOMER, db.CUSTOMER), Field(NAME, string, label=T(Name of Contact), length=80, notnull=True, default=None), Field(JOB_POSITION, string, label=T(Job Position), length=80, notnull=True, default=None), Field(EMAIL, string, length=30, label=T(Email), notnull=True, default=None, requires=IS_EMAIL()), Field(TEL, string, length=80, label=T(Telephone), notnull=True, default=None), migrate=True) Thanks for your help Beat -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: web2py ajax javascript function question regarding return from post request
Sorry for the confusion but your answer works just great. Thanks On Friday, June 5, 2015 at 10:07:49 AM UTC-4, Anthony wrote: It's not quite clear what you are asking. Note, the third argument to ajax() is not a function but the CSS id of the DOM element where the returned HTML should be inserted. If instead of returning and inserting some HTML you would like to run some Javascript code upon completion of the Ajax call, you can specify :eval as the third argument, in which case, the Ajax return value will be treated as Javascript code and run. Anthony On Friday, June 5, 2015 at 9:08:27 AM UTC-4, wdtnh wrote: Appreciate any help one can offer. I have an web2py application where I need to perform using the custom web2py ajax function provided with web2py: ajax(url, [name1, name2, ...], targetFunction). The post works fine on the server side but I was wondering if there is a way to use this function to catch the new ID (pkey) field value that I need to return and use on the updated webpage. I can always go the $.post option but this function has a very clean syntax and is very convenient so I would like to stay with this function. Any help greatly appreciated. Bill -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Database migration problem
Hello, (1) I use sqlite (2) In development I made the following change to a given table: db.define_table(... Field('description', 'text'), ... ) becomes: db.define_table(... Field('description_en', 'text'), Field('description_fr', 'text'), ... ) Everything went well. (3) Then I tried to apply the same changes to the production database and it gave me the error: column description_en does not exist when the application try to access the table. The migration did not occur. The database still has only the description field in it. (4) I tried to get rid of the table files (migration files from the databases folder) related to that table without success (table does not exist) (5) I tried to get rid of my changes in the models file and use: db_es = DAL('sqlite://estore.db', fake_migrate_all=True) and then reapply my changes with db_es = DAL('sqlite://estore.db', migrate=True) with the same error (description_en does not exist) Please, how could I solve that problem? Thanks! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]
Can you post the example of div element about recent examples, top rated examples...etc and show how you create the box element? I believe that's what you meant by custom layout. On Friday, June 5, 2015 at 11:45:47 AM UTC-4, Derek wrote: The slider thing on the top moves the content up and down. And it repeats, so it's like trying to use your website on a mexican jeep on it's way to Costa Maya. On Thursday, June 4, 2015 at 2:40:14 PM UTC-7, Ivica Kralj wrote: Hi All, This is my little personal project I have worked on for the last few months. www.web2pyref.com Project is in beta and I'm still adding and fixing features, functionalities and content, whenever I get a chance. Please, feel free to express your opinions or constructive suggestions. Service is open to all. You can register and contribute by adding more examples. Idea behind the service is to link particular web2py reference to a multiple web2py examples. This will enable web2py users to learn or remind them-self how to use certain web2py functionality by examining multiple examples. System should automatically link every reference to web2py examples' records. When I started playing with web2py, I always wanted to have this type of resource, so I believe new web2py users will find the project beneficial. If you will add new examples, please keep in mind following criteria: examples should be relevant and *functional. *Accepted example types are snippets, apps, plugins or modules. Also, if you copy and paste example's code, example should be fully operational in your web2py environment. Functionalities so far: - Add/edit web2py references and examples. - Save/follow records - Rate records - Comment - Private user page where you can access your own, commented, rated and saved references and examples records. - Search - Tags - 3.5 step wizard form Regards, Ivica p.s. If you are planing to test the app, please do not publish irrelevant or uncompleted records...(google remembers everything) :) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Locking app to a single domain
Did you mean to put this into specific app? This does not work, because router redirects to different app. On Friday, 5 June 2015 17:17:48 UTC+2, villas wrote: Maybe something like this (untested)... --- in models/0redirects.py --- if request.application in ['app2','app3']: redirect(URL('index')) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] SQLFORM.grid created from request.vars - search, pagination etc breaks
vars passed to controller doing grid search disappear seem that updating w2p to keep the vars after grid search would be a good improvement thanks! Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]
Really good +1 ! If you are planing to test the app, please do not publish irrelevant or uncompleted records...(google remembers everything) :) Whilst testing, maybe you should consider a robots.txt https://support.google.com/webmasters/answer/6062608?hl=enref_topic=6061961rd=1 file with something like this: User-agent: * Disallow: / -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]
The slider thing on the top moves the content up and down. And it repeats, so it's like trying to use your website on a mexican jeep on it's way to Costa Maya. On Thursday, June 4, 2015 at 2:40:14 PM UTC-7, Ivica Kralj wrote: Hi All, This is my little personal project I have worked on for the last few months. www.web2pyref.com Project is in beta and I'm still adding and fixing features, functionalities and content, whenever I get a chance. Please, feel free to express your opinions or constructive suggestions. Service is open to all. You can register and contribute by adding more examples. Idea behind the service is to link particular web2py reference to a multiple web2py examples. This will enable web2py users to learn or remind them-self how to use certain web2py functionality by examining multiple examples. System should automatically link every reference to web2py examples' records. When I started playing with web2py, I always wanted to have this type of resource, so I believe new web2py users will find the project beneficial. If you will add new examples, please keep in mind following criteria: examples should be relevant and *functional. *Accepted example types are snippets, apps, plugins or modules. Also, if you copy and paste example's code, example should be fully operational in your web2py environment. Functionalities so far: - Add/edit web2py references and examples. - Save/follow records - Rate records - Comment - Private user page where you can access your own, commented, rated and saved references and examples records. - Search - Tags - 3.5 step wizard form Regards, Ivica p.s. If you are planing to test the app, please do not publish irrelevant or uncompleted records...(google remembers everything) :) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]
Great work! We need some well documented starter apps. Flask seems to gets loads on the likes of Python Weekly. Would be very helpful to get some recent ones online for newbies. On Thursday, 4 June 2015 22:40:14 UTC+1, Ivica Kralj wrote: Hi All, This is my little personal project I have worked on for the last few months. www.web2pyref.com Project is in beta and I'm still adding and fixing features, functionalities and content, whenever I get a chance. Please, feel free to express your opinions or constructive suggestions. Service is open to all. You can register and contribute by adding more examples. Idea behind the service is to link particular web2py reference to a multiple web2py examples. This will enable web2py users to learn or remind them-self how to use certain web2py functionality by examining multiple examples. System should automatically link every reference to web2py examples' records. When I started playing with web2py, I always wanted to have this type of resource, so I believe new web2py users will find the project beneficial. If you will add new examples, please keep in mind following criteria: examples should be relevant and *functional. *Accepted example types are snippets, apps, plugins or modules. Also, if you copy and paste example's code, example should be fully operational in your web2py environment. Functionalities so far: - Add/edit web2py references and examples. - Save/follow records - Rate records - Comment - Private user page where you can access your own, commented, rated and saved references and examples records. - Search - Tags - 3.5 step wizard form Regards, Ivica p.s. If you are planing to test the app, please do not publish irrelevant or uncompleted records...(google remembers everything) :) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Locking app to a single domain
Maybe something like this (untested)... --- in models/0redirects.py --- if request.application in ['app2','app3']: redirect(URL('index')) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Upgrade to Web2py 2.10.4 breaks date field search in sqlform.grid
once again surrounded by a brilliant white light of not supporting different sets of specific css-widgets... issue https://github.com/web2py/web2py/issues/994 PR that fixes https://github.com/web2py/web2py/pull/995 On Friday, June 5, 2015 at 2:52:18 PM UTC+2, Massimo Di Pierro wrote: Please open a ticket about this. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Database migration problem
it seems that you updated also the databases folder of your production app or ... dunno. I don't see why so many peoples are running into this kind of errors (there are others intricacies but adding column ISN'T one of them). What DAL does with migration is pretty documented and understandable... steps to live happily: - run production with migrate=False - run test with migrate=True - make change to test model - test eveything is ok - apply changes to model also in production, with migrate=True. Hit appadmin (manage database in the admin app) to be sure all migrations are triggered. you can see the commands issued on databases/sql.log - turn back to migrate=False in production steps to recover from your situation (maybe): - revert to old model in production - set migrate=True, fake_migrate_all=True in production - hit appadmin on prod, let web2py recreate .table files according to the old model - set migrate=True, fake_migrate_all=False in prod - change model in production - hit appadmin to let web2py issue ddl statements to the database, inspect sql.log for commands issued - set migrate=False in production On Friday, June 5, 2015 at 8:00:18 PM UTC+2, Julien Courteau wrote: Hello, (1) I use sqlite (2) In development I made the following change to a given table: db.define_table(... Field('description', 'text'), ... ) becomes: db.define_table(... Field('description_en', 'text'), Field('description_fr', 'text'), ... ) Everything went well. (3) Then I tried to apply the same changes to the production database and it gave me the error: column description_en does not exist when the application try to access the table. The migration did not occur. The database still has only the description field in it. (4) I tried to get rid of the table files (migration files from the databases folder) related to that table without success (table does not exist) (5) I tried to get rid of my changes in the models file and use: db_es = DAL('sqlite://estore.db', fake_migrate_all=True) and then reapply my changes with db_es = DAL('sqlite://estore.db', migrate=True) with the same error (description_en does not exist) Please, how could I solve that problem? Thanks! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: DatabaseError: SSL SYSCALL error: EOF detected (Intermitten
On Friday, June 5, 2015 at 6:26:00 AM UTC+2, Dan Hett wrote: I read through a few of these threads. If it is indeed a connection issue, how do I test that within Web2Py? I switched the DB to MySQL to see if that would make a difference and received the same error. It seems to create the error after the 5th table creation. It doesn't seem to matter what table I create next, I receive the same error. I'm running from source. I will try running from the install version. FYI, I'm running on Windows. let's be serious for a second...you can't get the same exception from a different adapter! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]
On Friday, June 5, 2015 at 3:35:08 PM UTC-4, Niphlod wrote: BTW: until all snippets are continously tested, this is going to become the 4th incarnation of a web2py snippet blog/container/etc with outdated pieces of code within the next year, when the buzz wears off. Nothing worse than getting broken code samples off the web, is there? (Well, there are worse things...) Maybe we can add some fields to each snippet to indicate: which versions it was tested on, when it was submitted, when last verified, etc. As people use the snippets, at least a few will provide feedback in the form of: I just used this one and it works great to provide a last tested timestamp. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]
On Friday, June 5, 2015 at 10:17:36 PM UTC+2, Rufus wrote: On Friday, June 5, 2015 at 3:35:08 PM UTC-4, Niphlod wrote: BTW: until all snippets are continously tested, this is going to become the 4th incarnation of a web2py snippet blog/container/etc with outdated pieces of code within the next year, when the buzz wears off. Nothing worse than getting broken code samples off the web, is there? (Well, there are worse things...) Maybe we can add some fields to each snippet to indicate: which versions it was tested on, when it was submitted, when last verified, etc. I fell off the wagon too many times to trust again a repository of sorts of untested thingies. It's the real truth that bites: there's no manpower available and so if something else (a CI) does the job, it pretty much stays viable until the developer that creates it uses it. Then we get angry users here asking for why is that not working anymore, wasn't web2py supposed to be backward-compatible... instead of asking the original developer. Once you put it in a plugin, people won't ever be interested in seeing the code, the damn thing needs to work as intended. They get crazier and crazier about it because web2py userbase is not - that - skilled in python: it attracts lots of newbies for that reason and we (the main developers) need to live with that: no feedback in testing, not interested in poking a bit to maintain it/refresh it, huge interest in being just disappointed. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Allow users to comment only for certain period of time
On Friday, June 5, 2015 at 6:32:39 AM UTC-7, 黄祥 wrote: it's so difficult without seeing any code, but you can use timedelta for it e.g. not tested duedate = blog.created_by + datetime.timedelta(7) editable = True if request.now duedate else False Note that datetime.timedelta is a Python feature, URL:https://docs.python.org/2/library/datetime.html#timedelta-objects but web2py also supports time in queries. URL:http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#year--month--day--hour--minutes--seconds Here's a couple of posts I've made in the past about dates: URL:https://groups.google.com/d/msg/web2py/-VPp4OaSskI/SvAfYL6yoqEJ (does a timedelta calculation on two rows from a query), and also shows an db.executesql() with an older than clause) and URL:https://groups.google.com/d/msg/web2py/MNzcV1dsgMk/1nFl__MDrMoJ where I have a db(db.table matches month).select() that orders by the month. Hope this helps ... a lot of reading when you're starting out, eh? /dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]
I agree with Niphlod for the most part. Just one note, the whole purpose of web2py was just that. As a learning tool for people who are not an expert. If you hear Massimo talk. Several times he mentioned, web development doesn't need to be difficult. Thats the reason you run into lot of unskilled newbie as you put it. That said. It can be tested once and with a disclosure statement like Use with your own risk. No support is provided if the code breakssomething along that line. My two cents. On Friday, June 5, 2015 at 4:31:00 PM UTC-4, Niphlod wrote: On Friday, June 5, 2015 at 10:17:36 PM UTC+2, Rufus wrote: On Friday, June 5, 2015 at 3:35:08 PM UTC-4, Niphlod wrote: BTW: until all snippets are continously tested, this is going to become the 4th incarnation of a web2py snippet blog/container/etc with outdated pieces of code within the next year, when the buzz wears off. Nothing worse than getting broken code samples off the web, is there? (Well, there are worse things...) Maybe we can add some fields to each snippet to indicate: which versions it was tested on, when it was submitted, when last verified, etc. I fell off the wagon too many times to trust again a repository of sorts of untested thingies. It's the real truth that bites: there's no manpower available and so if something else (a CI) does the job, it pretty much stays viable until the developer that creates it uses it. Then we get angry users here asking for why is that not working anymore, wasn't web2py supposed to be backward-compatible... instead of asking the original developer. Once you put it in a plugin, people won't ever be interested in seeing the code, the damn thing needs to work as intended. They get crazier and crazier about it because web2py userbase is not - that - skilled in python: it attracts lots of newbies for that reason and we (the main developers) need to live with that: no feedback in testing, not interested in poking a bit to maintain it/refresh it, huge interest in being just disappointed. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: RuntimeError: no driver available Sybase
Your 'drivers.py' isn't looking for 'sybpydb' it's looking for 'Sybase' (hence he's asking you to install the correct package) so it is calling 'import sybase'. You could modify your drivers.py and 'import sybpydb as Sybase' and web2py won't know the difference. You may get errors, you may not. On Thursday, June 4, 2015 at 9:26:00 PM UTC-7, EF wrote: Before installing the sybase package you suggested, I did another test with a different sybase package (sybpydb) we had installed. $ javascript: *python ./web2py.py -S welcome* web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2015 Version 2.10.4-stable+timestamp.2015.04.26.15.11.54 Database drivers available: sqlite3, imaplib, pyodbc, pymysql, pg8000 WARNING:web2py:import IPython error; use default python shell Python 2.7.9 (default, May 28 2015, 14:04:54) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2 Type help, copyright, credits or license for more information. (InteractiveConsole) * import sybpydb* connection = sybpydb.connect(servername = 'myservername', user='myusername', password = 'mypassword') print connection sybpydb.Connection object at 0x2360490 cursor = connection.cursor() cursor.execute(SELECT * FROM hts_database_config) rows = cursor.fetchall() for row in rows: ...print (row) ... (u'Cash Balance Management', 0, None, None) (u'Cash Balance Start Date', None, None, None) (... some additional rows) cursor.close() connection.close() db = DAL('sybase://myusername:mypassword@myservername/mydbname') Traceback (most recent call last): File console, line 1, in module File /home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/base.py, line 171, in __call__ obj = super(MetaDAL, cls).__call__(*args, **kwargs) File /home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/base.py, line 457, in __init__ raise RuntimeError(Failure to connect, tried %d times:\n%s % (attempts, tb)) RuntimeError: Failure to connect, tried 5 times: Traceback (most recent call last): File /home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/base.py, line 435, in __init__ self._adapter = ADAPTERS[self._dbname](**kwargs) File /home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/adapters/base.py, line 53, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File /home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/adapters/mssql.py, line 465, in __init__ self.find_driver(adapter_args, uri) File /home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/adapters/base.py, line 187, in find_driver raise RuntimeError(no driver available %s % str(self.drivers)) RuntimeError: no driver available Sybase As you can see, the connection works with the package sybpydb, but not with DAL. Do I need a different adapter in web2py/gluon/packages/dal/pydal? What's missing here to make DAL work with Sybase? Why installing the Sybase package you suggested would make a difference when using DAL? I would imagine that the Sybase package you suggested should work similarly to sybpydb, right? I would greatly appreciate any help and suggestions to make this work. Thanks, EF On Monday, June 1, 2015 at 6:12:38 PM UTC-4, EF wrote: Hi, I'm new to web2py and trying to test the connectivity to Sybase. I tried testing this on Linux: db = DAL('sybase://myuserid:mypswd@mysybaseserver/mydbname') (please note that I used dummay names in the above statement, but the correct ones when testing.) I got the following error: Traceback (most recent call last): File console, line 1, in module File /home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/base.py, line 171, in __call__ obj = super(MetaDAL, cls).__call__(*args, **kwargs) File /home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/base.py, line 457, in __init__ raise RuntimeError(Failure to connect, tried %d times:\n%s % (attempts, tb)) RuntimeError: Failure to connect, tried 5 times: Traceback (most recent call last): File /home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/base.py, line 435, in __init__ self._adapter = ADAPTERS[self._dbname](**kwargs) File /home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/adapters/base.py, line 53, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File /home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/adapters/mssql.py, line 465, in __init__ self.find_driver(adapter_args, uri) File /home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/adapters/base.py, line 187, in find_driver raise RuntimeError(no driver available %s % str(self.drivers)) RuntimeError: no driver available Sybase Questions: 1. Where can I find the Sybase driver? (we are using Adaptive Server Enterprise/15.7) 2. Where should it be installed? 3. Once I have the correct driver, is there
Re: [web2py] Re: Recaptcha on pythonanywhere.com https error
book is for near-stable things. new can be only find in docstring. Fortunately we host API docs on readthedocs with full-text search go to http://web2py.rtfd.org/, insert recaptcha2 inside the box, see the magic happening! (this http://web2py.readthedocs.org/en/latest/tools.html?highlight=recaptcha2#gluon.tools.Recaptcha2is what it looks like) @mdipierro: maybe, but just maybe, we can make a better CHANGELOG for web2py: it has been discussed before that it's getting rather unintuitive in the quest of being newbies-like that almost every new thing gets cut out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: OperationalError: (1045, Access denied for user 'root;malher'@'localhost' (using password: NO))
uhm. note that the uri is mysql://username:password@hostname/databasename it seems that you put a ; instead of a : between user and password. On Friday, June 5, 2015 at 6:26:00 AM UTC+2, Jose Galvan wrote: Hi all.. Iam starting to learn web2py. I have been playing with DAL and was able to import a legacy MySQL DB tables. I did it using the python's prompt and it was possible to do some queries to the tables of the legacy DB...the results of these queries were presented as python dictionary format, it was great !. To continue playing with my legacy DB I decide to create a new app following the Web2py Browser interface so the first thing I did was to update the line refered to the DAL conexion in models db.py. then when I run the app..appears the following error ticket.. any help will be appreciated.. Error ticket for Pedidos Ticket ID 127.0.0.1.2015-06-03.17-26-28.b24801c4-a854-4de5-9d20-c360002ac66a type 'exceptions.RuntimeError' Failure to connect, tried 5 times: Traceback (most recent call last): File D:\Python27\Lib\site-packages\web2py\gluon\packages\dal\pydal\base.py, line 437, in __init__ self._adapter = ADAPTERS[self._dbname](**kwargs) File D:\Python27\Lib\site-packages\web2py\gluon\packages\dal\pydal\adapters\base.py, line 57, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File D:\Python27\Lib\site-packages\web2py\gluon\packages\dal\pydal\adapters\mysql.py, line 132, in __init__ if do_connect: self.reconnect() File D:\Python27\Lib\site-packages\web2py\gluon\packages\dal\pydal\connection.py, line 105, in reconnect self.connection = f() File D:\Python27\Lib\site-packages\web2py\gluon\packages\dal\pydal\adapters\mysql.py, line 130, in connector return self.driver.connect(**driver_args) File d:\python27\lib\site-packages\MySQLdb\__init__.py, line 81, in Connect return Connection(*args, **kwargs) File d:\python27\lib\site-packages\MySQLdb\connections.py, line 187, in __init__ super(Connection, self).__init__(*args, **kwargs2) OperationalError: *(1045, Access denied for user 'root;malher'@'localhost' (using password: NO)) * Versión web2py™ Version 2.11.2-stable+timestamp.2015.05.30.16.33.24 Rastreo 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. Traceback (most recent call last): File D:\Python27\Lib\site-packages\web2py\gluon\restricted.py, line 227, in restricted exec ccode in environment File D:/Python27/Lib/site-packages/web2py/applications/Pedidos/models/db.py http://127.0.0.1:8000/admin/default/edit/Pedidos/models/db.py, line 21, in module db = DAL('mysql://root;malher@localhost/lafe') File D:\Python27\Lib\site-packages\web2py\gluon\packages\dal\pydal\base.py, line 174, in __call__ obj = super(MetaDAL, cls).__call__(*args, **kwargs) File D:\Python27\Lib\site-packages\web2py\gluon\packages\dal\pydal\base.py, line 459, in __init__ raise RuntimeError(Failure to connect, tried %d times:\n%s % (attempts, tb)) RuntimeError: Failure to connect, tried 5 times: Traceback (most recent call last): File D:\Python27\Lib\site-packages\web2py\gluon\packages\dal\pydal\base.py, line 437, in __init__ self._adapter = ADAPTERS[self._dbname](**kwargs) File D:\Python27\Lib\site-packages\web2py\gluon\packages\dal\pydal\adapters\base.py, line 57, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File D:\Python27\Lib\site-packages\web2py\gluon\packages\dal\pydal\adapters\mysql.py, line 132, in __init__ if do_connect: self.reconnect() File D:\Python27\Lib\site-packages\web2py\gluon\packages\dal\pydal\connection.py, line 105, in reconnect self.connection = f() File D:\Python27\Lib\site-packages\web2py\gluon\packages\dal\pydal\adapters\mysql.py, line 130, in connector return self.driver.connect(**driver_args) File d:\python27\lib\site-packages\MySQLdb\__init__.py, line 81, in Connect return Connection(*args, **kwargs) File d:\python27\lib\site-packages\MySQLdb\connections.py, line 187, in __init__ super(Connection, self).__init__(*args, **kwargs2) OperationalError: (1045, Access denied for user 'root;malher'@'localhost' (using password: NO)) In file: D:\Python27\Lib\site-packages\web2py\applications\Pedidos\models\db.py 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. # -*- coding: utf-8 -*- # ## This
[web2py] Re: how to reference session dictionary vars?
please try (not tested) response.title = str(session.saved_purpose['specificOrganizationID'])+' - '+str(session.saved_purpose['the_purpose']) ref: http://web2py.com/books/default/chapter/29/02/the-python-language#dict best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] All messed up
did you by any chance update web2py using the update button on admin ? if so, and if you were running a rather old web2py instance, the updater probably left some files behind that shouldn't be there (mainly DAL structure with the new subpackage). See what the standard folder structure in gluon/ is and watch out for any leftovers... On Friday, June 5, 2015 at 11:59:17 AM UTC+2, weheh wrote: Alright. I took the error message over to another machine that has an older version of web2py running. Looks pretty fundamental. CountFileError10_0_globals.pyAttributeError: type object 'DAL' has no attribute 'Field' http://127.0.0.1:8000/admin/errors/admin#+ details http://127.0.0.1:8000/admin/ticket/admin/127.0.0.1.2015-06-05.02-55-08.02729837-2dc6-4e87-abb3-9875cf7b3015 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. Traceback (most recent call last): File G:\web2py\gluon\restricted.py, line 227, in restricted exec ccode in environment File G:\web2py\applications\myapp\models\0_0_globals.py, line 18, in module from gluon.tools import * File G:\web2py\gluon\custom_import.py, line 108, in custom_importer return NATIVE_IMPORTER(name, globals, locals, fromlist, level) File G:\web2py\gluon\tools.py, line 50, in module Field = DAL.Field AttributeError: type object 'DAL' has no attribute 'Field' -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] how to reference session dictionary vars?
I want to access specificOrganizationID or any var in the below session dict vars session.saved_purpose = dict(the_purpose = request.get_vars.the_purpose, specificOrganizationID=request.get_vars.specificOrganizationID) If I type this response.title=str(session.saved_purpose) I correctly get {'specificOrganizationID': '7', 'the_purpose': 'assign_person_to_role'} what is syntax for referencing any of the individual vars above? if I type response.title=str(session.specificOrganizationID) or any scores of combinations I've tried, I get 'None' thanks Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]
not to be the buzzkiller but I won't post any example there that exists on web2pyslices.com that ATM has at least 2 killer features: social login and packages uploads. BTW: until all snippets are continously tested, this is going to become the 4th incarnation of a web2py snippet blog/container/etc with outdated pieces of code within the next year, when the buzz wears off. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: how to reference session dictionary vars?
works perfectly thanks Stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Allow users to comment only for certain period of time
One thing you can do... Let's say, Table1 is post Table2 is comment When you render the comment form form = SQLFORM(db.comment).process() I am assuming you want to comment after the post is processed which make sense. Here you can invoke a conditional statement like this. post_time = db.post.created_on; comment_time = db.comment.created_on; if (comment_time post_time + whatever time you want to allow user) response.flash('you have passed the time I allocated to comment on my post') else If process.accpted(): go through the rest. Just some thoughts. You need to work through the syntax. On Friday, June 5, 2015 at 9:32:39 AM UTC-4, 黄祥 wrote: it's so difficult without seeing any code, but you can use timedelta for it e.g. not tested duedate = blog.created_by + datetime.timedelta(7) editable = True if request.now duedate else False best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Debugging Web2py applications.
One debugging method I find helpful is being able to print to console the variables, objects, etc. I'm creating a decoupled application and the client-side is sending args to the server-side. To understand what these args exactly entail I'd like to print them out using Python. Consider this example: @request.restful() def clients(): def POST(**vars): print **vars return ... By printing **vars, I intend to see that in console (or somewhere). Is this possible? If so, how can I achieve this? Thanks :) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Import an entire file into another file.
In rails you can do require filename and use anything from that file. Can you do something similar in Web2py? Here's the situation: fila_a.py in Controllers file_b.py in Controllers I need to import most of the functions (or all of them) from file_a.py into file_b.py. How can I achieve this? Thanks in advance :) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Upgrade to Web2py 2.10.4 breaks date field search in sqlform.grid
That seems to have fixed the date issue but I have another field that it did not fix. This field is populate not from a database but from a SET. When you try to filter on the values from the SET, instead of getting a drop down, you only get an empty text box. This also worked fine before the upgrade. On Fri, Jun 5, 2015 at 2:11 PM, Niphlod niph...@gmail.com wrote: once again surrounded by a brilliant white light of not supporting different sets of specific css-widgets... issue https://github.com/web2py/web2py/issues/994 PR that fixes https://github.com/web2py/web2py/pull/995 On Friday, June 5, 2015 at 2:52:18 PM UTC+2, Massimo Di Pierro wrote: Please open a ticket about this. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: SMARTGRID and linked_tables - no buttons to edit, delete - only view
and the latter option is very unsafe. On Friday, 5 June 2015 09:32:13 UTC-5, Anthony wrote: You either have to be logged in or set user_signature=False. Anthony On Friday, June 5, 2015 at 12:26:00 AM UTC-4, Beat Kohler wrote: Hey guys! on a SMARTGRID I added a linked_table argument. ... no I have only the view button left. No way to modify neither the parent nor the child. What goes wrong.. sorry, what I made wrong? Coding: grid = SQLFORM.smartgrid(db.CUSTOMER, linked_tables=['CUST_PEOPLE'], editable=True) (the editable argument I added later ... no effect) Table definitions: db.define_table(CUSTOMER, Field(CUSTNAME, string, length=30, label=T(Customer Name), notnull=True, default=None), Field(DESCRIPTION, text, label=T(Customer Description), notnull=True, default=None), Field(COMMUNICATION, text, label=T(Access Description), notnull=True, default=None), Field(LOGINNET, text, label=T(Login Network), notnull=True, default=None), Field(DOCU, upload, label=T(Documentation Access)), Field(DOCU2, upload, label=T(Documentation Access 2)), Field(DOCU3, upload, label=T(Documentation Access 3)), migrate=True, format='%(CUSTNAME)s') db.define_table(CUST_PEOPLE, Field(id_CUSTOMER, db.CUSTOMER), Field(NAME, string, label=T(Name of Contact), length=80, notnull=True, default=None), Field(JOB_POSITION, string, label=T(Job Position), length=80, notnull=True, default=None), Field(EMAIL, string, length=30, label=T(Email), notnull=True, default=None, requires=IS_EMAIL()), Field(TEL, string, length=80, label=T(Telephone), notnull=True, default=None), migrate=True) Thanks for your help Beat -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Locking app to a single domain
I have define routes like this: routers = dict( BASE = dict( domains = { 'domain1.com' : 'app1', 'domain2.com' : 'app2', } ), ) which works OK. However, there is a thing, that I would like to avoid. If i acces: domain1.com/*app2*, i get app2. Is there a way to avoid accessing app2 through domain1.com (and vice-versa) in parameter-based system? Best, Kristjan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.