Ian Bicking wrote:
>> class AuthorTable:
>>
>> def __init__(self, connection):
>> Author._connection =3D connection
>> Author.createTable(ifNotExists=3DTrue) =20
>>
>> def createAuthorTable(connection):
>> AuthorTable(connection)
>> =20
>> createAuthorTable(connectionForURI('mysql://markus:eagle@localhost/boo=
ks'))=20
>>
>>
>> a1 =3D Author(firstName =3D "J.R.R.", lastName =3D
>> "Tolkien")
>=20
>=20
> Yes, this is fine -- you can assign to ._connection as you set up the=20
> classes. The AuthorTable class seems a little odd to me -- I'd probabl=
y=20
> do it more like:
This strikes me too. At first I also made those ...Table: classes but=20
discovered there is no real use for them since the SQLObject classes are=20
the tables themselves. It is very strange at first not to have a=20
distinct object for "tables". It would be nice to address this issue in=20
the article since it illustrates the (to be changed) object vs.=20
relational mindset (Markus?).
just my 0.02=80
Paul
|