Revize 0fcb708f
Přidáno uživatelem Matěj Zeman před téměř 3 roky(ů)
server/doc/sql_app/models.html | ||
---|---|---|
42 | 42 |
vendor_id = Column(String, index=True, nullable=False) |
43 | 43 |
product_id = Column(String, index=True, nullable=False) |
44 | 44 |
serial_number = Column(String, index=True, nullable=False) |
45 |
assigned = Column(Boolean, index=True, nullable=False) |
|
45 |
inventory_number = Column(String, index=True, nullable=True) |
|
46 |
comment = Column(String, index=True, nullable=True) |
|
47 |
|
|
48 |
team_id = Column(Integer, ForeignKey("teams.id")) |
|
46 | 49 |
|
47 | 50 |
# relationships for foreign keys, thus connecting table with usb_logs and licenses |
48 | 51 |
# tables |
49 | 52 |
logs = relationship("USBLog", back_populates="device") |
50 | 53 |
licenses = relationship("DeviceLicense", back_populates="device_lic") |
54 |
team = relationship("Team", back_populates="devices") |
|
51 | 55 |
|
52 | 56 |
|
53 | 57 |
class USBLog(Base): |
... | ... | |
75 | 79 |
__tablename__ = "licenses" |
76 | 80 |
|
77 | 81 |
id = Column(Integer, primary_key=True, index=True) |
78 |
name = Column(String, index=True, nullable=False) |
|
79 |
expiration_date = Column(DateTime(timezone=True), server_default=func.now()) |
|
82 |
name = Column(String, index=True, nullable=True) |
|
83 |
license_id = Column(String, index=True, nullable=False) |
|
84 |
expiration_date = Column(DateTime(timezone=True), nullable=True) |
|
80 | 85 |
|
81 | 86 |
# relationships for foreign keys, thus connecting table with devices table |
82 | 87 |
devices = relationship("DeviceLicense", back_populates="licenses") |
88 |
bodydevice_lic = relationship("BodyDevice", back_populates="license") |
|
89 |
headdevice_lic = relationship("HeadDevice", back_populates="license") |
|
83 | 90 |
|
84 | 91 |
|
85 | 92 |
class DeviceLicense(Base): |
... | ... | |
108 | 115 |
id = Column(Integer, primary_key=True, index=True) |
109 | 116 |
username = Column(String, index=True, nullable=False) |
110 | 117 |
hostname = Column(String, index=True, nullable=False) |
111 |
assigned = Column(Boolean, index=True, nullable=False) |
|
112 |
team_id = Column(Integer, ForeignKey("teams.id")) |
|
113 | 118 |
|
114 | 119 |
# relationships for foreign keys, thus connecting table with teams, usb_logs and ld_logs |
115 | 120 |
# tables |
116 |
team = relationship("Team", back_populates="pcs") |
|
117 | 121 |
logs_pc = relationship("USBLog", back_populates="pc") |
118 | 122 |
ld_pc = relationship("LDLog", back_populates="ldpc") |
119 | 123 |
|
... | ... | |
127 | 131 |
id = Column(Integer, primary_key=True, index=True) |
128 | 132 |
name = Column(String, index=True, nullable=False) |
129 | 133 |
|
130 |
# relationships for foreign keys, thus connecting table with pc table |
|
131 |
pcs = relationship("PC", back_populates="team") |
|
134 |
devices = relationship("Device", back_populates="team") |
|
135 |
body_devices = relationship("BodyDevice", back_populates="team") |
|
136 |
head_devices = relationship("HeadDevice", back_populates="team") |
|
132 | 137 |
|
133 | 138 |
|
134 | 139 |
class HeadDevice(Base): |
... | ... | |
139 | 144 |
|
140 | 145 |
id = Column(Integer, primary_key=True, index=True) |
141 | 146 |
serial_number = Column(String, index=True, nullable=False) |
147 |
inventory_number = Column(String, index=True, nullable=True) |
|
148 |
comment = Column(String, index=True, nullable=True) |
|
149 |
|
|
150 |
team_id = Column(Integer, ForeignKey("teams.id")) |
|
151 |
license_id = Column(Integer, ForeignKey("licenses.id")) |
|
142 | 152 |
|
143 | 153 |
# relationships for foreign keys, thus connecting table with ld_logs table |
144 | 154 |
h_logs = relationship("LDLog", back_populates="head_device") |
155 |
license = relationship("License", back_populates="headdevice_lic") |
|
156 |
team = relationship("Team", back_populates="head_devices") |
|
145 | 157 |
|
146 | 158 |
|
147 | 159 |
class BodyDevice(Base): |
... | ... | |
152 | 164 |
|
153 | 165 |
id = Column(Integer, primary_key=True, index=True) |
154 | 166 |
serial_number = Column(String, index=True, nullable=False) |
167 |
inventory_number = Column(String, index=True, nullable=True) |
|
168 |
comment = Column(String, index=True, nullable=True) |
|
169 |
|
|
170 |
team_id = Column(Integer, ForeignKey("teams.id")) |
|
171 |
license_id = Column(Integer, ForeignKey("licenses.id")) |
|
155 | 172 |
|
156 | 173 |
# relationships for foreign keys, thus connecting table with ld_logs table |
157 | 174 |
b_logs = relationship("LDLog", back_populates="body_device") |
175 |
license = relationship("License", back_populates="bodydevice_lic") |
|
176 |
team = relationship("Team", back_populates="body_devices") |
|
158 | 177 |
|
159 | 178 |
|
160 | 179 |
class LDLog(Base): |
... | ... | |
174 | 193 |
# tables |
175 | 194 |
ldpc = relationship("PC", back_populates="ld_pc") |
176 | 195 |
head_device = relationship("HeadDevice", back_populates="h_logs") |
177 |
body_device = relationship("BodyDevice", back_populates="b_logs")</code></pre> |
|
196 |
body_device = relationship("BodyDevice", back_populates="b_logs") |
|
197 |
|
|
198 |
|
|
199 |
class User(Base): |
|
200 |
""" |
|
201 |
Class defining user in database with its own role |
|
202 |
""" |
|
203 |
__tablename__ = "users" |
|
204 |
|
|
205 |
id = Column(Integer, primary_key=True, index=True) |
|
206 |
username = Column(String, index=True, nullable=False) |
|
207 |
password = Column(String, index=True, nullable=False) |
|
208 |
role = Column(String, index=True, nullable=False)</code></pre> |
|
178 | 209 |
</details> |
179 | 210 |
</section> |
180 | 211 |
<section> |
... | ... | |
210 | 241 |
|
211 | 242 |
id = Column(Integer, primary_key=True, index=True) |
212 | 243 |
serial_number = Column(String, index=True, nullable=False) |
244 |
inventory_number = Column(String, index=True, nullable=True) |
|
245 |
comment = Column(String, index=True, nullable=True) |
|
246 |
|
|
247 |
team_id = Column(Integer, ForeignKey("teams.id")) |
|
248 |
license_id = Column(Integer, ForeignKey("licenses.id")) |
|
213 | 249 |
|
214 | 250 |
# relationships for foreign keys, thus connecting table with ld_logs table |
215 |
b_logs = relationship("LDLog", back_populates="body_device")</code></pre> |
|
251 |
b_logs = relationship("LDLog", back_populates="body_device") |
|
252 |
license = relationship("License", back_populates="bodydevice_lic") |
|
253 |
team = relationship("Team", back_populates="body_devices")</code></pre> |
|
216 | 254 |
</details> |
217 | 255 |
<h3>Ancestors</h3> |
218 | 256 |
<ul class="hlist"> |
... | ... | |
245 | 283 |
return self.impl.get(state, dict_)</code></pre> |
246 | 284 |
</details> |
247 | 285 |
</dd> |
248 |
<dt id="sql_app.models.BodyDevice.id"><code class="name">var <span class="ident">id</span></code></dt> |
|
249 |
<dd> |
|
250 |
<div class="desc"></div> |
|
251 |
<details class="source"> |
|
252 |
<summary> |
|
253 |
<span>Expand source code</span> |
|
254 |
</summary> |
|
255 |
<pre><code class="python">def __get__(self, instance, owner): |
|
256 |
if instance is None: |
|
257 |
return self |
|
258 |
|
|
259 |
dict_ = instance_dict(instance) |
|
260 |
if self._supports_population and self.key in dict_: |
|
261 |
return dict_[self.key] |
|
262 |
else: |
|
263 |
try: |
|
264 |
state = instance_state(instance) |
|
265 |
except AttributeError as err: |
|
266 |
util.raise_( |
|
267 |
orm_exc.UnmappedInstanceError(instance), |
|
268 |
replace_context=err, |
|
269 |
) |
|
270 |
return self.impl.get(state, dict_)</code></pre> |
|
271 |
</details> |
|
272 |
</dd> |
|
273 |
<dt id="sql_app.models.BodyDevice.serial_number"><code class="name">var <span class="ident">serial_number</span></code></dt> |
|
286 |
<dt id="sql_app.models.BodyDevice.comment"><code class="name">var <span class="ident">comment</span></code></dt> |
|
274 | 287 |
<dd> |
275 | 288 |
<div class="desc"></div> |
276 | 289 |
<details class="source"> |
... | ... | |
295 | 308 |
return self.impl.get(state, dict_)</code></pre> |
296 | 309 |
</details> |
297 | 310 |
</dd> |
298 |
</dl> |
|
299 |
</dd> |
|
300 |
<dt id="sql_app.models.Device"><code class="flex name class"> |
|
301 |
<span>class <span class="ident">Device</span></span> |
|
302 |
<span>(</span><span>**kwargs)</span> |
|
303 |
</code></dt> |
|
304 |
<dd> |
|
305 |
<div class="desc"><p>Class defining database table devices</p> |
|
306 |
<p>A simple constructor that allows initialization from kwargs.</p> |
|
307 |
<p>Sets attributes on the constructed instance using the names and |
|
308 |
values in <code>kwargs</code>.</p> |
|
309 |
<p>Only keys that are present as |
|
310 |
attributes of the instance's class are allowed. These could be, |
|
311 |
for example, any mapped columns or relationships.</p></div> |
|
312 |
<details class="source"> |
|
313 |
<summary> |
|
314 |
<span>Expand source code</span> |
|
315 |
</summary> |
|
316 |
<pre><code class="python">class Device(Base): |
|
317 |
""" |
|
318 |
Class defining database table devices |
|
319 |
""" |
|
320 |
__tablename__ = "devices" |
|
321 |
|
|
322 |
id = Column(Integer, primary_key=True, index=True) |
|
323 |
vendor_id = Column(String, index=True, nullable=False) |
|
324 |
product_id = Column(String, index=True, nullable=False) |
|
325 |
serial_number = Column(String, index=True, nullable=False) |
|
326 |
assigned = Column(Boolean, index=True, nullable=False) |
|
327 |
|
|
328 |
# relationships for foreign keys, thus connecting table with usb_logs and licenses |
|
329 |
# tables |
|
330 |
logs = relationship("USBLog", back_populates="device") |
|
331 |
licenses = relationship("DeviceLicense", back_populates="device_lic")</code></pre> |
|
332 |
</details> |
|
333 |
<h3>Ancestors</h3> |
|
334 |
<ul class="hlist"> |
|
335 |
<li>sqlalchemy.orm.decl_api.Base</li> |
|
336 |
</ul> |
|
337 |
<h3>Instance variables</h3> |
|
338 |
<dl> |
|
339 |
<dt id="sql_app.models.Device.assigned"><code class="name">var <span class="ident">assigned</span></code></dt> |
|
311 |
<dt id="sql_app.models.BodyDevice.id"><code class="name">var <span class="ident">id</span></code></dt> |
|
340 | 312 |
<dd> |
341 | 313 |
<div class="desc"></div> |
342 | 314 |
<details class="source"> |
... | ... | |
361 | 333 |
return self.impl.get(state, dict_)</code></pre> |
362 | 334 |
</details> |
363 | 335 |
</dd> |
364 |
<dt id="sql_app.models.Device.id"><code class="name">var <span class="ident">id</span></code></dt>
|
|
336 |
<dt id="sql_app.models.BodyDevice.inventory_number"><code class="name">var <span class="ident">inventory_number</span></code></dt>
|
|
365 | 337 |
<dd> |
366 | 338 |
<div class="desc"></div> |
367 | 339 |
<details class="source"> |
... | ... | |
386 | 358 |
return self.impl.get(state, dict_)</code></pre> |
387 | 359 |
</details> |
388 | 360 |
</dd> |
389 |
<dt id="sql_app.models.Device.licenses"><code class="name">var <span class="ident">licenses</span></code></dt>
|
|
361 |
<dt id="sql_app.models.BodyDevice.license"><code class="name">var <span class="ident">license</span></code></dt>
|
|
390 | 362 |
<dd> |
391 | 363 |
<div class="desc"></div> |
392 | 364 |
<details class="source"> |
... | ... | |
411 | 383 |
return self.impl.get(state, dict_)</code></pre> |
412 | 384 |
</details> |
413 | 385 |
</dd> |
414 |
<dt id="sql_app.models.Device.logs"><code class="name">var <span class="ident">logs</span></code></dt>
|
|
386 |
<dt id="sql_app.models.BodyDevice.license_id"><code class="name">var <span class="ident">license_id</span></code></dt>
|
|
415 | 387 |
<dd> |
416 | 388 |
<div class="desc"></div> |
417 | 389 |
<details class="source"> |
... | ... | |
436 | 408 |
return self.impl.get(state, dict_)</code></pre> |
437 | 409 |
</details> |
438 | 410 |
</dd> |
439 |
<dt id="sql_app.models.Device.product_id"><code class="name">var <span class="ident">product_id</span></code></dt>
|
|
411 |
<dt id="sql_app.models.BodyDevice.serial_number"><code class="name">var <span class="ident">serial_number</span></code></dt>
|
|
440 | 412 |
<dd> |
441 | 413 |
<div class="desc"></div> |
442 | 414 |
<details class="source"> |
... | ... | |
461 | 433 |
return self.impl.get(state, dict_)</code></pre> |
462 | 434 |
</details> |
463 | 435 |
</dd> |
464 |
<dt id="sql_app.models.Device.serial_number"><code class="name">var <span class="ident">serial_number</span></code></dt>
|
|
436 |
<dt id="sql_app.models.BodyDevice.team"><code class="name">var <span class="ident">team</span></code></dt>
|
|
465 | 437 |
<dd> |
466 | 438 |
<div class="desc"></div> |
467 | 439 |
<details class="source"> |
... | ... | |
486 | 458 |
return self.impl.get(state, dict_)</code></pre> |
487 | 459 |
</details> |
488 | 460 |
</dd> |
489 |
<dt id="sql_app.models.Device.vendor_id"><code class="name">var <span class="ident">vendor_id</span></code></dt>
|
|
461 |
<dt id="sql_app.models.BodyDevice.team_id"><code class="name">var <span class="ident">team_id</span></code></dt>
|
|
490 | 462 |
<dd> |
491 | 463 |
<div class="desc"></div> |
492 | 464 |
<details class="source"> |
... | ... | |
513 | 485 |
</dd> |
514 | 486 |
</dl> |
515 | 487 |
</dd> |
516 |
<dt id="sql_app.models.DeviceLicense"><code class="flex name class">
|
|
517 |
<span>class <span class="ident">DeviceLicense</span></span>
|
|
488 |
<dt id="sql_app.models.Device"><code class="flex name class"> |
|
489 |
<span>class <span class="ident">Device</span></span> |
|
518 | 490 |
<span>(</span><span>**kwargs)</span> |
519 | 491 |
</code></dt> |
520 | 492 |
<dd> |
521 |
<div class="desc"><p>Class defining database table devices_licenses</p>
|
|
493 |
<div class="desc"><p>Class defining database table devices</p> |
|
522 | 494 |
<p>A simple constructor that allows initialization from kwargs.</p> |
523 | 495 |
<p>Sets attributes on the constructed instance using the names and |
524 | 496 |
values in <code>kwargs</code>.</p> |
... | ... | |
529 | 501 |
<summary> |
530 | 502 |
<span>Expand source code</span> |
531 | 503 |
</summary> |
532 |
<pre><code class="python">class DeviceLicense(Base):
|
|
504 |
<pre><code class="python">class Device(Base): |
|
533 | 505 |
""" |
534 |
Class defining database table devices_licenses
|
|
506 |
Class defining database table devices |
|
535 | 507 |
""" |
536 |
__tablename__ = "devices_licenses"
|
|
508 |
__tablename__ = "devices" |
|
537 | 509 |
|
538 | 510 |
id = Column(Integer, primary_key=True, index=True) |
539 |
device_id = Column(Integer, ForeignKey("devices.id")) |
|
540 |
license_id = Column(Integer, ForeignKey("licenses.id")) |
|
541 |
assigned_datetime = Column(String, index=True, nullable=False) |
|
511 |
vendor_id = Column(String, index=True, nullable=False) |
|
512 |
product_id = Column(String, index=True, nullable=False) |
|
513 |
serial_number = Column(String, index=True, nullable=False) |
|
514 |
inventory_number = Column(String, index=True, nullable=True) |
|
515 |
comment = Column(String, index=True, nullable=True) |
|
542 | 516 |
|
543 |
# relationships for foreign keys, thus connecting table with devices and licenses |
|
517 |
team_id = Column(Integer, ForeignKey("teams.id")) |
|
518 |
|
|
519 |
# relationships for foreign keys, thus connecting table with usb_logs and licenses |
|
544 | 520 |
# tables |
545 |
device_lic = relationship("Device", back_populates="licenses") |
|
546 |
licenses = relationship("License", back_populates="devices")</code></pre> |
|
521 |
logs = relationship("USBLog", back_populates="device") |
|
522 |
licenses = relationship("DeviceLicense", back_populates="device_lic") |
|
523 |
team = relationship("Team", back_populates="devices")</code></pre> |
|
547 | 524 |
</details> |
548 | 525 |
<h3>Ancestors</h3> |
549 | 526 |
<ul class="hlist"> |
... | ... | |
551 | 528 |
</ul> |
552 | 529 |
<h3>Instance variables</h3> |
553 | 530 |
<dl> |
554 |
<dt id="sql_app.models.DeviceLicense.assigned_datetime"><code class="name">var <span class="ident">assigned_datetime</span></code></dt>
|
|
531 |
<dt id="sql_app.models.Device.comment"><code class="name">var <span class="ident">comment</span></code></dt>
|
|
555 | 532 |
<dd> |
556 | 533 |
<div class="desc"></div> |
557 | 534 |
<details class="source"> |
... | ... | |
576 | 553 |
return self.impl.get(state, dict_)</code></pre> |
577 | 554 |
</details> |
578 | 555 |
</dd> |
579 |
<dt id="sql_app.models.DeviceLicense.device_id"><code class="name">var <span class="ident">device_id</span></code></dt>
|
|
556 |
<dt id="sql_app.models.Device.id"><code class="name">var <span class="ident">id</span></code></dt>
|
|
580 | 557 |
<dd> |
581 | 558 |
<div class="desc"></div> |
582 | 559 |
<details class="source"> |
... | ... | |
601 | 578 |
return self.impl.get(state, dict_)</code></pre> |
602 | 579 |
</details> |
603 | 580 |
</dd> |
604 |
<dt id="sql_app.models.DeviceLicense.device_lic"><code class="name">var <span class="ident">device_lic</span></code></dt>
|
|
581 |
<dt id="sql_app.models.Device.inventory_number"><code class="name">var <span class="ident">inventory_number</span></code></dt>
|
|
605 | 582 |
<dd> |
606 | 583 |
<div class="desc"></div> |
607 | 584 |
<details class="source"> |
... | ... | |
626 | 603 |
return self.impl.get(state, dict_)</code></pre> |
627 | 604 |
</details> |
628 | 605 |
</dd> |
629 |
<dt id="sql_app.models.DeviceLicense.id"><code class="name">var <span class="ident">id</span></code></dt>
|
|
606 |
<dt id="sql_app.models.Device.licenses"><code class="name">var <span class="ident">licenses</span></code></dt>
|
|
630 | 607 |
<dd> |
631 | 608 |
<div class="desc"></div> |
632 | 609 |
<details class="source"> |
... | ... | |
651 | 628 |
return self.impl.get(state, dict_)</code></pre> |
652 | 629 |
</details> |
653 | 630 |
</dd> |
654 |
<dt id="sql_app.models.DeviceLicense.license_id"><code class="name">var <span class="ident">license_id</span></code></dt>
|
|
631 |
<dt id="sql_app.models.Device.logs"><code class="name">var <span class="ident">logs</span></code></dt>
|
|
655 | 632 |
<dd> |
656 | 633 |
<div class="desc"></div> |
657 | 634 |
<details class="source"> |
... | ... | |
676 | 653 |
return self.impl.get(state, dict_)</code></pre> |
677 | 654 |
</details> |
678 | 655 |
</dd> |
679 |
<dt id="sql_app.models.DeviceLicense.licenses"><code class="name">var <span class="ident">licenses</span></code></dt>
|
|
656 |
<dt id="sql_app.models.Device.product_id"><code class="name">var <span class="ident">product_id</span></code></dt>
|
|
680 | 657 |
<dd> |
681 | 658 |
<div class="desc"></div> |
682 | 659 |
<details class="source"> |
... | ... | |
701 | 678 |
return self.impl.get(state, dict_)</code></pre> |
702 | 679 |
</details> |
703 | 680 |
</dd> |
704 |
</dl> |
|
705 |
</dd> |
|
706 |
<dt id="sql_app.models.HeadDevice"><code class="flex name class"> |
|
707 |
<span>class <span class="ident">HeadDevice</span></span> |
|
708 |
<span>(</span><span>**kwargs)</span> |
|
709 |
</code></dt> |
|
681 |
<dt id="sql_app.models.Device.serial_number"><code class="name">var <span class="ident">serial_number</span></code></dt> |
|
710 | 682 |
<dd> |
711 |
<div class="desc"><p>Class defining database table head_devices</p> |
|
712 |
<p>A simple constructor that allows initialization from kwargs.</p> |
|
713 |
<p>Sets attributes on the constructed instance using the names and |
|
714 |
values in <code>kwargs</code>.</p> |
|
715 |
<p>Only keys that are present as |
|
716 |
attributes of the instance's class are allowed. These could be, |
|
717 |
for example, any mapped columns or relationships.</p></div> |
|
683 |
<div class="desc"></div> |
|
718 | 684 |
<details class="source"> |
719 | 685 |
<summary> |
720 | 686 |
<span>Expand source code</span> |
721 | 687 |
</summary> |
722 |
<pre><code class="python">class HeadDevice(Base): |
|
723 |
""" |
|
724 |
Class defining database table head_devices |
|
725 |
""" |
|
726 |
__tablename__ = "head_devices" |
|
727 |
|
|
728 |
id = Column(Integer, primary_key=True, index=True) |
|
729 |
serial_number = Column(String, index=True, nullable=False) |
|
688 |
<pre><code class="python">def __get__(self, instance, owner): |
|
689 |
if instance is None: |
|
690 |
return self |
|
730 | 691 |
|
731 |
# relationships for foreign keys, thus connecting table with ld_logs table |
|
732 |
h_logs = relationship("LDLog", back_populates="head_device")</code></pre> |
|
692 |
dict_ = instance_dict(instance) |
|
693 |
if self._supports_population and self.key in dict_: |
|
694 |
return dict_[self.key] |
|
695 |
else: |
|
696 |
try: |
|
697 |
state = instance_state(instance) |
|
698 |
except AttributeError as err: |
|
699 |
util.raise_( |
|
700 |
orm_exc.UnmappedInstanceError(instance), |
|
701 |
replace_context=err, |
|
702 |
) |
|
703 |
return self.impl.get(state, dict_)</code></pre> |
|
733 | 704 |
</details> |
734 |
<h3>Ancestors</h3> |
|
735 |
<ul class="hlist"> |
|
736 |
<li>sqlalchemy.orm.decl_api.Base</li> |
|
737 |
</ul> |
|
738 |
<h3>Instance variables</h3> |
|
739 |
<dl> |
|
740 |
<dt id="sql_app.models.HeadDevice.h_logs"><code class="name">var <span class="ident">h_logs</span></code></dt> |
|
705 |
</dd> |
|
706 |
<dt id="sql_app.models.Device.team"><code class="name">var <span class="ident">team</span></code></dt> |
|
741 | 707 |
<dd> |
742 | 708 |
<div class="desc"></div> |
743 | 709 |
<details class="source"> |
... | ... | |
762 | 728 |
return self.impl.get(state, dict_)</code></pre> |
763 | 729 |
</details> |
764 | 730 |
</dd> |
765 |
<dt id="sql_app.models.HeadDevice.id"><code class="name">var <span class="ident">id</span></code></dt>
|
|
731 |
<dt id="sql_app.models.Device.team_id"><code class="name">var <span class="ident">team_id</span></code></dt>
|
|
766 | 732 |
<dd> |
767 | 733 |
<div class="desc"></div> |
768 | 734 |
<details class="source"> |
... | ... | |
787 | 753 |
return self.impl.get(state, dict_)</code></pre> |
788 | 754 |
</details> |
789 | 755 |
</dd> |
790 |
<dt id="sql_app.models.HeadDevice.serial_number"><code class="name">var <span class="ident">serial_number</span></code></dt>
|
|
756 |
<dt id="sql_app.models.Device.vendor_id"><code class="name">var <span class="ident">vendor_id</span></code></dt>
|
|
791 | 757 |
<dd> |
792 | 758 |
<div class="desc"></div> |
793 | 759 |
<details class="source"> |
... | ... | |
814 | 780 |
</dd> |
815 | 781 |
</dl> |
816 | 782 |
</dd> |
817 |
<dt id="sql_app.models.LDLog"><code class="flex name class">
|
|
818 |
<span>class <span class="ident">LDLog</span></span>
|
|
783 |
<dt id="sql_app.models.DeviceLicense"><code class="flex name class">
|
|
784 |
<span>class <span class="ident">DeviceLicense</span></span>
|
|
819 | 785 |
<span>(</span><span>**kwargs)</span> |
820 | 786 |
</code></dt> |
821 | 787 |
<dd> |
822 |
<div class="desc"><p>Class defining database table ld_logs</p>
|
|
788 |
<div class="desc"><p>Class defining database table devices_licenses</p>
|
|
823 | 789 |
<p>A simple constructor that allows initialization from kwargs.</p> |
824 | 790 |
<p>Sets attributes on the constructed instance using the names and |
825 | 791 |
values in <code>kwargs</code>.</p> |
... | ... | |
830 | 796 |
<summary> |
831 | 797 |
<span>Expand source code</span> |
832 | 798 |
</summary> |
833 |
<pre><code class="python">class LDLog(Base):
|
|
799 |
<pre><code class="python">class DeviceLicense(Base):
|
|
834 | 800 |
""" |
835 |
Class defining database table ld_logs
|
|
801 |
Class defining database table devices_licenses
|
|
836 | 802 |
""" |
837 |
__tablename__ = "ld_logs"
|
|
803 |
__tablename__ = "devices_licenses"
|
|
838 | 804 |
|
839 | 805 |
id = Column(Integer, primary_key=True, index=True) |
840 |
pc_id = Column(Integer, ForeignKey("pc.id")) |
|
841 |
timestamp = Column(DateTime(timezone=True), server_default=func.now()) |
|
842 |
status = Column(String, index=True, nullable=False) |
|
843 |
head_id = Column(Integer, ForeignKey("head_devices.id")) |
|
844 |
body_id = Column(Integer, ForeignKey("body_devices.id")) |
|
806 |
device_id = Column(Integer, ForeignKey("devices.id")) |
|
807 |
license_id = Column(Integer, ForeignKey("licenses.id")) |
|
808 |
assigned_datetime = Column(String, index=True, nullable=False) |
|
845 | 809 |
|
846 |
# relationships for foreign keys, thus connecting table with pc, head_devices and body_devices
|
|
810 |
# relationships for foreign keys, thus connecting table with devices and licenses
|
|
847 | 811 |
# tables |
848 |
ldpc = relationship("PC", back_populates="ld_pc") |
|
849 |
head_device = relationship("HeadDevice", back_populates="h_logs") |
|
850 |
body_device = relationship("BodyDevice", back_populates="b_logs")</code></pre> |
|
812 |
device_lic = relationship("Device", back_populates="licenses") |
|
813 |
licenses = relationship("License", back_populates="devices")</code></pre> |
|
851 | 814 |
</details> |
852 | 815 |
<h3>Ancestors</h3> |
853 | 816 |
<ul class="hlist"> |
... | ... | |
855 | 818 |
</ul> |
856 | 819 |
<h3>Instance variables</h3> |
857 | 820 |
<dl> |
858 |
<dt id="sql_app.models.LDLog.body_device"><code class="name">var <span class="ident">body_device</span></code></dt>
|
|
821 |
<dt id="sql_app.models.DeviceLicense.assigned_datetime"><code class="name">var <span class="ident">assigned_datetime</span></code></dt>
|
|
859 | 822 |
<dd> |
860 | 823 |
<div class="desc"></div> |
861 | 824 |
<details class="source"> |
... | ... | |
880 | 843 |
return self.impl.get(state, dict_)</code></pre> |
881 | 844 |
</details> |
882 | 845 |
</dd> |
883 |
<dt id="sql_app.models.LDLog.body_id"><code class="name">var <span class="ident">body_id</span></code></dt>
|
|
846 |
<dt id="sql_app.models.DeviceLicense.device_id"><code class="name">var <span class="ident">device_id</span></code></dt>
|
|
884 | 847 |
<dd> |
885 | 848 |
<div class="desc"></div> |
886 | 849 |
<details class="source"> |
... | ... | |
905 | 868 |
return self.impl.get(state, dict_)</code></pre> |
906 | 869 |
</details> |
907 | 870 |
</dd> |
908 |
<dt id="sql_app.models.LDLog.head_device"><code class="name">var <span class="ident">head_device</span></code></dt>
|
|
871 |
<dt id="sql_app.models.DeviceLicense.device_lic"><code class="name">var <span class="ident">device_lic</span></code></dt>
|
|
909 | 872 |
<dd> |
910 | 873 |
<div class="desc"></div> |
911 | 874 |
<details class="source"> |
... | ... | |
930 | 893 |
return self.impl.get(state, dict_)</code></pre> |
931 | 894 |
</details> |
932 | 895 |
</dd> |
933 |
<dt id="sql_app.models.LDLog.head_id"><code class="name">var <span class="ident">head_id</span></code></dt>
|
|
896 |
<dt id="sql_app.models.DeviceLicense.id"><code class="name">var <span class="ident">id</span></code></dt>
|
|
934 | 897 |
<dd> |
935 | 898 |
<div class="desc"></div> |
936 | 899 |
<details class="source"> |
... | ... | |
955 | 918 |
return self.impl.get(state, dict_)</code></pre> |
956 | 919 |
</details> |
957 | 920 |
</dd> |
958 |
<dt id="sql_app.models.LDLog.id"><code class="name">var <span class="ident">id</span></code></dt>
|
|
921 |
<dt id="sql_app.models.DeviceLicense.license_id"><code class="name">var <span class="ident">license_id</span></code></dt>
|
|
959 | 922 |
<dd> |
960 | 923 |
<div class="desc"></div> |
961 | 924 |
<details class="source"> |
... | ... | |
980 | 943 |
return self.impl.get(state, dict_)</code></pre> |
981 | 944 |
</details> |
982 | 945 |
</dd> |
983 |
<dt id="sql_app.models.LDLog.ldpc"><code class="name">var <span class="ident">ldpc</span></code></dt>
|
|
946 |
<dt id="sql_app.models.DeviceLicense.licenses"><code class="name">var <span class="ident">licenses</span></code></dt>
|
|
984 | 947 |
<dd> |
985 | 948 |
<div class="desc"></div> |
986 | 949 |
<details class="source"> |
... | ... | |
1005 | 968 |
return self.impl.get(state, dict_)</code></pre> |
1006 | 969 |
</details> |
1007 | 970 |
</dd> |
1008 |
<dt id="sql_app.models.LDLog.pc_id"><code class="name">var <span class="ident">pc_id</span></code></dt> |
|
971 |
</dl> |
|
972 |
</dd> |
|
973 |
<dt id="sql_app.models.HeadDevice"><code class="flex name class"> |
|
974 |
<span>class <span class="ident">HeadDevice</span></span> |
|
975 |
<span>(</span><span>**kwargs)</span> |
|
976 |
</code></dt> |
|
1009 | 977 |
<dd> |
1010 |
<div class="desc"></div> |
|
978 |
<div class="desc"><p>Class defining database table head_devices</p> |
|
979 |
<p>A simple constructor that allows initialization from kwargs.</p> |
|
980 |
<p>Sets attributes on the constructed instance using the names and |
|
981 |
values in <code>kwargs</code>.</p> |
|
982 |
<p>Only keys that are present as |
|
983 |
attributes of the instance's class are allowed. These could be, |
|
984 |
for example, any mapped columns or relationships.</p></div> |
|
1011 | 985 |
<details class="source"> |
1012 | 986 |
<summary> |
1013 | 987 |
<span>Expand source code</span> |
1014 | 988 |
</summary> |
1015 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1016 |
if instance is None: |
|
1017 |
return self |
|
989 |
<pre><code class="python">class HeadDevice(Base): |
|
990 |
""" |
|
991 |
Class defining database table head_devices |
|
992 |
""" |
|
993 |
__tablename__ = "head_devices" |
|
1018 | 994 |
|
1019 |
dict_ = instance_dict(instance) |
|
1020 |
if self._supports_population and self.key in dict_: |
|
1021 |
return dict_[self.key] |
|
1022 |
else: |
|
1023 |
try: |
|
1024 |
state = instance_state(instance) |
|
1025 |
except AttributeError as err: |
|
1026 |
util.raise_( |
|
1027 |
orm_exc.UnmappedInstanceError(instance), |
|
1028 |
replace_context=err, |
|
1029 |
) |
|
1030 |
return self.impl.get(state, dict_)</code></pre> |
|
1031 |
</details> |
|
995 |
id = Column(Integer, primary_key=True, index=True) |
|
996 |
serial_number = Column(String, index=True, nullable=False) |
|
997 |
inventory_number = Column(String, index=True, nullable=True) |
|
998 |
comment = Column(String, index=True, nullable=True) |
|
999 |
|
|
1000 |
team_id = Column(Integer, ForeignKey("teams.id")) |
|
1001 |
license_id = Column(Integer, ForeignKey("licenses.id")) |
|
1002 |
|
|
1003 |
# relationships for foreign keys, thus connecting table with ld_logs table |
|
1004 |
h_logs = relationship("LDLog", back_populates="head_device") |
|
1005 |
license = relationship("License", back_populates="headdevice_lic") |
|
1006 |
team = relationship("Team", back_populates="head_devices")</code></pre> |
|
1007 |
</details> |
|
1008 |
<h3>Ancestors</h3> |
|
1009 |
<ul class="hlist"> |
|
1010 |
<li>sqlalchemy.orm.decl_api.Base</li> |
|
1011 |
</ul> |
|
1012 |
<h3>Instance variables</h3> |
|
1013 |
<dl> |
|
1014 |
<dt id="sql_app.models.HeadDevice.comment"><code class="name">var <span class="ident">comment</span></code></dt> |
|
1015 |
<dd> |
|
1016 |
<div class="desc"></div> |
|
1017 |
<details class="source"> |
|
1018 |
<summary> |
|
1019 |
<span>Expand source code</span> |
|
1020 |
</summary> |
|
1021 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1022 |
if instance is None: |
|
1023 |
return self |
|
1024 |
|
|
1025 |
dict_ = instance_dict(instance) |
|
1026 |
if self._supports_population and self.key in dict_: |
|
1027 |
return dict_[self.key] |
|
1028 |
else: |
|
1029 |
try: |
|
1030 |
state = instance_state(instance) |
|
1031 |
except AttributeError as err: |
|
1032 |
util.raise_( |
|
1033 |
orm_exc.UnmappedInstanceError(instance), |
|
1034 |
replace_context=err, |
|
1035 |
) |
|
1036 |
return self.impl.get(state, dict_)</code></pre> |
|
1037 |
</details> |
|
1038 |
</dd> |
|
1039 |
<dt id="sql_app.models.HeadDevice.h_logs"><code class="name">var <span class="ident">h_logs</span></code></dt> |
|
1040 |
<dd> |
|
1041 |
<div class="desc"></div> |
|
1042 |
<details class="source"> |
|
1043 |
<summary> |
|
1044 |
<span>Expand source code</span> |
|
1045 |
</summary> |
|
1046 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1047 |
if instance is None: |
|
1048 |
return self |
|
1049 |
|
|
1050 |
dict_ = instance_dict(instance) |
|
1051 |
if self._supports_population and self.key in dict_: |
|
1052 |
return dict_[self.key] |
|
1053 |
else: |
|
1054 |
try: |
|
1055 |
state = instance_state(instance) |
|
1056 |
except AttributeError as err: |
|
1057 |
util.raise_( |
|
1058 |
orm_exc.UnmappedInstanceError(instance), |
|
1059 |
replace_context=err, |
|
1060 |
) |
|
1061 |
return self.impl.get(state, dict_)</code></pre> |
|
1062 |
</details> |
|
1063 |
</dd> |
|
1064 |
<dt id="sql_app.models.HeadDevice.id"><code class="name">var <span class="ident">id</span></code></dt> |
|
1065 |
<dd> |
|
1066 |
<div class="desc"></div> |
|
1067 |
<details class="source"> |
|
1068 |
<summary> |
|
1069 |
<span>Expand source code</span> |
|
1070 |
</summary> |
|
1071 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1072 |
if instance is None: |
|
1073 |
return self |
|
1074 |
|
|
1075 |
dict_ = instance_dict(instance) |
|
1076 |
if self._supports_population and self.key in dict_: |
|
1077 |
return dict_[self.key] |
|
1078 |
else: |
|
1079 |
try: |
|
1080 |
state = instance_state(instance) |
|
1081 |
except AttributeError as err: |
|
1082 |
util.raise_( |
|
1083 |
orm_exc.UnmappedInstanceError(instance), |
|
1084 |
replace_context=err, |
|
1085 |
) |
|
1086 |
return self.impl.get(state, dict_)</code></pre> |
|
1087 |
</details> |
|
1088 |
</dd> |
|
1089 |
<dt id="sql_app.models.HeadDevice.inventory_number"><code class="name">var <span class="ident">inventory_number</span></code></dt> |
|
1090 |
<dd> |
|
1091 |
<div class="desc"></div> |
|
1092 |
<details class="source"> |
|
1093 |
<summary> |
|
1094 |
<span>Expand source code</span> |
|
1095 |
</summary> |
|
1096 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1097 |
if instance is None: |
|
1098 |
return self |
|
1099 |
|
|
1100 |
dict_ = instance_dict(instance) |
|
1101 |
if self._supports_population and self.key in dict_: |
|
1102 |
return dict_[self.key] |
|
1103 |
else: |
|
1104 |
try: |
|
1105 |
state = instance_state(instance) |
|
1106 |
except AttributeError as err: |
|
1107 |
util.raise_( |
|
1108 |
orm_exc.UnmappedInstanceError(instance), |
|
1109 |
replace_context=err, |
|
1110 |
) |
|
1111 |
return self.impl.get(state, dict_)</code></pre> |
|
1112 |
</details> |
|
1113 |
</dd> |
|
1114 |
<dt id="sql_app.models.HeadDevice.license"><code class="name">var <span class="ident">license</span></code></dt> |
|
1115 |
<dd> |
|
1116 |
<div class="desc"></div> |
|
1117 |
<details class="source"> |
|
1118 |
<summary> |
|
1119 |
<span>Expand source code</span> |
|
1120 |
</summary> |
|
1121 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1122 |
if instance is None: |
|
1123 |
return self |
|
1124 |
|
|
1125 |
dict_ = instance_dict(instance) |
|
1126 |
if self._supports_population and self.key in dict_: |
|
1127 |
return dict_[self.key] |
|
1128 |
else: |
|
1129 |
try: |
|
1130 |
state = instance_state(instance) |
|
1131 |
except AttributeError as err: |
|
1132 |
util.raise_( |
|
1133 |
orm_exc.UnmappedInstanceError(instance), |
|
1134 |
replace_context=err, |
|
1135 |
) |
|
1136 |
return self.impl.get(state, dict_)</code></pre> |
|
1137 |
</details> |
|
1138 |
</dd> |
|
1139 |
<dt id="sql_app.models.HeadDevice.license_id"><code class="name">var <span class="ident">license_id</span></code></dt> |
|
1140 |
<dd> |
|
1141 |
<div class="desc"></div> |
|
1142 |
<details class="source"> |
|
1143 |
<summary> |
|
1144 |
<span>Expand source code</span> |
|
1145 |
</summary> |
|
1146 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1147 |
if instance is None: |
|
1148 |
return self |
|
1149 |
|
|
1150 |
dict_ = instance_dict(instance) |
|
1151 |
if self._supports_population and self.key in dict_: |
|
1152 |
return dict_[self.key] |
|
1153 |
else: |
|
1154 |
try: |
|
1155 |
state = instance_state(instance) |
|
1156 |
except AttributeError as err: |
|
1157 |
util.raise_( |
|
1158 |
orm_exc.UnmappedInstanceError(instance), |
|
1159 |
replace_context=err, |
|
1160 |
) |
|
1161 |
return self.impl.get(state, dict_)</code></pre> |
|
1162 |
</details> |
|
1163 |
</dd> |
|
1164 |
<dt id="sql_app.models.HeadDevice.serial_number"><code class="name">var <span class="ident">serial_number</span></code></dt> |
|
1165 |
<dd> |
|
1166 |
<div class="desc"></div> |
|
1167 |
<details class="source"> |
|
1168 |
<summary> |
|
1169 |
<span>Expand source code</span> |
|
1170 |
</summary> |
|
1171 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1172 |
if instance is None: |
|
1173 |
return self |
|
1174 |
|
|
1175 |
dict_ = instance_dict(instance) |
|
1176 |
if self._supports_population and self.key in dict_: |
|
1177 |
return dict_[self.key] |
|
1178 |
else: |
|
1179 |
try: |
|
1180 |
state = instance_state(instance) |
|
1181 |
except AttributeError as err: |
|
1182 |
util.raise_( |
|
1183 |
orm_exc.UnmappedInstanceError(instance), |
|
1184 |
replace_context=err, |
|
1185 |
) |
|
1186 |
return self.impl.get(state, dict_)</code></pre> |
|
1187 |
</details> |
|
1188 |
</dd> |
|
1189 |
<dt id="sql_app.models.HeadDevice.team"><code class="name">var <span class="ident">team</span></code></dt> |
|
1190 |
<dd> |
|
1191 |
<div class="desc"></div> |
|
1192 |
<details class="source"> |
|
1193 |
<summary> |
|
1194 |
<span>Expand source code</span> |
|
1195 |
</summary> |
|
1196 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1197 |
if instance is None: |
|
1198 |
return self |
|
1199 |
|
|
1200 |
dict_ = instance_dict(instance) |
|
1201 |
if self._supports_population and self.key in dict_: |
|
1202 |
return dict_[self.key] |
|
1203 |
else: |
|
1204 |
try: |
|
1205 |
state = instance_state(instance) |
|
1206 |
except AttributeError as err: |
|
1207 |
util.raise_( |
|
1208 |
orm_exc.UnmappedInstanceError(instance), |
|
1209 |
replace_context=err, |
|
1210 |
) |
|
1211 |
return self.impl.get(state, dict_)</code></pre> |
|
1212 |
</details> |
|
1213 |
</dd> |
|
1214 |
<dt id="sql_app.models.HeadDevice.team_id"><code class="name">var <span class="ident">team_id</span></code></dt> |
|
1215 |
<dd> |
|
1216 |
<div class="desc"></div> |
|
1217 |
<details class="source"> |
|
1218 |
<summary> |
|
1219 |
<span>Expand source code</span> |
|
1220 |
</summary> |
|
1221 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1222 |
if instance is None: |
|
1223 |
return self |
|
1224 |
|
|
1225 |
dict_ = instance_dict(instance) |
|
1226 |
if self._supports_population and self.key in dict_: |
|
1227 |
return dict_[self.key] |
|
1228 |
else: |
|
1229 |
try: |
|
1230 |
state = instance_state(instance) |
|
1231 |
except AttributeError as err: |
|
1232 |
util.raise_( |
|
1233 |
orm_exc.UnmappedInstanceError(instance), |
|
1234 |
replace_context=err, |
|
1235 |
) |
|
1236 |
return self.impl.get(state, dict_)</code></pre> |
|
1237 |
</details> |
|
1238 |
</dd> |
|
1239 |
</dl> |
|
1240 |
</dd> |
|
1241 |
<dt id="sql_app.models.LDLog"><code class="flex name class"> |
|
1242 |
<span>class <span class="ident">LDLog</span></span> |
|
1243 |
<span>(</span><span>**kwargs)</span> |
|
1244 |
</code></dt> |
|
1245 |
<dd> |
|
1246 |
<div class="desc"><p>Class defining database table ld_logs</p> |
|
1247 |
<p>A simple constructor that allows initialization from kwargs.</p> |
|
1248 |
<p>Sets attributes on the constructed instance using the names and |
|
1249 |
values in <code>kwargs</code>.</p> |
|
1250 |
<p>Only keys that are present as |
|
1251 |
attributes of the instance's class are allowed. These could be, |
|
1252 |
for example, any mapped columns or relationships.</p></div> |
|
1253 |
<details class="source"> |
|
1254 |
<summary> |
|
1255 |
<span>Expand source code</span> |
|
1256 |
</summary> |
|
1257 |
<pre><code class="python">class LDLog(Base): |
|
1258 |
""" |
|
1259 |
Class defining database table ld_logs |
|
1260 |
""" |
|
1261 |
__tablename__ = "ld_logs" |
|
1262 |
|
|
1263 |
id = Column(Integer, primary_key=True, index=True) |
|
1264 |
pc_id = Column(Integer, ForeignKey("pc.id")) |
|
1265 |
timestamp = Column(DateTime(timezone=True), server_default=func.now()) |
|
1266 |
status = Column(String, index=True, nullable=False) |
|
1267 |
head_id = Column(Integer, ForeignKey("head_devices.id")) |
|
1268 |
body_id = Column(Integer, ForeignKey("body_devices.id")) |
|
1269 |
|
|
1270 |
# relationships for foreign keys, thus connecting table with pc, head_devices and body_devices |
|
1271 |
# tables |
|
1272 |
ldpc = relationship("PC", back_populates="ld_pc") |
|
1273 |
head_device = relationship("HeadDevice", back_populates="h_logs") |
|
1274 |
body_device = relationship("BodyDevice", back_populates="b_logs")</code></pre> |
|
1275 |
</details> |
|
1276 |
<h3>Ancestors</h3> |
|
1277 |
<ul class="hlist"> |
|
1278 |
<li>sqlalchemy.orm.decl_api.Base</li> |
|
1279 |
</ul> |
|
1280 |
<h3>Instance variables</h3> |
|
1281 |
<dl> |
|
1282 |
<dt id="sql_app.models.LDLog.body_device"><code class="name">var <span class="ident">body_device</span></code></dt> |
|
1283 |
<dd> |
|
1284 |
<div class="desc"></div> |
|
1285 |
<details class="source"> |
|
1286 |
<summary> |
|
1287 |
<span>Expand source code</span> |
|
1288 |
</summary> |
|
1289 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1290 |
if instance is None: |
|
1291 |
return self |
|
1292 |
|
|
1293 |
dict_ = instance_dict(instance) |
|
1294 |
if self._supports_population and self.key in dict_: |
|
1295 |
return dict_[self.key] |
|
1296 |
else: |
|
1297 |
try: |
|
1298 |
state = instance_state(instance) |
|
1299 |
except AttributeError as err: |
|
1300 |
util.raise_( |
|
1301 |
orm_exc.UnmappedInstanceError(instance), |
|
1302 |
replace_context=err, |
|
1303 |
) |
|
1304 |
return self.impl.get(state, dict_)</code></pre> |
|
1305 |
</details> |
|
1306 |
</dd> |
|
1307 |
<dt id="sql_app.models.LDLog.body_id"><code class="name">var <span class="ident">body_id</span></code></dt> |
|
1308 |
<dd> |
|
1309 |
<div class="desc"></div> |
|
1310 |
<details class="source"> |
|
1311 |
<summary> |
|
1312 |
<span>Expand source code</span> |
|
1313 |
</summary> |
|
1314 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1315 |
if instance is None: |
|
1316 |
return self |
|
1317 |
|
|
1318 |
dict_ = instance_dict(instance) |
|
1319 |
if self._supports_population and self.key in dict_: |
|
1320 |
return dict_[self.key] |
|
1321 |
else: |
|
1322 |
try: |
|
1323 |
state = instance_state(instance) |
|
1324 |
except AttributeError as err: |
|
1325 |
util.raise_( |
|
1326 |
orm_exc.UnmappedInstanceError(instance), |
|
1327 |
replace_context=err, |
|
1328 |
) |
|
1329 |
return self.impl.get(state, dict_)</code></pre> |
|
1330 |
</details> |
|
1331 |
</dd> |
|
1332 |
<dt id="sql_app.models.LDLog.head_device"><code class="name">var <span class="ident">head_device</span></code></dt> |
|
1333 |
<dd> |
|
1334 |
<div class="desc"></div> |
|
1335 |
<details class="source"> |
|
1336 |
<summary> |
|
1337 |
<span>Expand source code</span> |
|
1338 |
</summary> |
|
1339 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1340 |
if instance is None: |
|
1341 |
return self |
|
1342 |
|
|
1343 |
dict_ = instance_dict(instance) |
|
1344 |
if self._supports_population and self.key in dict_: |
|
1345 |
return dict_[self.key] |
|
1346 |
else: |
|
1347 |
try: |
|
1348 |
state = instance_state(instance) |
|
1349 |
except AttributeError as err: |
|
1350 |
util.raise_( |
|
1351 |
orm_exc.UnmappedInstanceError(instance), |
|
1352 |
replace_context=err, |
|
1353 |
) |
|
1354 |
return self.impl.get(state, dict_)</code></pre> |
|
1355 |
</details> |
|
1356 |
</dd> |
|
1357 |
<dt id="sql_app.models.LDLog.head_id"><code class="name">var <span class="ident">head_id</span></code></dt> |
|
1358 |
<dd> |
|
1359 |
<div class="desc"></div> |
|
1360 |
<details class="source"> |
|
1361 |
<summary> |
|
1362 |
<span>Expand source code</span> |
|
1363 |
</summary> |
|
1364 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1365 |
if instance is None: |
|
1366 |
return self |
|
1367 |
|
|
1368 |
dict_ = instance_dict(instance) |
|
1369 |
if self._supports_population and self.key in dict_: |
|
1370 |
return dict_[self.key] |
|
1371 |
else: |
|
1372 |
try: |
|
1373 |
state = instance_state(instance) |
|
1374 |
except AttributeError as err: |
|
1375 |
util.raise_( |
|
1376 |
orm_exc.UnmappedInstanceError(instance), |
|
1377 |
replace_context=err, |
|
1378 |
) |
|
1379 |
return self.impl.get(state, dict_)</code></pre> |
|
1380 |
</details> |
|
1381 |
</dd> |
|
1382 |
<dt id="sql_app.models.LDLog.id"><code class="name">var <span class="ident">id</span></code></dt> |
|
1383 |
<dd> |
|
1384 |
<div class="desc"></div> |
|
1385 |
<details class="source"> |
|
1386 |
<summary> |
|
1387 |
<span>Expand source code</span> |
|
1388 |
</summary> |
|
1389 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1390 |
if instance is None: |
|
1391 |
return self |
|
1392 |
|
|
1393 |
dict_ = instance_dict(instance) |
|
1394 |
if self._supports_population and self.key in dict_: |
|
1395 |
return dict_[self.key] |
|
1396 |
else: |
|
1397 |
try: |
|
1398 |
state = instance_state(instance) |
|
1399 |
except AttributeError as err: |
|
1400 |
util.raise_( |
|
1401 |
orm_exc.UnmappedInstanceError(instance), |
|
1402 |
replace_context=err, |
|
1403 |
) |
|
1404 |
return self.impl.get(state, dict_)</code></pre> |
|
1405 |
</details> |
|
1406 |
</dd> |
|
1407 |
<dt id="sql_app.models.LDLog.ldpc"><code class="name">var <span class="ident">ldpc</span></code></dt> |
|
1408 |
<dd> |
|
1409 |
<div class="desc"></div> |
|
1410 |
<details class="source"> |
|
1411 |
<summary> |
|
1412 |
<span>Expand source code</span> |
|
1413 |
</summary> |
|
1414 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1415 |
if instance is None: |
|
1416 |
return self |
|
1417 |
|
|
1418 |
dict_ = instance_dict(instance) |
|
1419 |
if self._supports_population and self.key in dict_: |
|
1420 |
return dict_[self.key] |
|
1421 |
else: |
|
1422 |
try: |
|
1423 |
state = instance_state(instance) |
|
1424 |
except AttributeError as err: |
|
1425 |
util.raise_( |
|
1426 |
orm_exc.UnmappedInstanceError(instance), |
|
1427 |
replace_context=err, |
|
1428 |
) |
|
1429 |
return self.impl.get(state, dict_)</code></pre> |
|
1430 |
</details> |
|
1431 |
</dd> |
|
1432 |
<dt id="sql_app.models.LDLog.pc_id"><code class="name">var <span class="ident">pc_id</span></code></dt> |
|
1433 |
<dd> |
|
1434 |
<div class="desc"></div> |
|
1435 |
<details class="source"> |
|
1436 |
<summary> |
|
1437 |
<span>Expand source code</span> |
|
1438 |
</summary> |
|
1439 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1440 |
if instance is None: |
|
1441 |
return self |
|
1442 |
|
|
1443 |
dict_ = instance_dict(instance) |
|
1444 |
if self._supports_population and self.key in dict_: |
|
1445 |
return dict_[self.key] |
|
1446 |
else: |
|
1447 |
try: |
|
1448 |
state = instance_state(instance) |
|
1449 |
except AttributeError as err: |
|
1450 |
util.raise_( |
|
1451 |
orm_exc.UnmappedInstanceError(instance), |
|
1452 |
replace_context=err, |
|
1453 |
) |
|
1454 |
return self.impl.get(state, dict_)</code></pre> |
|
1455 |
</details> |
|
1032 | 1456 |
</dd> |
1033 | 1457 |
<dt id="sql_app.models.LDLog.status"><code class="name">var <span class="ident">status</span></code></dt> |
1034 | 1458 |
<dd> |
... | ... | |
1105 | 1529 |
__tablename__ = "licenses" |
1106 | 1530 |
|
1107 | 1531 |
id = Column(Integer, primary_key=True, index=True) |
1108 |
name = Column(String, index=True, nullable=False) |
|
1109 |
expiration_date = Column(DateTime(timezone=True), server_default=func.now()) |
|
1532 |
name = Column(String, index=True, nullable=True) |
|
1533 |
license_id = Column(String, index=True, nullable=False) |
|
1534 |
expiration_date = Column(DateTime(timezone=True), nullable=True) |
|
1110 | 1535 |
|
1111 | 1536 |
# relationships for foreign keys, thus connecting table with devices table |
1112 |
devices = relationship("DeviceLicense", back_populates="licenses")</code></pre> |
|
1537 |
devices = relationship("DeviceLicense", back_populates="licenses") |
|
1538 |
bodydevice_lic = relationship("BodyDevice", back_populates="license") |
|
1539 |
headdevice_lic = relationship("HeadDevice", back_populates="license")</code></pre> |
|
1540 |
</details> |
|
1541 |
<h3>Ancestors</h3> |
|
1542 |
<ul class="hlist"> |
|
1543 |
<li>sqlalchemy.orm.decl_api.Base</li> |
|
1544 |
</ul> |
|
1545 |
<h3>Instance variables</h3> |
|
1546 |
<dl> |
|
1547 |
<dt id="sql_app.models.License.bodydevice_lic"><code class="name">var <span class="ident">bodydevice_lic</span></code></dt> |
|
1548 |
<dd> |
|
1549 |
<div class="desc"></div> |
|
1550 |
<details class="source"> |
|
1551 |
<summary> |
|
1552 |
<span>Expand source code</span> |
|
1553 |
</summary> |
|
1554 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1555 |
if instance is None: |
|
1556 |
return self |
|
1557 |
|
|
1558 |
dict_ = instance_dict(instance) |
|
1559 |
if self._supports_population and self.key in dict_: |
|
1560 |
return dict_[self.key] |
|
1561 |
else: |
|
1562 |
try: |
|
1563 |
state = instance_state(instance) |
|
1564 |
except AttributeError as err: |
|
1565 |
util.raise_( |
|
1566 |
orm_exc.UnmappedInstanceError(instance), |
|
1567 |
replace_context=err, |
|
1568 |
) |
|
1569 |
return self.impl.get(state, dict_)</code></pre> |
|
1570 |
</details> |
|
1571 |
</dd> |
|
1572 |
<dt id="sql_app.models.License.devices"><code class="name">var <span class="ident">devices</span></code></dt> |
|
1573 |
<dd> |
|
1574 |
<div class="desc"></div> |
|
1575 |
<details class="source"> |
|
1576 |
<summary> |
|
1577 |
<span>Expand source code</span> |
|
1578 |
</summary> |
|
1579 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1580 |
if instance is None: |
|
1581 |
return self |
|
1582 |
|
|
1583 |
dict_ = instance_dict(instance) |
|
1584 |
if self._supports_population and self.key in dict_: |
|
1585 |
return dict_[self.key] |
|
1586 |
else: |
|
1587 |
try: |
|
1588 |
state = instance_state(instance) |
|
1589 |
except AttributeError as err: |
|
1590 |
util.raise_( |
|
1591 |
orm_exc.UnmappedInstanceError(instance), |
|
1592 |
replace_context=err, |
|
1593 |
) |
|
1594 |
return self.impl.get(state, dict_)</code></pre> |
|
1113 | 1595 |
</details> |
1114 |
<h3>Ancestors</h3> |
|
1115 |
<ul class="hlist"> |
|
1116 |
<li>sqlalchemy.orm.decl_api.Base</li> |
|
1117 |
</ul> |
|
1118 |
<h3>Instance variables</h3> |
|
1119 |
<dl> |
|
1120 |
<dt id="sql_app.models.License.devices"><code class="name">var <span class="ident">devices</span></code></dt> |
|
1596 |
</dd> |
|
1597 |
<dt id="sql_app.models.License.expiration_date"><code class="name">var <span class="ident">expiration_date</span></code></dt> |
|
1121 | 1598 |
<dd> |
1122 | 1599 |
<div class="desc"></div> |
1123 | 1600 |
<details class="source"> |
... | ... | |
1142 | 1619 |
return self.impl.get(state, dict_)</code></pre> |
1143 | 1620 |
</details> |
1144 | 1621 |
</dd> |
1145 |
<dt id="sql_app.models.License.expiration_date"><code class="name">var <span class="ident">expiration_date</span></code></dt>
|
|
1622 |
<dt id="sql_app.models.License.headdevice_lic"><code class="name">var <span class="ident">headdevice_lic</span></code></dt>
|
|
1146 | 1623 |
<dd> |
1147 | 1624 |
<div class="desc"></div> |
1148 | 1625 |
<details class="source"> |
... | ... | |
1192 | 1669 |
return self.impl.get(state, dict_)</code></pre> |
1193 | 1670 |
</details> |
1194 | 1671 |
</dd> |
1672 |
<dt id="sql_app.models.License.license_id"><code class="name">var <span class="ident">license_id</span></code></dt> |
|
1673 |
<dd> |
|
1674 |
<div class="desc"></div> |
|
1675 |
<details class="source"> |
|
1676 |
<summary> |
|
1677 |
<span>Expand source code</span> |
|
1678 |
</summary> |
|
1679 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1680 |
if instance is None: |
|
1681 |
return self |
|
1682 |
|
|
1683 |
dict_ = instance_dict(instance) |
|
1684 |
if self._supports_population and self.key in dict_: |
|
1685 |
return dict_[self.key] |
|
1686 |
else: |
|
1687 |
try: |
|
1688 |
state = instance_state(instance) |
|
1689 |
except AttributeError as err: |
|
1690 |
util.raise_( |
|
1691 |
orm_exc.UnmappedInstanceError(instance), |
|
1692 |
replace_context=err, |
|
1693 |
) |
|
1694 |
return self.impl.get(state, dict_)</code></pre> |
|
1695 |
</details> |
|
1696 |
</dd> |
|
1195 | 1697 |
<dt id="sql_app.models.License.name"><code class="name">var <span class="ident">name</span></code></dt> |
1196 | 1698 |
<dd> |
1197 | 1699 |
<div class="desc"></div> |
... | ... | |
1244 | 1746 |
id = Column(Integer, primary_key=True, index=True) |
1245 | 1747 |
username = Column(String, index=True, nullable=False) |
1246 | 1748 |
hostname = Column(String, index=True, nullable=False) |
1247 |
assigned = Column(Boolean, index=True, nullable=False) |
|
1248 |
team_id = Column(Integer, ForeignKey("teams.id")) |
|
1249 | 1749 |
|
1250 | 1750 |
# relationships for foreign keys, thus connecting table with teams, usb_logs and ld_logs |
1251 | 1751 |
# tables |
1252 |
team = relationship("Team", back_populates="pcs") |
|
1253 | 1752 |
logs_pc = relationship("USBLog", back_populates="pc") |
1254 | 1753 |
ld_pc = relationship("LDLog", back_populates="ldpc")</code></pre> |
1255 | 1754 |
</details> |
... | ... | |
1259 | 1758 |
</ul> |
1260 | 1759 |
<h3>Instance variables</h3> |
1261 | 1760 |
<dl> |
1262 |
<dt id="sql_app.models.PC.assigned"><code class="name">var <span class="ident">assigned</span></code></dt>
|
|
1761 |
<dt id="sql_app.models.PC.hostname"><code class="name">var <span class="ident">hostname</span></code></dt>
|
|
1263 | 1762 |
<dd> |
1264 | 1763 |
<div class="desc"></div> |
1265 | 1764 |
<details class="source"> |
... | ... | |
1284 | 1783 |
return self.impl.get(state, dict_)</code></pre> |
1285 | 1784 |
</details> |
1286 | 1785 |
</dd> |
1287 |
<dt id="sql_app.models.PC.hostname"><code class="name">var <span class="ident">hostname</span></code></dt>
|
|
1786 |
<dt id="sql_app.models.PC.id"><code class="name">var <span class="ident">id</span></code></dt>
|
|
1288 | 1787 |
<dd> |
1289 | 1788 |
<div class="desc"></div> |
1290 | 1789 |
<details class="source"> |
... | ... | |
1309 | 1808 |
return self.impl.get(state, dict_)</code></pre> |
1310 | 1809 |
</details> |
1311 | 1810 |
</dd> |
1312 |
<dt id="sql_app.models.PC.id"><code class="name">var <span class="ident">id</span></code></dt>
|
|
1811 |
<dt id="sql_app.models.PC.ld_pc"><code class="name">var <span class="ident">ld_pc</span></code></dt>
|
|
1313 | 1812 |
<dd> |
1314 | 1813 |
<div class="desc"></div> |
1315 | 1814 |
<details class="source"> |
... | ... | |
1334 | 1833 |
return self.impl.get(state, dict_)</code></pre> |
1335 | 1834 |
</details> |
1336 | 1835 |
</dd> |
1337 |
<dt id="sql_app.models.PC.ld_pc"><code class="name">var <span class="ident">ld_pc</span></code></dt>
|
|
1836 |
<dt id="sql_app.models.PC.logs_pc"><code class="name">var <span class="ident">logs_pc</span></code></dt>
|
|
1338 | 1837 |
<dd> |
1339 | 1838 |
<div class="desc"></div> |
1340 | 1839 |
<details class="source"> |
... | ... | |
1359 | 1858 |
return self.impl.get(state, dict_)</code></pre> |
1360 | 1859 |
</details> |
1361 | 1860 |
</dd> |
1362 |
<dt id="sql_app.models.PC.logs_pc"><code class="name">var <span class="ident">logs_pc</span></code></dt> |
|
1861 |
<dt id="sql_app.models.PC.username"><code class="name">var <span class="ident">username</span></code></dt> |
|
1862 |
<dd> |
|
1863 |
<div class="desc"></div> |
|
1864 |
<details class="source"> |
|
1865 |
<summary> |
|
1866 |
<span>Expand source code</span> |
|
1867 |
</summary> |
|
1868 |
<pre><code class="python">def __get__(self, instance, owner): |
|
1869 |
if instance is None: |
|
1870 |
return self |
|
1871 |
|
|
1872 |
dict_ = instance_dict(instance) |
|
1873 |
if self._supports_population and self.key in dict_: |
|
1874 |
return dict_[self.key] |
|
1875 |
else: |
|
1876 |
try: |
|
1877 |
state = instance_state(instance) |
|
1878 |
except AttributeError as err: |
|
1879 |
util.raise_( |
|
1880 |
orm_exc.UnmappedInstanceError(instance), |
|
1881 |
replace_context=err, |
|
1882 |
) |
|
1883 |
return self.impl.get(state, dict_)</code></pre> |
|
1884 |
</details> |
|
1885 |
</dd> |
|
1886 |
</dl> |
|
1887 |
</dd> |
|
1888 |
<dt id="sql_app.models.Team"><code class="flex name class"> |
|
1889 |
<span>class <span class="ident">Team</span></span> |
|
1890 |
<span>(</span><span>**kwargs)</span> |
|
1891 |
</code></dt> |
|
1892 |
<dd> |
|
1893 |
<div class="desc"><p>Class defining database table teams</p> |
|
1894 |
<p>A simple constructor that allows initialization from kwargs.</p> |
|
1895 |
<p>Sets attributes on the constructed instance using the names and |
|
1896 |
values in <code>kwargs</code>.</p> |
|
1897 |
<p>Only keys that are present as |
|
1898 |
attributes of the instance's class are allowed. These could be, |
|
1899 |
for example, any mapped columns or relationships.</p></div> |
|
1900 |
<details class="source"> |
|
1901 |
<summary> |
|
1902 |
<span>Expand source code</span> |
|
1903 |
</summary> |
|
1904 |
<pre><code class="python">class Team(Base): |
|
1905 |
""" |
|
1906 |
Class defining database table teams |
|
1907 |
""" |
|
1908 |
__tablename__ = "teams" |
|
1909 |
|
|
1910 |
id = Column(Integer, primary_key=True, index=True) |
|
1911 |
name = Column(String, index=True, nullable=False) |
|
1912 |
|
|
1913 |
devices = relationship("Device", back_populates="team") |
|
1914 |
body_devices = relationship("BodyDevice", back_populates="team") |
|
1915 |
head_devices = relationship("HeadDevice", back_populates="team")</code></pre> |
|
1916 |
</details> |
|
1917 |
<h3>Ancestors</h3> |
|
1918 |
<ul class="hlist"> |
|
1919 |
<li>sqlalchemy.orm.decl_api.Base</li> |
|
1920 |
</ul> |
|
1921 |
<h3>Instance variables</h3> |
|
1922 |
<dl> |
|
1923 |
<dt id="sql_app.models.Team.body_devices"><code class="name">var <span class="ident">body_devices</span></code></dt> |
|
1363 | 1924 |
<dd> |
1364 | 1925 |
<div class="desc"></div> |
1365 | 1926 |
<details class="source"> |
... | ... | |
1384 | 1945 |
return self.impl.get(state, dict_)</code></pre> |
1385 | 1946 |
</details> |
1386 | 1947 |
</dd> |
1387 |
<dt id="sql_app.models.PC.team"><code class="name">var <span class="ident">team</span></code></dt>
|
|
1948 |
<dt id="sql_app.models.Team.devices"><code class="name">var <span class="ident">devices</span></code></dt>
|
|
1388 | 1949 |
<dd> |
1389 | 1950 |
<div class="desc"></div> |
1390 | 1951 |
<details class="source"> |
... | ... | |
1409 | 1970 |
return self.impl.get(state, dict_)</code></pre> |
1410 | 1971 |
</details> |
1411 | 1972 |
</dd> |
1412 |
<dt id="sql_app.models.PC.team_id"><code class="name">var <span class="ident">team_id</span></code></dt>
|
|
1973 |
<dt id="sql_app.models.Team.head_devices"><code class="name">var <span class="ident">head_devices</span></code></dt>
|
|
1413 | 1974 |
<dd> |
1414 | 1975 |
<div class="desc"></div> |
1415 | 1976 |
<details class="source"> |
... | ... | |
1434 | 1995 |
return self.impl.get(state, dict_)</code></pre> |
1435 | 1996 |
</details> |
1436 | 1997 |
</dd> |
1437 |
<dt id="sql_app.models.PC.username"><code class="name">var <span class="ident">username</span></code></dt> |
|
1998 |
<dt id="sql_app.models.Team.id"><code class="name">var <span class="ident">id</span></code></dt> |
|
1999 |
<dd> |
|
2000 |
<div class="desc"></div> |
|
2001 |
<details class="source"> |
|
2002 |
<summary> |
|
2003 |
<span>Expand source code</span> |
|
2004 |
</summary> |
|
2005 |
<pre><code class="python">def __get__(self, instance, owner): |
|
2006 |
if instance is None: |
|
2007 |
return self |
|
2008 |
|
|
2009 |
dict_ = instance_dict(instance) |
|
2010 |
if self._supports_population and self.key in dict_: |
|
2011 |
return dict_[self.key] |
|
2012 |
else: |
|
2013 |
try: |
|
2014 |
state = instance_state(instance) |
|
2015 |
except AttributeError as err: |
|
2016 |
util.raise_( |
|
2017 |
orm_exc.UnmappedInstanceError(instance), |
|
2018 |
replace_context=err, |
|
2019 |
) |
|
2020 |
return self.impl.get(state, dict_)</code></pre> |
|
2021 |
</details> |
|
2022 |
</dd> |
|
2023 |
<dt id="sql_app.models.Team.name"><code class="name">var <span class="ident">name</span></code></dt> |
|
1438 | 2024 |
<dd> |
1439 | 2025 |
<div class="desc"></div> |
1440 | 2026 |
<details class="source"> |
... | ... | |
1461 | 2047 |
</dd> |
1462 | 2048 |
</dl> |
1463 | 2049 |
</dd> |
1464 |
<dt id="sql_app.models.Team"><code class="flex name class">
|
|
1465 |
<span>class <span class="ident">Team</span></span>
|
|
2050 |
<dt id="sql_app.models.USBLog"><code class="flex name class">
|
|
2051 |
<span>class <span class="ident">USBLog</span></span>
|
|
1466 | 2052 |
<span>(</span><span>**kwargs)</span> |
1467 | 2053 |
</code></dt> |
1468 | 2054 |
<dd> |
1469 |
<div class="desc"><p>Class defining database table teams</p>
|
|
2055 |
<div class="desc"><p>Class defining database table usb_logs</p>
|
|
1470 | 2056 |
<p>A simple constructor that allows initialization from kwargs.</p> |
1471 | 2057 |
<p>Sets attributes on the constructed instance using the names and |
1472 | 2058 |
values in <code>kwargs</code>.</p> |
... | ... | |
1477 | 2063 |
<summary> |
1478 | 2064 |
<span>Expand source code</span> |
1479 | 2065 |
</summary> |
1480 |
<pre><code class="python">class Team(Base):
|
|
2066 |
<pre><code class="python">class USBLog(Base):
|
|
1481 | 2067 |
""" |
1482 |
Class defining database table teams
|
|
2068 |
Class defining database table usb_logs
|
|
1483 | 2069 |
""" |
1484 |
__tablename__ = "teams"
|
|
2070 |
__tablename__ = "usb_logs"
|
|
1485 | 2071 |
|
1486 | 2072 |
id = Column(Integer, primary_key=True, index=True) |
1487 |
name = Column(String, index=True, nullable=False) |
|
2073 |
pc_id = Column(Integer, ForeignKey("pc.id")) |
|
2074 |
timestamp = Column(DateTime(timezone=True), server_default=func.now()) |
|
2075 |
status = Column(String, index=True, nullable=False) |
|
2076 |
device_id = Column(Integer, ForeignKey("devices.id")) |
|
1488 | 2077 |
|
1489 |
# relationships for foreign keys, thus connecting table with pc table |
|
1490 |
pcs = relationship("PC", back_populates="team")</code></pre> |
|
2078 |
# relationships for foreign keys, thus connecting table with devices and pc |
|
2079 |
# tables |
|
2080 |
device = relationship("Device", back_populates="logs") |
|
2081 |
pc = relationship("PC", back_populates="logs_pc")</code></pre> |
|
1491 | 2082 |
</details> |
1492 | 2083 |
<h3>Ancestors</h3> |
1493 | 2084 |
<ul class="hlist"> |
... | ... | |
1495 | 2086 |
</ul> |
1496 | 2087 |
<h3>Instance variables</h3> |
1497 | 2088 |
<dl> |
1498 |
<dt id="sql_app.models.Team.id"><code class="name">var <span class="ident">id</span></code></dt>
|
|
2089 |
<dt id="sql_app.models.USBLog.device"><code class="name">var <span class="ident">device</span></code></dt>
|
|
1499 | 2090 |
<dd> |
1500 | 2091 |
<div class="desc"></div> |
1501 | 2092 |
<details class="source"> |
... | ... | |
1520 | 2111 |
return self.impl.get(state, dict_)</code></pre> |
1521 | 2112 |
</details> |
1522 | 2113 |
</dd> |
1523 |
<dt id="sql_app.models.Team.name"><code class="name">var <span class="ident">name</span></code></dt>
|
|
2114 |
<dt id="sql_app.models.USBLog.device_id"><code class="name">var <span class="ident">device_id</span></code></dt>
|
|
1524 | 2115 |
<dd> |
1525 | 2116 |
<div class="desc"></div> |
1526 | 2117 |
<details class="source"> |
... | ... | |
1545 | 2136 |
return self.impl.get(state, dict_)</code></pre> |
1546 | 2137 |
</details> |
1547 | 2138 |
</dd> |
1548 |
<dt id="sql_app.models.Team.pcs"><code class="name">var <span class="ident">pcs</span></code></dt>
|
|
2139 |
<dt id="sql_app.models.USBLog.id"><code class="name">var <span class="ident">id</span></code></dt>
|
|
1549 | 2140 |
<dd> |
1550 | 2141 |
<div class="desc"></div> |
1551 | 2142 |
<details class="source"> |
... | ... | |
1570 | 2161 |
return self.impl.get(state, dict_)</code></pre> |
1571 | 2162 |
</details> |
1572 | 2163 |
</dd> |
1573 |
</dl> |
|
1574 |
</dd> |
|
1575 |
<dt id="sql_app.models.USBLog"><code class="flex name class"> |
|
1576 |
<span>class <span class="ident">USBLog</span></span> |
|
1577 |
<span>(</span><span>**kwargs)</span> |
|
1578 |
</code></dt> |
|
2164 |
<dt id="sql_app.models.USBLog.pc"><code class="name">var <span class="ident">pc</span></code></dt> |
|
1579 | 2165 |
<dd> |
1580 |
<div class="desc"><p>Class defining database table usb_logs</p> |
|
1581 |
<p>A simple constructor that allows initialization from kwargs.</p> |
|
1582 |
<p>Sets attributes on the constructed instance using the names and |
|
1583 |
values in <code>kwargs</code>.</p> |
|
1584 |
<p>Only keys that are present as |
|
1585 |
attributes of the instance's class are allowed. These could be, |
|
1586 |
for example, any mapped columns or relationships.</p></div> |
|
2166 |
<div class="desc"></div> |
|
1587 | 2167 |
<details class="source"> |
1588 | 2168 |
<summary> |
1589 | 2169 |
<span>Expand source code</span> |
1590 | 2170 |
</summary> |
1591 |
<pre><code class="python">class USBLog(Base): |
|
1592 |
""" |
|
1593 |
Class defining database table usb_logs |
|
1594 |
""" |
|
1595 |
__tablename__ = "usb_logs" |
|
1596 |
|
|
1597 |
id = Column(Integer, primary_key=True, index=True) |
|
1598 |
pc_id = Column(Integer, ForeignKey("pc.id")) |
|
1599 |
timestamp = Column(DateTime(timezone=True), server_default=func.now()) |
|
1600 |
status = Column(String, index=True, nullable=False) |
|
1601 |
device_id = Column(Integer, ForeignKey("devices.id")) |
|
2171 |
<pre><code class="python">def __get__(self, instance, owner): |
|
2172 |
if instance is None: |
|
2173 |
return self |
|
1602 | 2174 |
|
1603 |
# relationships for foreign keys, thus connecting table with devices and pc |
|
1604 |
# tables |
|
1605 |
device = relationship("Device", back_populates="logs") |
|
1606 |
pc = relationship("PC", back_populates="logs_pc")</code></pre> |
|
2175 |
dict_ = instance_dict(instance) |
|
2176 |
if self._supports_population and self.key in dict_: |
|
2177 |
return dict_[self.key] |
|
2178 |
else: |
|
2179 |
try: |
|
2180 |
state = instance_state(instance) |
|
2181 |
except AttributeError as err: |
|
2182 |
util.raise_( |
Také k dispozici: Unified diff
re #9846 Changed keyman devices, body devices views. Added Head devices view. Changed filtering of logs, ldlogs, body devices, head devices and keyman devices. Changed HTML tables style and few labels.