Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sanjit@ubuntu:~/Downloads/basketball/models$ python
- Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
- [GCC 4.6.1] on linux2
- Type "help", "copyright", "credits" or "license" for more information.
- >>> from get import *
- >>> a = PlayerJumpball(winner_id=5, loser_id=6, possessor_id=1)
- >>> session.add(a)
- >>> session.commit()
- >>> a
- None jumpball None
- >>> a.possessor
- official Joe Crawford
- >>> a.winner
- player Sasha Pavlovic
- >>> a.loser
- player Jermaine O'Neal
- >>>
- sanjit@ubuntu:~/Downloads/basketball/models$ python
- Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
- [GCC 4.6.1] on linux2
- Type "help", "copyright", "credits" or "license" for more information.
- >>> from get import *
- >>> a = session.query(PlayerJumpball)
- >>> a.all()
- [2 jumpball Jumpball: Jermaine O'Neal vs. Tyson Chandler (Rajon Rondo gains possession), 231 jumpball Jumpball: Brandon Bass vs. Carmelo Anthony (Landry Fields gains possession), None jumpball None]
- >>> b = a.all()[2]
- >>>
- >>> b
- None jumpball None
- >>> type(b)
- <class 'models.TeamJumpball'>
- >>>
Add Comment
Please, Sign In to add comment