yes and no....
you can run db.executesql(""" your script """)
you can also run scripts/extract_mysql_models.py or scripts/
extract_pgsql_models.py to generate models from you from the tables in
the database.
The problem is that web2py needs more info than the data in your
script (validators, field types and labels for example).
You will need to manually edit models.
On Nov 11, 6:00 pm, Crim <[email protected]> wrote:
> The sql script is just a sql script that creates a sql db
>
> basically i was hoping i could import the script in to the natively
> supported db's that web2py supports.
>
> On Nov 11, 3:31 pm, mdipierro <[email protected]> wrote:
>
> > what DB are we talking about? What does the SQL script do?
>
> > On Nov 11, 3:25 pm, Richard Vézina <[email protected]>
> > wrote:
>
> > > First you have to define your legacy database model in web2py model then
> > > you
> > > will be able to make query a la web2py or raw sql query.
>
> > > Richard
>
> > > On Thu, Nov 11, 2010 at 10:26 AM, Crim <[email protected]> wrote:
> > > > So im working on a webapp that will access a database.. which isnt
> > > > overly hard but i want to import some SQL script for my database...
> > > > can this be done? Could some one point me in the right direction or
> > > > possibly give me a line of code to help?
>
> > > > -I should mention im fairly new to web2py and thanks for any
> > > > assistance ^ ^
>
>