summaryrefslogtreecommitdiff
path: root/README.py3k
diff options
context:
space:
mode:
authorbiner <huanghuibin@gmail.com>2013-08-01 22:24:31 +0800
committerbiner <huanghuibin@gmail.com>2013-08-01 22:24:31 +0800
commit1a090caaf459eb49f939c0cf385a7b02331b67f3 (patch)
tree12caa890338d35ee0b2c9b5f742c746ea95c7607 /README.py3k
parent25839c064d995b3664f0cef01768961ac5e4807f (diff)
downloadsqlalchemy-pr/20.tar.gz
mapping multiple tables for one classpr/20
I'm doing something to finish the horizontal shard job. The examle is sharding to multiple database . And i just do it for multipls tables in one database. there is many tables just like msg_00,msg_01..... msg_99 defind the class like Msg() map the tables . =============================== m = Msg number = int(uid)%100 tablename = 'msg_%02d'%(number) m.__uuid__ = uid m.__table__.name = tablename =============================== now "m" mapping the table msg_xx . It works in the select sql. but fail in the session.add(newmessage) because the sqlalchemy has cache connection . event one table is Table(msg_00) and another is Table (msg_01) So, i edit the memo key . then there is diff insert object . ------------------ It's simple change and useful. It‘s safe for the old version . sorry for my poor english.
Diffstat (limited to 'README.py3k')
0 files changed, 0 insertions, 0 deletions