Re: [SQLObject] Inheritance strangeness
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <ab...@ne...> - 2005-06-03 10:02:19
|
Quoting Oleg Broytmann <ph...@ph...>:
>=20
> > from sqlobject.sqlite import builder; SQLiteConnection =3D builder()
> > conn =3D SQLiteConnection('persontest3.db', debug=3DFalse)
>=20
> Oops! Why not just
> conn =3D connectionForURI("sqlite:/persontest3.db?debug=3D")
> or even
> conn =3D "sqlite:/persontest3.db?debug=3D"
> ???
Thanks - these simpler syntaxes work! I am converted!
I was forced to use the messy syntax because in the current official sqlo=
bject
documentation at http://www.sqlobject.org/docs/SQLObject.html I didn't ha=
ve much
luck. The recommended syntaxes mentioned there are:
conn =3D SQLiteConnection('database.db')
conn =3D 'sqlite://path/to/database.db'
Well, using the first works, but warns me that it is deprecated.
And the second syntax seemed to give me errors because of the double slas=
hes - I
was typing in=20
conn =3D "sqlite://persontest3.db?debug=3D" # FAILS
instead of
conn =3D "sqlite:/persontest3.db?debug=3D" # WORKS :-)
So I'm not sure if that's a typo in the documentation, or the // is meant=
to be
like a http address (but you can't use sqlite over http anyway?).
Furthermore, my understanding of connection strings is so bad that I can'=
t seem
to specify a windows path name to a sqlite file either e.g.=20
conn =3D 'sqlite:/"C:/person test/persontest3.db"'
conn =3D 'sqlite:/C:/person test/persontest3.db'
conn =3D 'sqlite:/C:\\person test\\persontest3.db'
conn =3D 'sqlite://C:\\person test\\persontest3.db'
etc.
all fail. I wonder if there is an url somewhere that describes this stuf=
f -
maybe it was adopted recently by sqlobject because it is a common standar=
d and
described somewhere?
-Andy Bulka
http://www.atug.com/andypatterns
------------------------------------------------------------
This email was sent from Netspace Webmail: http://www.netspace.net.au
|