Hi Lee,
Just create a class with all your common definition (derived from SQLObject)
later derive from this class fore each of your tables.
for example:
class Common(SQLOBject):
name = StringCol()
age = IntCol()
[...]
class FirstDerived(Common):
pass
class SecondDerived(Common):
class sqlmeta:
table = "tableNameInDB"
[...]
Just replace your definition on Common class and name all other classes as
required, maybe by sqlmeta.
Hope it helps.
Regards.
On 1/20/07, Lee Connell <[EMAIL PROTECTED]> wrote:
>
> I have several tables in my database which have the same structure as
> each other but have different names. How would I create a class in python
> code to access these individual tables? I can provide a tuple of all the
> names of the tables in the database, but how do I go about creating the
> class for each of them? I know this is probably confusing because I really
> don't know how to explain.
>
>
>
> I don't want to have to create a class for each table since they are all
> identical structures.
>
>
>
> Thanks!
>
> >
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.17.2/641 - Release Date: 1/20/2007
> 10:24 AM
>
>
--
Julio
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---