- changed milestone to next micropoint release
add "synchronization" flag to Mapper
be able to create a Mapper against a join with custom synchronization rules, in a manner similar to joined table inheritance, except without the inheritance:
account = Table('account',
Column('id', Integer, primary_key=True),
Column('email_address', String),
Column('password', String),
)
person = Table('person',
Column('id', Integer, primary_key=True),
Column('account_id', Integer, ForeignKey('account.id'),
Column('handle', String),
Column('firstname', String),
Column('lastname', String),
)
class Person(object):
pass
the mapper then maps against a join of account and person, and synchronizes account_id
into the person
table:
mapper(Person, join(account, person), synchronize=[account.c.id==person.c.account_id](account.c.id==person.c.account_id))
also, the join of account and person should be able to be in any order. when the mapper does save_obj
and delete_obj
it should be using the table dependency sort to iterate through the tables.
Comments (7)
-
reporter -
reporter - marked as blocker
-
reporter - marked as critical
-
reporter - changed status to resolved
hey guess what....i did this functionality so long ago i forgot how it works. i just fixed the docs to illustrate the correct way to do it, and made some small fixes to allow the "many-to-many" version to work, and also got the Mapper to sort the tables correctly when it saves/deletes across multiple, instead of semi-accidentally the way it was working, and cleaned up the unit tests for it.
the format looks like:
mapper(Person, join(account, person), properties ={ 'account_id':[person.c.account_id](account.c.account_id,) })
and that particular example will work as far back as 0.1.0 !
-
reporter -
reporter - changed milestone to 0.4.0
Milestone next micropoint release deleted
-
reporter - removed milestone
- Log in to comment