hi there,
I am building a system where data sould be read from excel sheets
into a set of dynamically assigned tables.
As I d o not know the tables in advance, I want to assign the mappers
dynamically.
tis how I think to do it.
is this correct ?
thanks
robert
# a simple class as the base of a mapper
class TblMapper(object):
pass
class RedAlchemy(..):
...
########################################################
# handling mappers
########################################################
def getMappers(self):
'return self._mapppers, make sure all mappers exist'
self._checkEngine()
if self._session is None:
self._session = create_session(bind_to=self._db_engine)
mappers = self._mapppers
for tn, t in self._tables.items():
if not mappers.has_key(tn):
m = TblMapper
mappers[tn] = mapper(m, t, non_primary=len(mappers))
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---
begin:vcard
fn:robert rottermann
n:rottermann;robert
email;internet:[EMAIL PROTECTED]
tel;work:031 333 10 20
tel;fax:031 333 10 23
tel;home:031 333 36 03
x-mozilla-html:FALSE
version:2.1
end:vcard