Advertisement
Guest User

Untitled

a guest
May 6th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. class User(Base):
  2. """ user using the hardware """
  3. __tablename__ = "users"
  4.  
  5. id = Column(Integer, primary_key = True)
  6. first_name = Column(String(20), nullable = False)
  7. last_name = Column(String(40), nullable = False)
  8. user_name = Column(String(10),nullable = False)
  9. email = Column(String (30), nullable = False)
  10. password = Column(String(10), nullable = False)
  11.  
  12. class Contact(Base):
  13. """ User's will input name, #, and pic? into a form """
  14.  
  15. __tablename__ = "contacts"
  16.  
  17. id = Column(Integer, primary_key = True)
  18. user_id = Column(Integer, ForeignKey("users.id"))
  19. first_name = Column(String(20), nullable = True)
  20. last_name = Column(String(40), nullable=True)
  21. phone_number = Column(Integer, nullable = True)
  22.  
  23. user = relationship("User", backref=backref("contacts", order_by=id))
  24.  
  25. class GPS_Location(Base):
  26. """ LAT +LONG coordinates will be stored """
  27. __tablename__="coordinates"
  28. id = Column(Integer, primary_key = True)
  29. user_id = Column(Integer, ForeignKey("users.id"), nullable=False)
  30. latitude= Column(Float, nullable = False)
  31. longitude = Column(Float, nullable = False)
  32. created = Column(DateTime, default=datetime.now, nullable = False)
  33.  
  34. user = relationship("User", backref=backref("coordinates", order_by=id))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement