Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
<comment-ja>
Machine(Model)??????????????
@param metadata: ???????MetaData
@type metadata: sqlalchemy.schema.MetaData
@param now: now
@type now: Datatime
</comment-ja>
<comment-en>
TODO: English Comment
</comment-en>

        def reload_mapper(metadata, now):
    """
    Machine(Model)??????????????
    @param metadata: ???????MetaData
    @type metadata: sqlalchemy.schema.MetaData
    @param now: now
    @type now: Datatime
    
    
    TODO: English Comment
    
    """
    t_machine = get_machine_table(metadata, now)
    t_machine_tag = metadata.tables['machine2tag']
    t_user = metadata.tables['user']
    
    mapper(Machine, t_machine, properties={
        'children' : relation(Machine,
                              backref=backref('parent',
                                              remote_side=[t_machine.c.id])),
        'notebook' : relation(karesansui.db.model.notebook.Notebook),
        'created_user' : relation(karesansui.db.model.user.User,
                                  primaryjoin=t_machine.c.created_user_id==t_user.c.id),
        'modified_user' : relation(karesansui.db.model.user.User,
                                  primaryjoin=t_machine.c.modified_user_id==t_user.c.id),
        'tags' : relation(karesansui.db.model.tag.Tag,
                         secondary=t_machine_tag,
                         backref="machine"),
        })
        


src/k/a/karesansui-HEAD/karesansui/db/model/__init__.py   karesansui(Download)
 
    import karesansui.db.model.machine
    karesansui.db.model.machine.reload_mapper(metadata, _now)
 
    import karesansui.db.model.snapshot

src/k/a/karesansui-HEAD/karesansui/db/model/snapshot.py   karesansui(Download)
                                      )
    metadata = sqlalchemy.MetaData(bind=engine)    # relation
    karesansui.db.model.machine.reload_mapper(metadata)
    karesansui.db.model.notebook.reload_mapper(metadata)
    karesansui.db.model.user.reload_mapper(metadata)

src/k/a/karesansui-HEAD/karesansui/db/model/machine2jobgroup.py   karesansui(Download)
    metadata = sqlalchemy.MetaData(bind=engine)
    # relation
    karesansui.db.model.machine.reload_mapper(metadata)
    karesansui.db.model.notebook.reload_mapper(metadata)
    karesansui.db.model.user.reload_mapper(metadata)