to be able to access the data with DAL, you need to define tables that you
want to use. If they exist already, as in your case, a simple migrate=False
will turn the migrations off and just define the table without creating it.
db.define_table('....', migrate=False)
On Saturday, April 19, 2014 8:26:20 PM UTC+2, Spencer Underwood wrote:
>
> I'm pretty new to web development as a whole and am planning to make a
> website for people playing the game EVE Online to use but have encountered
> some difficulty trying to access the database dump that CCP Games has
> released. The database dump is available
> here<https://www.fuzzwork.co.uk/dump/>in a SQLite, MySQL and PostGres. I use
> Win7 with minimal rights so if I
> have to use MySQL or PostGres to fix this problem it has to be able to
> install and run without admin rights.
>
> When accessing the database in the sqlite3 executable everything work
> perfectly, all that's needed to load the file is a .open
> sqlite-latest.sqlite and it just works. When opening the database file
> using the web2py DAL, it appears to load the file properly but doesn't know
> of any the tables that exist. This appears to be working as intended, but
> is a problem I can't figure out how to solve. When I try to manually define
> one of the tables I know exists (list of existing tables found
> here<http://wiki.eve-id.net/Category:CCP_DB_Tables>),
> I receive the error: sqlite3.OperationError: table invTypes already exists.
> The code I used to do this is as follows:
>
> from os.path import join, exists
> from httplib import HTTPException
> from gluon.sql import DAL, Field
> from gluon.validators import *
>
> import eveapi
> import datetime
>
> api = eveapi.EVEAPIConnection()
> db = DAL('sqlite://sqlite-latest.sqlite')
>
> #----------------------------------------------------------------------------
> db.define_table('invTypes')
>
> I haven't figured out how to run a python file as part of an application,
> so I just make a test.py file inside the root web2py director and run it
> from command line ("py.exe test.py").
>
>
> Does anyone know anything I could use to access this database?
>
> Thanks,
> Spencer Underwood
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.