[web2py] Re: Converting legacy MySQL databases to web2py DAL

2013-11-15 Thread PeterL
Hi Kevin, I realize this is an old thread, but if you're still around, I just wanted to confirm whether this script is capable of extracting and creating foreign-keys with the reference keyword? I'm thinking not, since it did not give me any after I ran it, but perhaps there's an option I'm

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2012-11-20 Thread Gelasto Kounavi
At my part ,i ran the extract_mysql_models script but the output model file was not editable and also got ticket when I put it in the app folder as I tried to see what was happening with app admin. Any thoughts ? I 'm guessing I ' ll have to either rearrange my database or find a solution

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-26 Thread Kevin Ivarsen
Yes, this is a replacement. Trivial differences - just replaced MySQLdb references to gluon.contrib.pymysql, removed the comment up top about depending on MySQLdb, and added .. to the python path so that it can find gluon.contrib even if the web2py directory isn't in your system pythonpath.

Re: [web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-25 Thread Kevin Ivarsen
Great idea - I was not aware of pymysql. I had assumed web2py depended on an external MySQLdb module, which I already had installed. I changed the couple of lines to make it use gluon.contrib.pymysql, and it appears to still work. Revised copy is attached. Kevin ''' Create the web2py code

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-25 Thread Massimo Di Pierro
what are the differences between this one and the original? Should this be a replacement? On Mar 25, 10:36 pm, Kevin Ivarsen kivar...@gmail.com wrote: Great idea - I was not aware of pymysql. I had assumed web2py depended on an external MySQLdb module, which I already had installed. I changed

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-24 Thread fib
OK all I feel quite stupid I think I need the ABC of running this I have placed the file in a location where I know where it is and it can be seen in the web2py list I have tried putting the call into shell and into a web2py app I have used IDLE (python) and have tried shell on web2py I believe

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-24 Thread Kevin Ivarsen
The extract_mysql_models.py script runs at the command line - either from cmd.exe in Windows or a Terminal window in Mac / Linux. Which operating system are you running? I can try to walk you through the steps. Also, I don't believe MySQLdb is included with web2py by default, but it is easy to

Re: [web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-24 Thread Vasile Ermicioi
try to implement it with pymysql which is shipped with web2py (gluon.contrib.pymysql)

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-24 Thread fib
Oh I think reply to author was an email - I think I replied but it is not showing here?

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-24 Thread fib
Hi all OK I got it to work I found a MySQLdb for python 2.5 .exe on sourceforge http://sourceforge.net/projects/mysql-python/files%2Fmysql-python%2F1.2.2/ then the rest I got sorted through the command line apologies for idiocy thank you for all your help it is much appreciated On Mar 24, 8:03 

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-22 Thread fib
Response much appreciated I understand some of the defining and forms bits and want to use web2py - I do have rudimentary working apps but i was struggling to write the web2py code to create the db tables to match the mysql db tables i already have it was really the bit about changing the

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-22 Thread selecta
just trying to get to a point where i can do the db structure scrape to create the web2py db code as i interpret that is what your code does yes the script uses the mysql and mysqldump excecutables to dump the table structures and parses that with regular expressions Nice work Kevin, I have

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-21 Thread ron_m
Looks great, thanks for the addition. I worked on this a bit when it first was added but since I don't use mysql any more in the application I am working on and have a high workload I never got any further.

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-21 Thread mart
Hey Kevin, This is sweet! thanks for that! Mart :) On Mar 21, 11:53 am, ron_m ron.mco...@gmail.com wrote: Looks great, thanks for the addition. I worked on this a bit when it first was added but since I don't use mysql any more in the application I am working on and have a high workload I

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-21 Thread fib
apologies I am a newbie I believe that this may be what I was searching for as I have an existing mySQL db and am struggling getting my head into the web2py Can I add the mysqldb module in web2py and run this code there and if so - how sorry if this seems too simple

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-21 Thread fib
apologies I am a newbie I believe that this may be what I was searching for as I have an existing mySQL db and am struggling getting my head into the web2py Can I add the mysqldb module in web2py and run this code there and if so - how sorry if this seems too simple

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-21 Thread Kevin Ivarsen
In web2py, you could import MySQLdb and make SQL queries directly, but you would lose out on a lot of the time-saving features that web2py offers, such as automatic form generation for database tables. Instead, you would typically use web2py's DAL (Database Abstraction Layer), which provides a