Revize 7fe7be79
Přidáno uživatelem Matěj Zeman před asi 2 roky(ů)
server/sql_app/models.py | ||
---|---|---|
52 | 52 |
|
53 | 53 |
# relationships for foreign keys, thus connecting table with devices table |
54 | 54 |
devices = relationship("DeviceLicense", back_populates="licenses") |
55 |
|
|
55 |
body_devices = relationship("BodyDeviceLicense", back_populates="b_licenses") |
|
56 | 56 |
|
57 | 57 |
class DeviceLicense(Base): |
58 | 58 |
""" |
... | ... | |
71 | 71 |
licenses = relationship("License", back_populates="devices") |
72 | 72 |
|
73 | 73 |
|
74 |
class BodyDeviceLicense(Base): |
|
75 |
""" |
|
76 |
Class defining database table bodydevices_licenses |
|
77 |
""" |
|
78 |
__tablename__ = "bodydevices_licenses" |
|
79 |
|
|
80 |
id = Column(Integer, primary_key=True, index=True) |
|
81 |
bodydevice_id = Column(Integer, ForeignKey("body_devices.id")) |
|
82 |
license_id = Column(Integer, ForeignKey("licenses.id")) |
|
83 |
assigned_datetime = Column(String, index=True, nullable=False) |
|
84 |
|
|
85 |
# relationships for foreign keys, thus connecting table with devices and licenses |
|
86 |
# tables |
|
87 |
bodydevice_lic = relationship("BodyDevice", back_populates="debug_licenses") |
|
88 |
b_licenses = relationship("License", back_populates="body_devices") |
|
89 |
|
|
90 |
|
|
74 | 91 |
class PC(Base): |
75 | 92 |
""" |
76 | 93 |
Class defining database table pc |
... | ... | |
127 | 144 |
|
128 | 145 |
# relationships for foreign keys, thus connecting table with ld_logs table |
129 | 146 |
b_logs = relationship("LDLog", back_populates="body_device") |
147 |
debug_licenses = relationship("BodyDeviceLicense", back_populates="bodydevice_lic") |
|
130 | 148 |
|
131 | 149 |
|
132 | 150 |
class LDLog(Base): |
Také k dispozici: Unified diff
Added views for LD logs and forms for connecting body devices with licenses.