Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Player:
- id = db.Column(db.BIGINT, primary_key=True, autoincrement=True)
- # СВЯЗЬ \/ \/
- last_log_id = db.Column(db.BIGINT, db.ForeignKey('PlayerLog.id'), nullable=False)
- last_log_action = db.relationship('CameraOnlineHistory',
- # primaryjoin="Player.last_log_id == PlayerLog.id",
- )
- # Связь ^^^
- logs = db.relationship('PlayerLog', lazy='dynamic', back_populates='player',
- # primaryjoin="Player.id == PlayerLog.camera_id"
- )
- Class PlayerLog()
- id = db.Column(db.BIGINT, primary_key=True, autoincrement=True)
- player_id = db.Column(db.BIGINT, db.ForeignKey('player.id'), index=True, nullable=False)
- player = db.relationship("Player",
- back_populates='logs',
- # foreign_keys='Player.id'
- # lazy='dynamic',
- )
Advertisement
Add Comment
Please, Sign In to add comment