[web2py] Re: Docker
@Michael M: Nice solution, with postgres and mysql :) -- 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: Docker
I also builded a docker; containing ssl-nginx-uwsgi based on ubuntu and with some extra python deps (Pillow and gdata). https://github.com/acidjunk/docker-web2py It's meant to be used with an existing app; it will add routes.py for your app. You can get it from docker hub also docker pull acidjunk/web2py Maybe it's time to create an official web2py docker? -- 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: Is there a plan to put an official image of web2py on Docker?
An official package would be souper douper :) I'm now running with: thehipbot/web2py which run fine: Nginx, Uwsgi emperror and Web2py It will use latest web2py version from source. On Tuesday, September 27, 2016 at 5:00:55 AM UTC+2, JorgeH wrote: > > It would be a great idea. > > To have one with the latest release. > > Or what of the current images do you recommend? > > > https://hub.docker.com/search/?isAutomated=0=0=1=0=web2py=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: IMPORTANT - WEB2PY CONSULTING
Hi Massimo, you could remove me from the list: Formatics.nl I still notice a lot of doublures on the current list. Cheers, Rene -- 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: Janrain: NEW OpenID connect
I have the same problem: Gmail user can't login anymore. Google Apps for business user can login; but they get a popup telling them it will expire 20 april 2015. R On Thursday, April 23, 2015 at 6:00:34 PM UTC+2, Stefan van den Eertwegh wrote: Dear fellow web2py users, I understand that the Janrain plugin in web2py makes use of openID for Google Accounts authorization. Now at the moment we get a warning from the authorization site that google doesn't use OpenID anymore and therefore we need to use OpenID Connect. Is this a change in the web2py codebase that needs to happen or is Janrain self supplying web2py with the new way for google Open ID connect authorization way? If anyone knows the answer, i would really appreciate it. Thanks. Best regards, Stefan van den Eertwegh -- 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 support DB migrations on Heroku?
Hi, I did some more testing - uploads in a work just fine; it seems to go wrong with our automatic thumbnailing stuff. The thumbs were saved on disk (static/thumbnails) via a compute lambda construction. Field('logo','upload', requires=IS_IMAGE(), label=T('Members logo')), Field('logo_thumb_159', 'upload', compute=lambda r: THUMB(r['logo'], 159, 101, True)), I think I need to rewrite the THUMB code to store the thumb in de DB. I can also confirm that the migration stuff works fine. (after doing a one time fake_migrate_all). Thanks :) Kind Regards Rene On Wednesday, June 18, 2014 1:11:25 AM UTC+2, Derek wrote: - using an already existing DB; while being able to support future migrations just fake_migrate_all and then remove that line. regular migrations should work. If not, send your sql.log. what's your issue with file uploads? do they work locally and fail on hosted? On Tuesday, June 17, 2014 7:27:25 AM UTC-7, Rene Dohmen wrote: Hi, Are the any users at all using heroku and web2py with a postgres DB? The demo app: http://tranquil-spire-8889.herokuapp.com/ We are running into problems also for: - file uploads - using an already existing DB; while being able to support future migrations Kind Regards, Rene On Friday, June 13, 2014 4:14:49 PM UTC+2, Rene Dohmen wrote: Hi Web2py Users, I deployed an app with postgres on Heroku following the info in: https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-heroku.sh https://github.com/web2py/web2py/blob/master/gluon/contrib/heroku.py I already had a working postgres database from a previous deployment so I uploaded that from my workstation to the heroku environment using the heroku postgres restore tool. I had to use fake_migrate_all to get a working DB without any tickets. Is there a smart way to get DB migrations working on Heroku itself when you already have a DB? To clarify: Should I rename local .table files with another prefix, matching the Heroku postgres connection URI and upload them also when I deploy a new version of the app, or is there a better way? -- 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 support DB migrations on Heroku?
Hi, Are the any users at all using heroku and web2py with a postgres DB? The demo app: http://tranquil-spire-8889.herokuapp.com/ We are running into problems also for: - file uploads - using an already existing DB; while being able to support future migrations Kind Regards, Rene On Friday, June 13, 2014 4:14:49 PM UTC+2, Rene Dohmen wrote: Hi Web2py Users, I deployed an app with postgres on Heroku following the info in: https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-heroku.sh https://github.com/web2py/web2py/blob/master/gluon/contrib/heroku.py I already had a working postgres database from a previous deployment so I uploaded that from my workstation to the heroku environment using the heroku postgres restore tool. I had to use fake_migrate_all to get a working DB without any tickets. Is there a smart way to get DB migrations working on Heroku itself when you already have a DB? To clarify: Should I rename local .table files with another prefix, matching the Heroku postgres connection URI and upload them also when I deploy a new version of the app, or is there a better way? -- 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 support DB migrations on Heroku?
Hi Web2py Users, I deployed an app with postgres on Heroku following the info in: https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-heroku.sh https://github.com/web2py/web2py/blob/master/gluon/contrib/heroku.py I already had a working postgres database from a previous deployment so I uploaded that from my workstation to the heroku environment using the heroku postgres restore tool. I had to use fake_migrate_all to get a working DB without any tickets. Is there a smart way to get DB migrations working on Heroku itself when you already have a DB? To clarify: Should I rename local .table files with another prefix, matching the Heroku postgres connection URI and upload them also when I deploy a new version of the app, or is there a better way? -- 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 Pages module (basic CMS)
Hi Again, Just updated the web2py-pages master branch with 2 .w2p files. And started a new branch (develop) which contains a complete welcome app with the page plugin already working that can be used as an appliance to speed up testing and developing with it. https://github.com/acidjunk/web2py-pages/tree/develop Kind Regards Rene On Wednesday, May 7, 2014 5:19:09 PM UTC+2, Michele Comitini wrote: You can test it in recent DAL. It's still experimental, but well supported in PostgreSQL. Just add the following options when instantiating a new DAL object: ignore_field_case=False, entity_quoting=True mic 2014-05-07 11:26 GMT+02:00 Álvaro J. Iradier alvaro@polartech.esjavascript:: Back in 2011 I proposed using quoted identifiers for databases supporting it: https://groups.google.com/d/msg/web2py/aSPtD_mGXdM/4Eflv-edEUEJ I think the check_reserved option is a valid fix, but databases like PostgreSql that allow using any word as identifier by quoting it should use this instead of checking for reserved words. It is a pain to hit this kind of issue when migrating from one database to another. Could this be rethinked again? Thanks. El martes, 6 de mayo de 2014 19:24:15 UTC+2, Rene Dohmen escribió: Hi Villas, page is a restricted word in postgres and some other DB's I think. We started development in web2py 1.99.1 with sqlite. it's a valid sqlite tableName. The problem for us is that we can't rename it very easing without breaking a lot of apps. The problem that we had with building a web2py plugin is that it's not so nice to overwrite db.py; and that has strict sql keyword checks in there by default. I will create a w2p file from it tomorrow. For now you can copy the git tree over an app; and it should work (when you have the needed deps) Online references: http://www.formatics.nl (it's 95% page module) Kind Regards Rene On Friday, February 28, 2014 1:34:50 AM UTC+1, villas wrote: Hi Rene Is there a plugin now? BTW the whole idea of using check_reserved is so you can avoid using reserved names with new projects. Finding a way to avoid that so you can use 'page' negates the purpose. Thanks for your effort to release this work and it will be very nice to see it in action! Best wishes, D On Thursday, 27 February 2014 20:07:21 UTC, Rene Dohmen wrote: This was solved a while ago :) On Friday, December 20, 2013 9:34:21 AM UTC+1, Ruud Schroen wrote: We are still working on a plugin. But we are facing a problem regarding reserved keywords which prevents us from creating a plugin. db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all']) check_reserved=['all'] needs to be removed in order for it to work right now, the problem is you can't overrule it somewhere. If anyone knows a solution that will be greatly appreciated, and we can finally make a plugin for 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+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.
Re: [web2py] Re: Uforum - a forum web2py application
+1 2014-05-08 12:26 GMT+02:00 Stefaan Himpe stefaan.hi...@gmail.com: I have created a web2py forum software, now currently only in the Dutch but wil be ported to english. Ziet er goed uit! -- http://technogems.blogspot.com http://a-touch-of-music.blogspot.com http://youtube.com/stefaanhimpe -- 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: Web2Py Pages module (basic CMS)
Hi Villas, page is a restricted word in postgres and some other DB's I think. We started development in web2py 1.99.1 with sqlite. it's a valid sqlite tableName. The problem for us is that we can't rename it very easing without breaking a lot of apps. The problem that we had with building a web2py plugin is that it's not so nice to overwrite db.py; and that has strict sql keyword checks in there by default. I will create a w2p file from it tomorrow. For now you can copy the git tree over an app; and it should work (when you have the needed deps) Online references: http://www.formatics.nl (it's 95% page module) Kind Regards Rene On Friday, February 28, 2014 1:34:50 AM UTC+1, villas wrote: Hi Rene Is there a plugin now? BTW the whole idea of using check_reserved is so you can avoid using reserved names with new projects. Finding a way to avoid that so you can use 'page' negates the purpose. Thanks for your effort to release this work and it will be very nice to see it in action! Best wishes, D On Thursday, 27 February 2014 20:07:21 UTC, Rene Dohmen wrote: This was solved a while ago :) On Friday, December 20, 2013 9:34:21 AM UTC+1, Ruud Schroen wrote: We are still working on a plugin. But we are facing a problem regarding reserved keywords which prevents us from creating a plugin. db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all']) *check_reserved=['all'] *needs to be removed in order for it to work right now, the problem is you can't overrule it somewhere. If anyone knows a solution that will be greatly appreciated, and we can finally make a plugin for 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: Best way to migrate from sqlite to postgresql (or other db)
That's a nice tool. I'm going to try it. The only problem seems that it will copy all stuff on DB level. Correct me if i'm wrong: So if you had a couple of sqlite table_name changes or column drops while developing - then they are copied into the new Postgres DB. (In most cases that would mean a manual cleanup of web2py sqlite migration left overs; at least in our projects) On Friday, April 25, 2014 12:24:50 PM UTC+2, Michele Comitini wrote: If you were to migrate to postgresql I would suggest pgloader http://pgloader.org/howto/pgloader.1.html. An amazing piece of code: fast, smart and robust. Once you have moved the database to postgresql you need only to change the connection string in db.py to connect to your new postgresql copy. 2014-04-25 3:11 GMT+02:00 Rene Dohmen re...@formatics.nl javascript:: With some tweaking the script that Alan Proposed did work in my situation. (50+ tables and a lot of references) https://groups.google.com/d/msg/web2py-developers/QxeJNByj6qc/cpBHsa1ymUkJ In Short: 1) recreate the complete model in postgres: db_new = DAL('postgres://user:pass@localhost/projectname', migrate=settings.migrate, check_reserved=False, entity_quoting=True, bigint_id=True) (Still have to find a smart way to get the auth and other tables in there; for now I did it manually) Let web2py create the empty tables for the db_new postgres table. 2) Place the sqlite2pg.py in modules/ (One small modification: I had to remove the line which truncates the table) 3) Write a controller: def migrate(): import sqlite2pg sqlite2pg.migrate(db, db_new) 4) swap db_new and db in you DAL connection file. Hurray: Working postgres DB with all data. :) -- 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] Migrating from sqlite to postgres?
Hi Web2py users, we are struggling, for some time now, with a migration of our apps from sqlite to postgres. We tried a couple of approaches: first we tried doing it with cp_db.py but that had problems with relations and seems broken. Our current approach consist of these steps: 1) export data with: def export_all(): db.export_to_csv_file(open('export_all.csv', 'w')) 2) change conenction string from sqlite: db = DAL('sqlite://storage.sqlite', migrate=settings.migrate) TO: db = DAL('postgres://user:pass@localhost/project', migrate=settings.migrate,check_reserved =False, entity_quoting=True) 3) remove contents of database/ folder and let web2py create the DB 4) import data from the csv def import_all(): db.import_from_csv_file(open('export_all.csv', 'r')) The import then runs for a very long time and after 10 minutes or so a ticket is served: - Ticket ID 127.0.0.1.2014-04-24.13-38-52.6c7d2674-34e2-4968-9526-ee78b83fda76 Versieweb2py™Version 2.9.5-stable+timestamp.2014.03.16.02.35.39PythonPython 2.7.5: /usr/bin/python (prefix: /System/Library/Frameworks/Python.framework/Versions/2.7)Traceback 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. Traceback (most recent call last): File /Users/acidjunk/GIT/formatics.web2py/gluon/main.py, line 539, in wsgibase BaseAdapter.close_all_instances('rollback') File /Users/acidjunk/GIT/formatics.web2py/gluon/dal.py, line 600, in close_all_instances db._adapter.close(action) File /Users/acidjunk/GIT/formatics.web2py/gluon/dal.py, line 580, in close getattr(self, action)() File /Users/acidjunk/GIT/formatics.web2py/gluon/dal.py, line 1923, in rollback return self.connection.rollback() File /Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/dbapi.py, line 455, in _fn return fn(self, *args, **kwargs) File /Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/dbapi.py, line 551, in rollback self.conn.rollback() File /Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/interface.py, line 622, in rollback self._rollback.execute() File /Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/interface.py, line 166, in execute self.c.close_portal(self._portal_name) File /Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/protocol.py, line 1326, in close_portal reader.handle_messages() File /Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/protocol.py, line 906, in handle_messages msg = self._conn._read_message() File /Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/protocol.py, line 1033, in _read_message bytes = self._read_bytes(5) File /Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/protocol.py, line 1021, in _read_bytes self._sock_buf = self._sock.recv(1024) timeout: timed out Error snapshot [image: help]http://localhost:/admin/default/ticket/leondewit/127.0.0.1.2014-04-24.13-38-52.6c7d2674-34e2-4968-9526-ee78b83fda76# class 'socket.timeout'(timed out) - Is there a better way to do this kind of migrate, or to have better debug info about where it goes wrong? Any help is appreciated. Kind Regards Rene -- 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: Best way to migrate from sqlite to postgresql (or other db)
Hmm , I tried this approach (and some other variants from this thread.): but I run into an error after 15? minutes or so; The error occurs during the execution of the import_from_csv... --- Traceback (most recent call last): File console, line 1, in module File /Users/acidjunk/GIT/formatics.web2py/gluon/dal.py, line 8519, in import_from_csv_file *args, **kwargs) File /Users/acidjunk/GIT/formatics.web2py/gluon/dal.py, line 9345, in import_from_csv_file curr_id = self.insert(**dict(items)) File /Users/acidjunk/GIT/formatics.web2py/gluon/dal.py, line 9114, in insert ret = self._db._adapter.insert(self, self._listify(fields)) File /Users/acidjunk/GIT/formatics.web2py/gluon/dal.py, line 1360, in insert raise e timeout: timed out --- De storage.sqlite is 9.4Mb. The exported csv: just under 1Mb. Kind Regards Rene On Wednesday, April 23, 2014 6:25:36 PM UTC+2, Michael Beller wrote: Over the past week I've experimented with several options (I'm moving from sqlite to mysql on python anywhere) and here's what worked for me (and hope this helps others) ... The book describes two methods: - export/import all data using CSV files ( http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#CSV--all-tables-at-once- ) - copy between databases using script cpdb.py ( http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=cpdb#Copy-data-from-one-db-into-another ) Previous comments in this thread highlight two other options: - sqlite .dump and mysql migration per http://www.realpython.com/blog/python/web2py-migrating-from-sqlite-to-mysql/#.Ulm3xmTTXCU - Mariano/Alan Etkin experimental script - https://groups.google.com/d/msg/web2py-developers/QxeJNByj6qc/cpBHsa1ymUkJ I couldn't get cpdb to work except for a simple model. I'm still learning both python and web2py and couldn't debug the script but believe it has something to do with the sequence and dependencies between tables (I have about 12 tables with numerous foreign keys). This is also true of using sqlite .dump and mysql migrate (and I also felt this bypassed web2py which requires a fake_migrate and preferred an option within web2py since I'm also learning MySQL at the same time). The experimental script seemed straightforward but (1) I wasn't sure how to execute the script with both DAL's simultaneously and (2) the primary advantage over CSV export/import is the retention of the source row id's (which isn't needed if you start with a new database schema - see my comments below). In the end, I used the following procedure using web2py cdv export/import to move my production sqlite db to mysql (which only took about 7 minutes to execute after learning/testing/experimenting with the various options) ... 1. Export all data in CSV format a. open console and navigate to the web2py folder b. start web2py in interactive console mode with: python web2py.py -S your_app_name -M –P c. export data in csv format with: db.export_to_csv_file(open('your_app_name_export.csv', 'wb')) [this stores the file in the root of the web2py directory] d. exit web2py interactive console mode with: exit() 2. Prepare web2py application for new database and create new database a. in console, navigate to application folder b. backup existing SQLite database (and corresponding .table files) with: cp -r databases databases_bak c. create empty databases folder with: rm -r databases mkdir databases d. change DAL connection string in app to: db = DAL('mysql://user_name:password@mysql.server/database_name') [for pythonanywhere, the database_name is in the form user_name$database_name] e. create new empty mysql database schema (from control panel in pythonanywhere or mysql command prompt) 3. Generate database tables and load data a. start web2py in interactive console mode with: python web2py.py -S your_app_name -M –P [this will execute the models and generate the mysql database tables and the .table files in the database directory] c. import data in csv format with: db.import_from_csv_file(open('your_app_name_export.csv', 'rb')) db.commit() # this is missing from some of the other instructions but is required d. exit web2py interactive console mode with: exit() 4. Celebrate! If you start with a new empty database, all record id's will be the same as the source database (and all foreign key references are maintained). If the database had previous transactions, the new data will maintain all foreign key references but the id's will not match the source data (which is only important if there are any code or external references to specific id's as Alan pointed out in his posts). -- Resources: -
[web2py] Re: Best way to migrate from sqlite to postgresql (or other db)
With some tweaking the script that Alan Proposed did work in my situation. (50+ tables and a lot of references) https://groups.google.com/d/msg/web2py-developers/QxeJNByj6qc/cpBHsa1ymUkJ In Short: 1) recreate the complete model in postgres: db_new = DAL('postgres://user:pass@localhost/projectname', migrate=settings.migrate, check_reserved=False, entity_quoting=True, bigint_id=True) (Still have to find a smart way to get the auth and other tables in there; for now I did it manually) Let web2py create the empty tables for the db_new postgres table. 2) Place the sqlite2pg.py in modules/ (One small modification: I had to remove the line which truncates the table) 3) Write a controller: def migrate(): import sqlite2pg sqlite2pg.migrate(db, db_new) 4) swap db_new and db in you DAL connection file. Hurray: Working postgres DB with all data. :) -- 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: Weird truncate performance problem after upgrade to 2.8.2
We now did a drop outside of web2py. That's very fast. In the web2py logs we only see: DELETE FROM table; When we run that from appadmin or via execute_sql: very slow (3 sec for 100 rows) When we run it from sqlite3: it's done 1 sec On Thursday, February 27, 2014 6:01:10 AM UTC+1, Anthony wrote: What happens if you take the exact SQL that web2py executes and instead execute it outside of web2py altogether (i.e., via some other database client)? On Wednesday, February 26, 2014 7:06:46 PM UTC-5, Rene Dohmen wrote: Hi Web2py-Users, We have an app which imports data form a .csv file into a sqlite table. The CSV has 70k lines. Once a week we re-import data with a new .csv. The controller that handles this job: 1) handles the upload and moves it to location for future reference 2) truncates the main table and 2 subtables (with linked data, main table has a auth.signature) 3) imports the .csv and use the info in the data to refill the other 2 tables. Before our update from 2.4.6 to 2.8.2 it was very fast. Max 10-15 seconds, for steps 1-3. After the update (still not 100% sure if the update to 2.8 caused it; because we did add other functionality also and updated web2py itself); we had performance issues; The import suddenly needed somewhere between 15m and 1 hour. After a lot of debugging we isolated the problem to the truncate part of the steps. The truncate of 68000 records took 2040 seconds (with a delete form appadmin: 3 seconds for 100 records). We tried it from appadmin also, tried execute_sql; but they all had the same issue. As a workaround we now drop the table from sqlite (via sqlite3 and a os.system call), delete the *tablename.table file from the databases/ folder and then import the data again. But a more web2py-ish solution would be welcome. ;) Any suggestions in what could cause the problem are more then welcome. Kind Regards Rene -- 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/groups/opt_out.
[web2py] Re: Web2Py Pages module (basic CMS)
This was solved a while ago :) On Friday, December 20, 2013 9:34:21 AM UTC+1, Ruud Schroen wrote: We are still working on a plugin. But we are facing a problem regarding reserved keywords which prevents us from creating a plugin. db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all']) *check_reserved=['all'] *needs to be removed in order for it to work right now, the problem is you can't overrule it somewhere. If anyone knows a solution that will be greatly appreciated, and we can finally make a plugin for 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/groups/opt_out.
[web2py] Weird truncate performance problem after upgrade to 2.8.2
Hi Web2py-Users, We have an app which imports data form a .csv file into a sqlite table. The CSV has 70k lines. Once a week we re-import data with a new .csv. The controller that handles this job: 1) handles the upload and moves it to location for future reference 2) truncates the main table and 2 subtables (with linked data, main table has a auth.signature) 3) imports the .csv and use the info in the data to refill the other 2 tables. Before our update from 2.4.6 to 2.8.2 it was very fast. Max 10-15 seconds, for steps 1-3. After the update (still not 100% sure if the update to 2.8 caused it; because we did add other functionality also and updated web2py itself); we had performance issues; The import suddenly needed somewhere between 15m and 1 hour. After a lot of debugging we isolated the problem to the truncate part of the steps. The truncate of 68000 records took 2040 seconds (with a delete form appadmin: 3 seconds for 100 records). We tried it from appadmin also, tried execute_sql; but they all had the same issue. As a workaround we now drop the table from sqlite (via sqlite3 and a os.system call), delete the *tablename.table file from the databases/ folder and then import the data again. But a more web2py-ish solution would be welcome. ;) Any suggestions in what could cause the problem are more then welcome. Kind Regards Rene -- 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/groups/opt_out.
[web2py] Re: Bug on version 2.8.2
Hi Paulo, Doesn't seem like a bug to me. More like a typo you made in the model... But if I remember correctly you would get an error defining a reference to a non existing table in older web2py releases. You could also build the reference like this; Field('image', db.image) That way you would get an error when db.image doesn't exist. The reference notation can also be used for circular references... http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Self-Reference-and-aliases Kind Regards Rene On Tuesday, February 25, 2014 11:07:18 AM UTC+1, Paulo Ramos wrote: Well, this isn't a question, but a bug report (I'm new to the list). I was following online book, chapter 3, with a small difference. Instead of using singular on tables names I use plural, so I give to the image table the name 'images'. However I made a mistake when referencing images in posts, i.e., I used Field('image_id', 'reference image'), instead of Field('image_id', 'reference images'). Of course, when I tried to post a comment an error message came up. After spending several minutes to figure where the error was (well in this case the ticket system was not so helpful because always pointed to the controller and not the model, where the mistake was), I fix it, but the error message continue. I went to the sql.log file, and table name still was in singular, so I change that in sql.log. No changes, the error continue, albeit the multiple success word in the end of sql.log. The solution I found was delete the storage.sqlite. After that everything went smooth. I'm almost sure that this is a bug in DAL module. HTH, Paulo -- 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/groups/opt_out.
Re: [web2py] Setting DAL less strict from a model
I just tested it with Michele's proposed code: Created a 0_db.py with the following content: real_DAL = DAL def DAL(*args, **kwargs): kwargs['check_reserved'] = False kwargs['entity_quoting'] = True return real_DAL(*args, **kwargs) Cool: the https://github.com/acidjunk/web2py-pages is now working without touching your web2py code. A .w2p plugin will be released soon. Kind regards, Rene On Sunday, February 9, 2014 1:55:46 AM UTC+1, Rene Dohmen wrote: Hi, Just checked with trunk Version 2.8.2-stable+timestamp.2014.01.30.08.43.19 and entity_quoting=True in the DAL connection string; Then it works. (but I still have to remove the check_reserved from the DB connection URI) I really would like to build/release a .w2p/plugin that doesn't overwrite your existing db.py: or give a cryptic error on first time usage. I hope it will be a default value in the next release or that there is some simple way to set it with a function call in the future: entity_quoting and check_reserved seem to be a DAL connection argument only. Kind Regards Rene On Thursday, February 6, 2014 7:03:29 PM UTC+1, Rene Dohmen wrote: Hi Mic, I will test it later on. But i'm not sure how this would solve the problem; I still need to remove the check_reserved from the DAL connection string. The goal is to NOT change anything in db.py; so the page module can be used as a normal w2p plugin. Or are you saying check_reserved will be removed in the future; e.g. it wil be replaced by entity_quoting=True by default? Kind regards Rene On Tuesday, February 4, 2014 10:01:04 PM UTC+1, Michele Comitini wrote: Hi Rene, try testing with trunk, remove check_reserved and add the following to DAL parameters: DAL(., entity_quoting=True) after that you should have no conflict with reserved SQL words. You should be able to use any name, e.g. do things like define_table('table', Field('select'), Field('update')) Let us know if that works. mic 2014-02-04 Rene Dohmen re...@formatics.nl: Hi Web2py-users, I have developed a CMS kind of system based on web2py. https://github.com/acidjunk/web2py-pages I actually want to provide a release as a w2p file on a regular basis, so it can be used more easily. But I'm running into a problem if I don't overwrite any core web2py app files. https://github.com/acidjunk/web2py-pages/blob/master/README.md When I started the development (web2py 1.97.2) I made some DB naming choices that gave problems later on, when using strict(er) mode in DAL. The key problem is that we choose 'page' for our main table containing the pages. Obviously a lot of code in the page controller is using 'page' also for adding, editing and sorting pages; and I also have some projects in production that use it already. So a rename is not that straight forward or easy... I did investigate the web2py docs to see if I could relax the strict mode from a model that would be included after db.py; but that doesn't seem to be possible. Any help is appreciated. Kind Regards Rene -- 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/groups/opt_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/groups/opt_out.
[web2py] Re: New to Web2Py: Large Model
You could use extract_mysql_models.py (in the web2py/scripts folder) On Wednesday, February 12, 2014 4:58:29 PM UTC+1, Juslin Guo wrote: Hi, I have an application in PHP with 500 over tables, what's the best way to managed them in Web2Py, without repeating model definitions nor loading them all. -- 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/groups/opt_out.
Re: [web2py] Setting DAL less strict from a model
Hi, Just checked with trunk Version 2.8.2-stable+timestamp.2014.01.30.08.43.19 and entity_quoting=True in the DAL connection string; Then it works. (but I still have to remove the check_reserved from the DB connection URI) I really would like to build/release a .w2p/plugin that doesn't overwrite your existing db.py: or give a cryptic error on first time usage. I hope it will be a default value in the next release or that there is some simple way to set it with a function call in the future: entity_quoting and check_reserved seem to be a DAL connection argument only. Kind Regards Rene On Thursday, February 6, 2014 7:03:29 PM UTC+1, Rene Dohmen wrote: Hi Mic, I will test it later on. But i'm not sure how this would solve the problem; I still need to remove the check_reserved from the DAL connection string. The goal is to NOT change anything in db.py; so the page module can be used as a normal w2p plugin. Or are you saying check_reserved will be removed in the future; e.g. it wil be replaced by entity_quoting=True by default? Kind regards Rene On Tuesday, February 4, 2014 10:01:04 PM UTC+1, Michele Comitini wrote: Hi Rene, try testing with trunk, remove check_reserved and add the following to DAL parameters: DAL(., entity_quoting=True) after that you should have no conflict with reserved SQL words. You should be able to use any name, e.g. do things like define_table('table', Field('select'), Field('update')) Let us know if that works. mic 2014-02-04 Rene Dohmen re...@formatics.nl: Hi Web2py-users, I have developed a CMS kind of system based on web2py. https://github.com/acidjunk/web2py-pages I actually want to provide a release as a w2p file on a regular basis, so it can be used more easily. But I'm running into a problem if I don't overwrite any core web2py app files. https://github.com/acidjunk/web2py-pages/blob/master/README.md When I started the development (web2py 1.97.2) I made some DB naming choices that gave problems later on, when using strict(er) mode in DAL. The key problem is that we choose 'page' for our main table containing the pages. Obviously a lot of code in the page controller is using 'page' also for adding, editing and sorting pages; and I also have some projects in production that use it already. So a rename is not that straight forward or easy... I did investigate the web2py docs to see if I could relax the strict mode from a model that would be included after db.py; but that doesn't seem to be possible. Any help is appreciated. Kind Regards Rene -- 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/groups/opt_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/groups/opt_out.
Re: [web2py] Setting DAL less strict from a model
Hi Mic, I will test it later on. But i'm not sure how this would solve the problem; I still need to remove the check_reserved from the DAL connection string. The goal is to NOT change anything in db.py; so the page module can be used as a normal w2p plugin. Or are you saying check_reserved will be removed in the future; e.g. it wil be replaced by entity_quoting=True by default? Kind regards Rene On Tuesday, February 4, 2014 10:01:04 PM UTC+1, Michele Comitini wrote: Hi Rene, try testing with trunk, remove check_reserved and add the following to DAL parameters: DAL(., entity_quoting=True) after that you should have no conflict with reserved SQL words. You should be able to use any name, e.g. do things like define_table('table', Field('select'), Field('update')) Let us know if that works. mic 2014-02-04 Rene Dohmen re...@formatics.nl javascript:: Hi Web2py-users, I have developed a CMS kind of system based on web2py. https://github.com/acidjunk/web2py-pages I actually want to provide a release as a w2p file on a regular basis, so it can be used more easily. But I'm running into a problem if I don't overwrite any core web2py app files. https://github.com/acidjunk/web2py-pages/blob/master/README.md When I started the development (web2py 1.97.2) I made some DB naming choices that gave problems later on, when using strict(er) mode in DAL. The key problem is that we choose 'page' for our main table containing the pages. Obviously a lot of code in the page controller is using 'page' also for adding, editing and sorting pages; and I also have some projects in production that use it already. So a rename is not that straight forward or easy... I did investigate the web2py docs to see if I could relax the strict mode from a model that would be included after db.py; but that doesn't seem to be possible. Any help is appreciated. Kind Regards Rene -- 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/groups/opt_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/groups/opt_out.
[web2py] Setting DAL less strict from a model
Hi Web2py-users, I have developed a CMS kind of system based on web2py. https://github.com/acidjunk/web2py-pages I actually want to provide a release as a w2p file on a regular basis, so it can be used more easily. But I'm running into a problem if I don't overwrite any core web2py app files. https://github.com/acidjunk/web2py-pages/blob/master/README.md When I started the development (web2py 1.97.2) I made some DB naming choices that gave problems later on, when using strict(er) mode in DAL. The key problem is that we choose 'page' for our main table containing the pages. Obviously a lot of code in the page controller is using 'page' also for adding, editing and sorting pages; and I also have some projects in production that use it already. So a rename is not that straight forward or easy... I did investigate the web2py docs to see if I could relax the strict mode from a model that would be included after db.py; but that doesn't seem to be possible. Any help is appreciated. Kind Regards Rene -- 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/groups/opt_out.
[web2py] janrain login not working anymore?
Hi, We use the janrain login method in a couple of our webapps. As of today it suddenly stopped working... Are there any other users that use the janrain login methods? (and have it working?) On the janrain site I found a story about and old and a new way to use janrain. The Iframe way seems deprecated. Kind Regards Rene -- 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/groups/opt_out.
[web2py] Re: Web2Py Pages module (basic CMS)
Hi List, Ruud, thanks for sharing. :) I'll build a w2p plugin from it at the end of this week. We are still testing it; and need to upgrade fancy box to fancybox2. Kind Regards, Rene On Wednesday, November 20, 2013 12:06:47 AM UTC+1, Ruud Schroen wrote: Also i forgot to mention: The app contains a file called *copy_to_app.sh *which you can use to copy the needed content to a standard welcome app. Inside this file you need to change you will find two locations of apps: - The web2py pages app - A standard welcome app You need to change those lines to match the locations to this and your app, then run the file in a terminal like this: *./copy_to_app.sh* On Tuesday, November 19, 2013 9:23:42 AM UTC+1, Ruud Schroen wrote: Hi, I'm here to share a great module with you. It's called *web2py-pages*, created by Formatics http://www.formatics.nl which I'm currently working for. You can download it here: web2py-pageshttps://github.com/acidjunk/web2py-pages Pages module for web2py gives you a good starting point for any type of CMS. It features a tree of pages with sluggified (URL friendly) names. Pages can consist out of items. Current page items are: - Markmin text - HTML text - Plain text - Image (with optional Fancybox) - Imageslider - Photoalbum (Google Picasa) - FAQ Address - File upload - Links - and a couple of pre defined forms It also has neat features like: - CKeditor - plugin_tagging - Admin Menu - Easy way to create a test page with all items - Page copy functionality - Functionality to change the order of items displayed - Two columns (left align, right align, full align) - Nivoslider - Fancybox Current available languages: - Dutch (NL) - English (EN) *Download here!* https://github.com/acidjunk/web2py-pages -- 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/groups/opt_out.
[web2py] Small error in current online web2py book
I don't know if this is the correct place to post this: http://www.web2py.com/book/default/chapter/01#security Serves me: invalid function (default/chapter) Original page: http://web2py.com/init/default/what (containing the link) Greets Rene -- --- 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/groups/opt_out.
[web2py] Re: SQLFORM.grid and joins
Hi Massimo, We did print the t-shirt ourselves ;-) I'll send you one. Kind Regards, Rene On Thursday, February 28, 2013 6:06:56 PM UTC+1, Massimo Di Pierro wrote: Where did you get that? I want one. -- --- 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/groups/opt_out.
[web2py] scheduler problem in trunk when using datetime as return value?
Hi, I like the new scheduler concept a lot. It looks promising. Something goes wrong when I try to return a datetime in the method I wanted to schedule... A Simple JSON parsing error -- raise TypeError(repr(o) + is not JSON serializable) TypeError: datetime.datetime(2012, 12, 10, 15, 57, 59, 300169) is not JSON serializable -- Example test code: -- def dateTask(): return dict(taskDate=datetime.now()) from gluon.scheduler import Scheduler Scheduler(db,dict(dateTask=dateTask)) -- Scheduler started from web2py trunk with: python web2py.py --nogui -K APPNAME -D0 Rene --
[web2py] Missing dumps() in rss2 contrib
Hi All, i'm running web2py 2.2.1 When I try to return a rss with the generic.rss view or when I try to follow example http://www.web2py.com/examples/simple_examples/rss_aggregator It serves a ticket with: 'module' object has no attribute 'dumps' The gluon/contrib/rss2 - doesn't have a dumps method?? Am I doing something wrong? Kind Regards Rene --
Re: [web2py] Re: Mysql reserved words in a legacy db
I tried: Field('`group`', ...), AND Field('group',...), Resulting in a ticket: SyntaxError: only [0-9a-zA-Z_] allowed in table and field names, received `group` On Wed, Jun 20, 2012 at 10:29 PM, Cliff Kachinske cjk...@gmail.com wrote: It occurs to me you might try this Field('group'), On Wednesday, June 20, 2012 2:03:48 PM UTC-4, acidjunk wrote: Hi All, I use web2py to create a admin interface for an older project with an existing database in MySQL. So I extracted the DAL info with an script. --extracted from current mysql db -- user_db.define_table('users', Field('user_id', 'id'), Field('login_name', 'string'), Field('title', 'string'), Field('first_name', 'string'), Field('last_name', 'string'), Field('birthdate', 'datetime'), Field('group', user_db.group_names, requires=IS_IN_DB(user_db,'group_names.group_id','%(group_name)s')), format='%(first_name)s %(last_name)s') -- When I try to insert or update stuff web2py serves me a ticket. Viewing the record is no problem. It even shows the dropdown with groupnames from the linked_table. In the documentation on http://www.web2py.com/examples/static/epydoc/web2py.gluon.reserved_sql_keywords-pysrc.html it says that GROUP is a keyword. Is there a way to force the DAL to quote the fieldNames in its insert and update query's? With our previous framework we didn't experience any problems with a field group in a mysql table. It would be cool if there is a way to loosen the restrictions on reserved keywords on a per app basis. Kind Regards Rene Dohmen --
Re: [web2py] Re: Mysql reserved words in a legacy db
I did some reading in the list and several users had a problem with it. Quoting fieldNames in postgres sql is different for MySQL. Maybe a easy solution would be to add an extra optional parameter for the DAL connection statement? e.g. for MySQL: user_db = DAL('mysql://user:pass@localhost/legacy_db', migrate=False, quote_field_names='`') Rene On Thu, Jun 21, 2012 at 4:04 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You cannot handle it that way. In order to allow reserved keywords as table and field names we need changes in the dal source. massimo On Thursday, 21 June 2012 04:35:58 UTC-5, acidjunk wrote: I tried: Field('`group`', ...), AND Field('group',...), Resulting in a ticket: SyntaxError: only [0-9a-zA-Z_] allowed in table and field names, received `group` On Wed, Jun 20, 2012 at 10:29 PM, Cliff Kachinske cjk...@gmail.com wrote: It occurs to me you might try this Field('group'), On Wednesday, June 20, 2012 2:03:48 PM UTC-4, acidjunk wrote: Hi All, I use web2py to create a admin interface for an older project with an existing database in MySQL. So I extracted the DAL info with an script. --extracted from current mysql db -- user_db.define_table('users', Field('user_id', 'id'), Field('login_name', 'string'), Field('title', 'string'), Field('first_name', 'string'), Field('last_name', 'string'), Field('birthdate', 'datetime'), Field('group', user_db.group_names, requires=IS_IN_DB(user_db,'group_names.group_id','%(group_name)s')), format='%(first_name)s %(last_name)s') -- When I try to insert or update stuff web2py serves me a ticket. Viewing the record is no problem. It even shows the dropdown with groupnames from the linked_table. In the documentation on http://www.web2py.com/examples/static/epydoc/web2py.gluon.reserved_sql_keywords-pysrc.html it says that GROUP is a keyword. Is there a way to force the DAL to quote the fieldNames in its insert and update query's? With our previous framework we didn't experience any problems with a field group in a mysql table. It would be cool if there is a way to loosen the restrictions on reserved keywords on a per app basis. Kind Regards Rene Dohmen -- --
[web2py] Mysql reserved words in a legacy db
Hi All, I use web2py to create a admin interface for an older project with an existing database in MySQL. So I extracted the DAL info with an script. --extracted from current mysql db -- user_db.define_table('users', Field('user_id', 'id'), Field('login_name', 'string'), Field('title', 'string'), Field('first_name', 'string'), Field('last_name', 'string'), Field('birthdate', 'datetime'), Field('group', user_db.group_names, requires=IS_IN_DB(user_db,'group_names.group_id','%(group_name)s')), format='%(first_name)s %(last_name)s') -- When I try to insert or update stuff web2py serves me a ticket. Viewing the record is no problem. It even shows the dropdown with groupnames from the linked_table. In the documentation on http://www.web2py.com/examples/static/epydoc/web2py.gluon.reserved_sql_keywords-pysrc.html it says that GROUP is a keyword. Is there a way to force the DAL to quote the fieldNames in its insert and update query's? With our previous framework we didn't experience any problems with a field group in a mysql table. It would be cool if there is a way to loosen the restrictions on reserved keywords on a per app basis. Kind Regards Rene Dohmen
Re: [web2py] Quoting reserved words in DAL
I'm having the same problem: https://groups.google.com/d/msg/web2py/hCsxVaDLfT4/K6UMbG5p5uAJ On Mon, Jun 18, 2012 at 9:30 AM, Michael Toomim too...@gmail.com wrote: I just got bit by the reserved-word problem: https://groups.google.com/d/msg/web2py/aSPtD_mGXdM/c7et_2l_54wJ I am trying to port a postgres database to a friend's mysql database, but we are stuck because the DAL does not quote identifiers. This problem has been discussed a fair amount: https://groups.google.com/d/msg/web2py/QKktETHk3yo/Mwm3D-JhNmAJ ...and it seems all we need to do is add some quoting mechanisms to the DAL. In postgresql you surround names with quotes and in mysql you use `backticks`. Does anyone have ideas for what to do? --
[web2py] Autologin via janrain?
Hi List, I'm building an app where users can make quiz content together; login via janrain (only facebook provider). We also have a small iOS app (game) to test the quiz content; it reads the data from a xml that is composed on the fly by a controller function. Is there an easy way to authenticate the user via janrain en let them see the xml? Kind Regards Rene
[web2py] Web2py support the netherlands
Hi Web2py users, I would like to announce web2py support for the Netherlands by Formatics.nl . We did a couple of sites with web2py and I personally think it's the best invention since sliced bread ;-) Can we be included on the web2py professional support page? (I don't know if this is the correct place to request it) Kind Regards, Rene Dohmen
[web2py] Re: Routes.py and janrain login
Got it working with the example from the web2py book: routers = dict( BASE = dict(default_application='formatics'), ) Thank you web2py book :) Maybe a nice reminder for people running with mod_wsgi: you have to restart the webserver to activate changes in routes.py, and that's why it didn't work the 1st time R On Feb 2, 2:51 am, Rene Dohmen acidj...@gmail.com wrote: Hi List, I've installed mod_wsgi on our server and added a vhost so that each application is accessible viawww.examples.com/app_name One of the apps is ready; so I created another vhost and started an separate instance of web2py. The second instance uses a routes.py to remove the appname from the URL. You can see it here:http://www.formaticz.nl Everything works OK, but when I try to login via the janrain login, I get redirected to:http://www.formaticz.nl/formatics/default/user/logininstead ofhttp://www.formaticz.nl/default/user/login (making it impossible to login) This is the routes.py I used (in root web2py folder). routes_in=[['/$anything','/formatics/$anything']] routes_out=[['/formatics/$anything','/$anything']] I tried adding some extra values to it, but couldn't get it working. Kind Regards,Rene
[web2py] Routes.py and janrain login
Hi List, I've installed mod_wsgi on our server and added a vhost so that each application is accessible via www.examples.com/app_name One of the apps is ready; so I created another vhost and started an separate instance of web2py. The second instance uses a routes.py to remove the appname from the URL. You can see it here: http://www.formaticz.nl Everything works OK, but when I try to login via the janrain login, I get redirected to: http://www.formaticz.nl/formatics/default/user/login instead of http://www.formaticz.nl/default/user/login (making it impossible to login) This is the routes.py I used (in root web2py folder). routes_in=[['/$anything','/formatics/$anything']] routes_out=[['/formatics/$anything','/$anything']] I tried adding some extra values to it, but couldn't get it working. Kind Regards, Rene