Guest User

Untitled

a guest
Jun 13th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.02 KB | None | 0 0
  1.  
  2. sanjit@ubuntu:~/Downloads/basketball/models$ python
  3. Python 2.7.2+ (default, Oct  4 2011, 20:06:09)
  4. [GCC 4.6.1] on linux2
  5. Type "help", "copyright", "credits" or "license" for more information.
  6. >>> from get import *
  7. >>> a = PlayerJumpball(winner_id=5, loser_id=6, possessor_id=1)
  8. >>> session.add(a)
  9. >>> session.commit()
  10. >>> a
  11. None jumpball None
  12. >>> a.possessor
  13. official Joe Crawford
  14. >>> a.winner
  15. player Sasha Pavlovic
  16. >>> a.loser
  17. player Jermaine O'Neal
  18. >>>
  19. sanjit@ubuntu:~/Downloads/basketball/models$ python
  20. Python 2.7.2+ (default, Oct  4 2011, 20:06:09)
  21. [GCC 4.6.1] on linux2
  22. Type "help", "copyright", "credits" or "license" for more information.
  23. >>> from get import *
  24. >>> a = session.query(PlayerJumpball)
  25. >>> a.all()
  26. [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]
  27. >>> b = a.all()[2]
  28. >>>
  29. >>> b
  30. None jumpball None
  31. >>> type(b)
  32. <class 'models.TeamJumpball'>
  33. >>>
Add Comment
Please, Sign In to add comment