Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User(Base):
- """ user using the hardware """
- __tablename__ = "users"
- id = Column(Integer, primary_key = True)
- first_name = Column(String(20), nullable = False)
- last_name = Column(String(40), nullable = False)
- user_name = Column(String(10),nullable = False)
- email = Column(String (30), nullable = False)
- password = Column(String(10), nullable = False)
- class Contact(Base):
- """ User's will input name, #, and pic? into a form """
- __tablename__ = "contacts"
- id = Column(Integer, primary_key = True)
- user_id = Column(Integer, ForeignKey("users.id"))
- first_name = Column(String(20), nullable = True)
- last_name = Column(String(40), nullable=True)
- phone_number = Column(Integer, nullable = True)
- user = relationship("User", backref=backref("contacts", order_by=id))
- class GPS_Location(Base):
- """ LAT +LONG coordinates will be stored """
- __tablename__="coordinates"
- id = Column(Integer, primary_key = True)
- user_id = Column(Integer, ForeignKey("users.id"), nullable=False)
- latitude= Column(Float, nullable = False)
- longitude = Column(Float, nullable = False)
- created = Column(DateTime, default=datetime.now, nullable = False)
- user = relationship("User", backref=backref("coordinates", order_by=id))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement