1
|
<!doctype html>
|
2
|
<html lang="en">
|
3
|
<head>
|
4
|
<meta charset="utf-8">
|
5
|
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
6
|
<meta name="generator" content="pdoc 0.10.0" />
|
7
|
<title>sql_app.models API documentation</title>
|
8
|
<meta name="description" content="" />
|
9
|
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
10
|
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
11
|
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
12
|
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
13
|
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
14
|
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
15
|
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
16
|
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
17
|
</head>
|
18
|
<body>
|
19
|
<main>
|
20
|
<article id="content">
|
21
|
<header>
|
22
|
<h1 class="title">Module <code>sql_app.models</code></h1>
|
23
|
</header>
|
24
|
<section id="section-intro">
|
25
|
<details class="source">
|
26
|
<summary>
|
27
|
<span>Expand source code</span>
|
28
|
</summary>
|
29
|
<pre><code class="python">from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, DateTime
|
30
|
from sqlalchemy.orm import relationship
|
31
|
from sqlalchemy.sql import func
|
32
|
from .database import Base
|
33
|
|
34
|
|
35
|
class Device(Base):
|
36
|
"""
|
37
|
Class defining database table devices
|
38
|
"""
|
39
|
__tablename__ = "devices"
|
40
|
|
41
|
id = Column(Integer, primary_key=True, index=True)
|
42
|
vendor_id = Column(String, index=True, nullable=False)
|
43
|
product_id = Column(String, index=True, nullable=False)
|
44
|
serial_number = Column(String, index=True, nullable=False)
|
45
|
assigned = Column(Boolean, index=True, nullable=False)
|
46
|
|
47
|
# relationships for foreign keys, thus connecting table with usb_logs and licenses
|
48
|
# tables
|
49
|
logs = relationship("USBLog", back_populates="device")
|
50
|
licenses = relationship("DeviceLicense", back_populates="device_lic")
|
51
|
|
52
|
|
53
|
class USBLog(Base):
|
54
|
"""
|
55
|
Class defining database table usb_logs
|
56
|
"""
|
57
|
__tablename__ = "usb_logs"
|
58
|
|
59
|
id = Column(Integer, primary_key=True, index=True)
|
60
|
pc_id = Column(Integer, ForeignKey("pc.id"))
|
61
|
timestamp = Column(DateTime(timezone=True), server_default=func.now())
|
62
|
status = Column(String, index=True, nullable=False)
|
63
|
device_id = Column(Integer, ForeignKey("devices.id"))
|
64
|
|
65
|
# relationships for foreign keys, thus connecting table with devices and pc
|
66
|
# tables
|
67
|
device = relationship("Device", back_populates="logs")
|
68
|
pc = relationship("PC", back_populates="logs_pc")
|
69
|
|
70
|
|
71
|
class License(Base):
|
72
|
"""
|
73
|
Class defining database table licenses
|
74
|
"""
|
75
|
__tablename__ = "licenses"
|
76
|
|
77
|
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())
|
80
|
|
81
|
# relationships for foreign keys, thus connecting table with devices table
|
82
|
devices = relationship("DeviceLicense", back_populates="licenses")
|
83
|
|
84
|
|
85
|
class DeviceLicense(Base):
|
86
|
"""
|
87
|
Class defining database table devices_licenses
|
88
|
"""
|
89
|
__tablename__ = "devices_licenses"
|
90
|
|
91
|
id = Column(Integer, primary_key=True, index=True)
|
92
|
device_id = Column(Integer, ForeignKey("devices.id"))
|
93
|
license_id = Column(Integer, ForeignKey("licenses.id"))
|
94
|
assigned_datetime = Column(String, index=True, nullable=False)
|
95
|
|
96
|
# relationships for foreign keys, thus connecting table with devices and licenses
|
97
|
# tables
|
98
|
device_lic = relationship("Device", back_populates="licenses")
|
99
|
licenses = relationship("License", back_populates="devices")
|
100
|
|
101
|
|
102
|
class PC(Base):
|
103
|
"""
|
104
|
Class defining database table pc
|
105
|
"""
|
106
|
__tablename__ = "pc"
|
107
|
|
108
|
id = Column(Integer, primary_key=True, index=True)
|
109
|
username = Column(String, index=True, nullable=False)
|
110
|
hostname = Column(String, index=True, nullable=False)
|
111
|
assigned = Column(Boolean, index=True, nullable=False)
|
112
|
team_id = Column(Integer, ForeignKey("teams.id"))
|
113
|
|
114
|
# relationships for foreign keys, thus connecting table with teams, usb_logs and ld_logs
|
115
|
# tables
|
116
|
team = relationship("Team", back_populates="pcs")
|
117
|
logs_pc = relationship("USBLog", back_populates="pc")
|
118
|
ld_pc = relationship("LDLog", back_populates="ldpc")
|
119
|
|
120
|
|
121
|
class Team(Base):
|
122
|
"""
|
123
|
Class defining database table teams
|
124
|
"""
|
125
|
__tablename__ = "teams"
|
126
|
|
127
|
id = Column(Integer, primary_key=True, index=True)
|
128
|
name = Column(String, index=True, nullable=False)
|
129
|
|
130
|
# relationships for foreign keys, thus connecting table with pc table
|
131
|
pcs = relationship("PC", back_populates="team")
|
132
|
|
133
|
|
134
|
class HeadDevice(Base):
|
135
|
"""
|
136
|
Class defining database table head_devices
|
137
|
"""
|
138
|
__tablename__ = "head_devices"
|
139
|
|
140
|
id = Column(Integer, primary_key=True, index=True)
|
141
|
serial_number = Column(String, index=True, nullable=False)
|
142
|
|
143
|
# relationships for foreign keys, thus connecting table with ld_logs table
|
144
|
h_logs = relationship("LDLog", back_populates="head_device")
|
145
|
|
146
|
|
147
|
class BodyDevice(Base):
|
148
|
"""
|
149
|
Class defining database table body_devices
|
150
|
"""
|
151
|
__tablename__ = "body_devices"
|
152
|
|
153
|
id = Column(Integer, primary_key=True, index=True)
|
154
|
serial_number = Column(String, index=True, nullable=False)
|
155
|
|
156
|
# relationships for foreign keys, thus connecting table with ld_logs table
|
157
|
b_logs = relationship("LDLog", back_populates="body_device")
|
158
|
|
159
|
|
160
|
class LDLog(Base):
|
161
|
"""
|
162
|
Class defining database table ld_logs
|
163
|
"""
|
164
|
__tablename__ = "ld_logs"
|
165
|
|
166
|
id = Column(Integer, primary_key=True, index=True)
|
167
|
pc_id = Column(Integer, ForeignKey("pc.id"))
|
168
|
timestamp = Column(DateTime(timezone=True), server_default=func.now())
|
169
|
status = Column(String, index=True, nullable=False)
|
170
|
head_id = Column(Integer, ForeignKey("head_devices.id"))
|
171
|
body_id = Column(Integer, ForeignKey("body_devices.id"))
|
172
|
|
173
|
# relationships for foreign keys, thus connecting table with pc, head_devices and body_devices
|
174
|
# tables
|
175
|
ldpc = relationship("PC", back_populates="ld_pc")
|
176
|
head_device = relationship("HeadDevice", back_populates="h_logs")
|
177
|
body_device = relationship("BodyDevice", back_populates="b_logs")</code></pre>
|
178
|
</details>
|
179
|
</section>
|
180
|
<section>
|
181
|
</section>
|
182
|
<section>
|
183
|
</section>
|
184
|
<section>
|
185
|
</section>
|
186
|
<section>
|
187
|
<h2 class="section-title" id="header-classes">Classes</h2>
|
188
|
<dl>
|
189
|
<dt id="sql_app.models.BodyDevice"><code class="flex name class">
|
190
|
<span>class <span class="ident">BodyDevice</span></span>
|
191
|
<span>(</span><span>**kwargs)</span>
|
192
|
</code></dt>
|
193
|
<dd>
|
194
|
<div class="desc"><p>Class defining database table body_devices</p>
|
195
|
<p>A simple constructor that allows initialization from kwargs.</p>
|
196
|
<p>Sets attributes on the constructed instance using the names and
|
197
|
values in <code>kwargs</code>.</p>
|
198
|
<p>Only keys that are present as
|
199
|
attributes of the instance's class are allowed. These could be,
|
200
|
for example, any mapped columns or relationships.</p></div>
|
201
|
<details class="source">
|
202
|
<summary>
|
203
|
<span>Expand source code</span>
|
204
|
</summary>
|
205
|
<pre><code class="python">class BodyDevice(Base):
|
206
|
"""
|
207
|
Class defining database table body_devices
|
208
|
"""
|
209
|
__tablename__ = "body_devices"
|
210
|
|
211
|
id = Column(Integer, primary_key=True, index=True)
|
212
|
serial_number = Column(String, index=True, nullable=False)
|
213
|
|
214
|
# relationships for foreign keys, thus connecting table with ld_logs table
|
215
|
b_logs = relationship("LDLog", back_populates="body_device")</code></pre>
|
216
|
</details>
|
217
|
<h3>Ancestors</h3>
|
218
|
<ul class="hlist">
|
219
|
<li>sqlalchemy.orm.decl_api.Base</li>
|
220
|
</ul>
|
221
|
<h3>Instance variables</h3>
|
222
|
<dl>
|
223
|
<dt id="sql_app.models.BodyDevice.b_logs"><code class="name">var <span class="ident">b_logs</span></code></dt>
|
224
|
<dd>
|
225
|
<div class="desc"></div>
|
226
|
<details class="source">
|
227
|
<summary>
|
228
|
<span>Expand source code</span>
|
229
|
</summary>
|
230
|
<pre><code class="python">def __get__(self, instance, owner):
|
231
|
if instance is None:
|
232
|
return self
|
233
|
|
234
|
dict_ = instance_dict(instance)
|
235
|
if self._supports_population and self.key in dict_:
|
236
|
return dict_[self.key]
|
237
|
else:
|
238
|
try:
|
239
|
state = instance_state(instance)
|
240
|
except AttributeError as err:
|
241
|
util.raise_(
|
242
|
orm_exc.UnmappedInstanceError(instance),
|
243
|
replace_context=err,
|
244
|
)
|
245
|
return self.impl.get(state, dict_)</code></pre>
|
246
|
</details>
|
247
|
</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>
|
274
|
<dd>
|
275
|
<div class="desc"></div>
|
276
|
<details class="source">
|
277
|
<summary>
|
278
|
<span>Expand source code</span>
|
279
|
</summary>
|
280
|
<pre><code class="python">def __get__(self, instance, owner):
|
281
|
if instance is None:
|
282
|
return self
|
283
|
|
284
|
dict_ = instance_dict(instance)
|
285
|
if self._supports_population and self.key in dict_:
|
286
|
return dict_[self.key]
|
287
|
else:
|
288
|
try:
|
289
|
state = instance_state(instance)
|
290
|
except AttributeError as err:
|
291
|
util.raise_(
|
292
|
orm_exc.UnmappedInstanceError(instance),
|
293
|
replace_context=err,
|
294
|
)
|
295
|
return self.impl.get(state, dict_)</code></pre>
|
296
|
</details>
|
297
|
</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>
|
340
|
<dd>
|
341
|
<div class="desc"></div>
|
342
|
<details class="source">
|
343
|
<summary>
|
344
|
<span>Expand source code</span>
|
345
|
</summary>
|
346
|
<pre><code class="python">def __get__(self, instance, owner):
|
347
|
if instance is None:
|
348
|
return self
|
349
|
|
350
|
dict_ = instance_dict(instance)
|
351
|
if self._supports_population and self.key in dict_:
|
352
|
return dict_[self.key]
|
353
|
else:
|
354
|
try:
|
355
|
state = instance_state(instance)
|
356
|
except AttributeError as err:
|
357
|
util.raise_(
|
358
|
orm_exc.UnmappedInstanceError(instance),
|
359
|
replace_context=err,
|
360
|
)
|
361
|
return self.impl.get(state, dict_)</code></pre>
|
362
|
</details>
|
363
|
</dd>
|
364
|
<dt id="sql_app.models.Device.id"><code class="name">var <span class="ident">id</span></code></dt>
|
365
|
<dd>
|
366
|
<div class="desc"></div>
|
367
|
<details class="source">
|
368
|
<summary>
|
369
|
<span>Expand source code</span>
|
370
|
</summary>
|
371
|
<pre><code class="python">def __get__(self, instance, owner):
|
372
|
if instance is None:
|
373
|
return self
|
374
|
|
375
|
dict_ = instance_dict(instance)
|
376
|
if self._supports_population and self.key in dict_:
|
377
|
return dict_[self.key]
|
378
|
else:
|
379
|
try:
|
380
|
state = instance_state(instance)
|
381
|
except AttributeError as err:
|
382
|
util.raise_(
|
383
|
orm_exc.UnmappedInstanceError(instance),
|
384
|
replace_context=err,
|
385
|
)
|
386
|
return self.impl.get(state, dict_)</code></pre>
|
387
|
</details>
|
388
|
</dd>
|
389
|
<dt id="sql_app.models.Device.licenses"><code class="name">var <span class="ident">licenses</span></code></dt>
|
390
|
<dd>
|
391
|
<div class="desc"></div>
|
392
|
<details class="source">
|
393
|
<summary>
|
394
|
<span>Expand source code</span>
|
395
|
</summary>
|
396
|
<pre><code class="python">def __get__(self, instance, owner):
|
397
|
if instance is None:
|
398
|
return self
|
399
|
|
400
|
dict_ = instance_dict(instance)
|
401
|
if self._supports_population and self.key in dict_:
|
402
|
return dict_[self.key]
|
403
|
else:
|
404
|
try:
|
405
|
state = instance_state(instance)
|
406
|
except AttributeError as err:
|
407
|
util.raise_(
|
408
|
orm_exc.UnmappedInstanceError(instance),
|
409
|
replace_context=err,
|
410
|
)
|
411
|
return self.impl.get(state, dict_)</code></pre>
|
412
|
</details>
|
413
|
</dd>
|
414
|
<dt id="sql_app.models.Device.logs"><code class="name">var <span class="ident">logs</span></code></dt>
|
415
|
<dd>
|
416
|
<div class="desc"></div>
|
417
|
<details class="source">
|
418
|
<summary>
|
419
|
<span>Expand source code</span>
|
420
|
</summary>
|
421
|
<pre><code class="python">def __get__(self, instance, owner):
|
422
|
if instance is None:
|
423
|
return self
|
424
|
|
425
|
dict_ = instance_dict(instance)
|
426
|
if self._supports_population and self.key in dict_:
|
427
|
return dict_[self.key]
|
428
|
else:
|
429
|
try:
|
430
|
state = instance_state(instance)
|
431
|
except AttributeError as err:
|
432
|
util.raise_(
|
433
|
orm_exc.UnmappedInstanceError(instance),
|
434
|
replace_context=err,
|
435
|
)
|
436
|
return self.impl.get(state, dict_)</code></pre>
|
437
|
</details>
|
438
|
</dd>
|
439
|
<dt id="sql_app.models.Device.product_id"><code class="name">var <span class="ident">product_id</span></code></dt>
|
440
|
<dd>
|
441
|
<div class="desc"></div>
|
442
|
<details class="source">
|
443
|
<summary>
|
444
|
<span>Expand source code</span>
|
445
|
</summary>
|
446
|
<pre><code class="python">def __get__(self, instance, owner):
|
447
|
if instance is None:
|
448
|
return self
|
449
|
|
450
|
dict_ = instance_dict(instance)
|
451
|
if self._supports_population and self.key in dict_:
|
452
|
return dict_[self.key]
|
453
|
else:
|
454
|
try:
|
455
|
state = instance_state(instance)
|
456
|
except AttributeError as err:
|
457
|
util.raise_(
|
458
|
orm_exc.UnmappedInstanceError(instance),
|
459
|
replace_context=err,
|
460
|
)
|
461
|
return self.impl.get(state, dict_)</code></pre>
|
462
|
</details>
|
463
|
</dd>
|
464
|
<dt id="sql_app.models.Device.serial_number"><code class="name">var <span class="ident">serial_number</span></code></dt>
|
465
|
<dd>
|
466
|
<div class="desc"></div>
|
467
|
<details class="source">
|
468
|
<summary>
|
469
|
<span>Expand source code</span>
|
470
|
</summary>
|
471
|
<pre><code class="python">def __get__(self, instance, owner):
|
472
|
if instance is None:
|
473
|
return self
|
474
|
|
475
|
dict_ = instance_dict(instance)
|
476
|
if self._supports_population and self.key in dict_:
|
477
|
return dict_[self.key]
|
478
|
else:
|
479
|
try:
|
480
|
state = instance_state(instance)
|
481
|
except AttributeError as err:
|
482
|
util.raise_(
|
483
|
orm_exc.UnmappedInstanceError(instance),
|
484
|
replace_context=err,
|
485
|
)
|
486
|
return self.impl.get(state, dict_)</code></pre>
|
487
|
</details>
|
488
|
</dd>
|
489
|
<dt id="sql_app.models.Device.vendor_id"><code class="name">var <span class="ident">vendor_id</span></code></dt>
|
490
|
<dd>
|
491
|
<div class="desc"></div>
|
492
|
<details class="source">
|
493
|
<summary>
|
494
|
<span>Expand source code</span>
|
495
|
</summary>
|
496
|
<pre><code class="python">def __get__(self, instance, owner):
|
497
|
if instance is None:
|
498
|
return self
|
499
|
|
500
|
dict_ = instance_dict(instance)
|
501
|
if self._supports_population and self.key in dict_:
|
502
|
return dict_[self.key]
|
503
|
else:
|
504
|
try:
|
505
|
state = instance_state(instance)
|
506
|
except AttributeError as err:
|
507
|
util.raise_(
|
508
|
orm_exc.UnmappedInstanceError(instance),
|
509
|
replace_context=err,
|
510
|
)
|
511
|
return self.impl.get(state, dict_)</code></pre>
|
512
|
</details>
|
513
|
</dd>
|
514
|
</dl>
|
515
|
</dd>
|
516
|
<dt id="sql_app.models.DeviceLicense"><code class="flex name class">
|
517
|
<span>class <span class="ident">DeviceLicense</span></span>
|
518
|
<span>(</span><span>**kwargs)</span>
|
519
|
</code></dt>
|
520
|
<dd>
|
521
|
<div class="desc"><p>Class defining database table devices_licenses</p>
|
522
|
<p>A simple constructor that allows initialization from kwargs.</p>
|
523
|
<p>Sets attributes on the constructed instance using the names and
|
524
|
values in <code>kwargs</code>.</p>
|
525
|
<p>Only keys that are present as
|
526
|
attributes of the instance's class are allowed. These could be,
|
527
|
for example, any mapped columns or relationships.</p></div>
|
528
|
<details class="source">
|
529
|
<summary>
|
530
|
<span>Expand source code</span>
|
531
|
</summary>
|
532
|
<pre><code class="python">class DeviceLicense(Base):
|
533
|
"""
|
534
|
Class defining database table devices_licenses
|
535
|
"""
|
536
|
__tablename__ = "devices_licenses"
|
537
|
|
538
|
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)
|
542
|
|
543
|
# relationships for foreign keys, thus connecting table with devices and licenses
|
544
|
# tables
|
545
|
device_lic = relationship("Device", back_populates="licenses")
|
546
|
licenses = relationship("License", back_populates="devices")</code></pre>
|
547
|
</details>
|
548
|
<h3>Ancestors</h3>
|
549
|
<ul class="hlist">
|
550
|
<li>sqlalchemy.orm.decl_api.Base</li>
|
551
|
</ul>
|
552
|
<h3>Instance variables</h3>
|
553
|
<dl>
|
554
|
<dt id="sql_app.models.DeviceLicense.assigned_datetime"><code class="name">var <span class="ident">assigned_datetime</span></code></dt>
|
555
|
<dd>
|
556
|
<div class="desc"></div>
|
557
|
<details class="source">
|
558
|
<summary>
|
559
|
<span>Expand source code</span>
|
560
|
</summary>
|
561
|
<pre><code class="python">def __get__(self, instance, owner):
|
562
|
if instance is None:
|
563
|
return self
|
564
|
|
565
|
dict_ = instance_dict(instance)
|
566
|
if self._supports_population and self.key in dict_:
|
567
|
return dict_[self.key]
|
568
|
else:
|
569
|
try:
|
570
|
state = instance_state(instance)
|
571
|
except AttributeError as err:
|
572
|
util.raise_(
|
573
|
orm_exc.UnmappedInstanceError(instance),
|
574
|
replace_context=err,
|
575
|
)
|
576
|
return self.impl.get(state, dict_)</code></pre>
|
577
|
</details>
|
578
|
</dd>
|
579
|
<dt id="sql_app.models.DeviceLicense.device_id"><code class="name">var <span class="ident">device_id</span></code></dt>
|
580
|
<dd>
|
581
|
<div class="desc"></div>
|
582
|
<details class="source">
|
583
|
<summary>
|
584
|
<span>Expand source code</span>
|
585
|
</summary>
|
586
|
<pre><code class="python">def __get__(self, instance, owner):
|
587
|
if instance is None:
|
588
|
return self
|
589
|
|
590
|
dict_ = instance_dict(instance)
|
591
|
if self._supports_population and self.key in dict_:
|
592
|
return dict_[self.key]
|
593
|
else:
|
594
|
try:
|
595
|
state = instance_state(instance)
|
596
|
except AttributeError as err:
|
597
|
util.raise_(
|
598
|
orm_exc.UnmappedInstanceError(instance),
|
599
|
replace_context=err,
|
600
|
)
|
601
|
return self.impl.get(state, dict_)</code></pre>
|
602
|
</details>
|
603
|
</dd>
|
604
|
<dt id="sql_app.models.DeviceLicense.device_lic"><code class="name">var <span class="ident">device_lic</span></code></dt>
|
605
|
<dd>
|
606
|
<div class="desc"></div>
|
607
|
<details class="source">
|
608
|
<summary>
|
609
|
<span>Expand source code</span>
|
610
|
</summary>
|
611
|
<pre><code class="python">def __get__(self, instance, owner):
|
612
|
if instance is None:
|
613
|
return self
|
614
|
|
615
|
dict_ = instance_dict(instance)
|
616
|
if self._supports_population and self.key in dict_:
|
617
|
return dict_[self.key]
|
618
|
else:
|
619
|
try:
|
620
|
state = instance_state(instance)
|
621
|
except AttributeError as err:
|
622
|
util.raise_(
|
623
|
orm_exc.UnmappedInstanceError(instance),
|
624
|
replace_context=err,
|
625
|
)
|
626
|
return self.impl.get(state, dict_)</code></pre>
|
627
|
</details>
|
628
|
</dd>
|
629
|
<dt id="sql_app.models.DeviceLicense.id"><code class="name">var <span class="ident">id</span></code></dt>
|
630
|
<dd>
|
631
|
<div class="desc"></div>
|
632
|
<details class="source">
|
633
|
<summary>
|
634
|
<span>Expand source code</span>
|
635
|
</summary>
|
636
|
<pre><code class="python">def __get__(self, instance, owner):
|
637
|
if instance is None:
|
638
|
return self
|
639
|
|
640
|
dict_ = instance_dict(instance)
|
641
|
if self._supports_population and self.key in dict_:
|
642
|
return dict_[self.key]
|
643
|
else:
|
644
|
try:
|
645
|
state = instance_state(instance)
|
646
|
except AttributeError as err:
|
647
|
util.raise_(
|
648
|
orm_exc.UnmappedInstanceError(instance),
|
649
|
replace_context=err,
|
650
|
)
|
651
|
return self.impl.get(state, dict_)</code></pre>
|
652
|
</details>
|
653
|
</dd>
|
654
|
<dt id="sql_app.models.DeviceLicense.license_id"><code class="name">var <span class="ident">license_id</span></code></dt>
|
655
|
<dd>
|
656
|
<div class="desc"></div>
|
657
|
<details class="source">
|
658
|
<summary>
|
659
|
<span>Expand source code</span>
|
660
|
</summary>
|
661
|
<pre><code class="python">def __get__(self, instance, owner):
|
662
|
if instance is None:
|
663
|
return self
|
664
|
|
665
|
dict_ = instance_dict(instance)
|
666
|
if self._supports_population and self.key in dict_:
|
667
|
return dict_[self.key]
|
668
|
else:
|
669
|
try:
|
670
|
state = instance_state(instance)
|
671
|
except AttributeError as err:
|
672
|
util.raise_(
|
673
|
orm_exc.UnmappedInstanceError(instance),
|
674
|
replace_context=err,
|
675
|
)
|
676
|
return self.impl.get(state, dict_)</code></pre>
|
677
|
</details>
|
678
|
</dd>
|
679
|
<dt id="sql_app.models.DeviceLicense.licenses"><code class="name">var <span class="ident">licenses</span></code></dt>
|
680
|
<dd>
|
681
|
<div class="desc"></div>
|
682
|
<details class="source">
|
683
|
<summary>
|
684
|
<span>Expand source code</span>
|
685
|
</summary>
|
686
|
<pre><code class="python">def __get__(self, instance, owner):
|
687
|
if instance is None:
|
688
|
return self
|
689
|
|
690
|
dict_ = instance_dict(instance)
|
691
|
if self._supports_population and self.key in dict_:
|
692
|
return dict_[self.key]
|
693
|
else:
|
694
|
try:
|
695
|
state = instance_state(instance)
|
696
|
except AttributeError as err:
|
697
|
util.raise_(
|
698
|
orm_exc.UnmappedInstanceError(instance),
|
699
|
replace_context=err,
|
700
|
)
|
701
|
return self.impl.get(state, dict_)</code></pre>
|
702
|
</details>
|
703
|
</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>
|
710
|
<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>
|
718
|
<details class="source">
|
719
|
<summary>
|
720
|
<span>Expand source code</span>
|
721
|
</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)
|
730
|
|
731
|
# relationships for foreign keys, thus connecting table with ld_logs table
|
732
|
h_logs = relationship("LDLog", back_populates="head_device")</code></pre>
|
733
|
</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>
|
741
|
<dd>
|
742
|
<div class="desc"></div>
|
743
|
<details class="source">
|
744
|
<summary>
|
745
|
<span>Expand source code</span>
|
746
|
</summary>
|
747
|
<pre><code class="python">def __get__(self, instance, owner):
|
748
|
if instance is None:
|
749
|
return self
|
750
|
|
751
|
dict_ = instance_dict(instance)
|
752
|
if self._supports_population and self.key in dict_:
|
753
|
return dict_[self.key]
|
754
|
else:
|
755
|
try:
|
756
|
state = instance_state(instance)
|
757
|
except AttributeError as err:
|
758
|
util.raise_(
|
759
|
orm_exc.UnmappedInstanceError(instance),
|
760
|
replace_context=err,
|
761
|
)
|
762
|
return self.impl.get(state, dict_)</code></pre>
|
763
|
</details>
|
764
|
</dd>
|
765
|
<dt id="sql_app.models.HeadDevice.id"><code class="name">var <span class="ident">id</span></code></dt>
|
766
|
<dd>
|
767
|
<div class="desc"></div>
|
768
|
<details class="source">
|
769
|
<summary>
|
770
|
<span>Expand source code</span>
|
771
|
</summary>
|
772
|
<pre><code class="python">def __get__(self, instance, owner):
|
773
|
if instance is None:
|
774
|
return self
|
775
|
|
776
|
dict_ = instance_dict(instance)
|
777
|
if self._supports_population and self.key in dict_:
|
778
|
return dict_[self.key]
|
779
|
else:
|
780
|
try:
|
781
|
state = instance_state(instance)
|
782
|
except AttributeError as err:
|
783
|
util.raise_(
|
784
|
orm_exc.UnmappedInstanceError(instance),
|
785
|
replace_context=err,
|
786
|
)
|
787
|
return self.impl.get(state, dict_)</code></pre>
|
788
|
</details>
|
789
|
</dd>
|
790
|
<dt id="sql_app.models.HeadDevice.serial_number"><code class="name">var <span class="ident">serial_number</span></code></dt>
|
791
|
<dd>
|
792
|
<div class="desc"></div>
|
793
|
<details class="source">
|
794
|
<summary>
|
795
|
<span>Expand source code</span>
|
796
|
</summary>
|
797
|
<pre><code class="python">def __get__(self, instance, owner):
|
798
|
if instance is None:
|
799
|
return self
|
800
|
|
801
|
dict_ = instance_dict(instance)
|
802
|
if self._supports_population and self.key in dict_:
|
803
|
return dict_[self.key]
|
804
|
else:
|
805
|
try:
|
806
|
state = instance_state(instance)
|
807
|
except AttributeError as err:
|
808
|
util.raise_(
|
809
|
orm_exc.UnmappedInstanceError(instance),
|
810
|
replace_context=err,
|
811
|
)
|
812
|
return self.impl.get(state, dict_)</code></pre>
|
813
|
</details>
|
814
|
</dd>
|
815
|
</dl>
|
816
|
</dd>
|
817
|
<dt id="sql_app.models.LDLog"><code class="flex name class">
|
818
|
<span>class <span class="ident">LDLog</span></span>
|
819
|
<span>(</span><span>**kwargs)</span>
|
820
|
</code></dt>
|
821
|
<dd>
|
822
|
<div class="desc"><p>Class defining database table ld_logs</p>
|
823
|
<p>A simple constructor that allows initialization from kwargs.</p>
|
824
|
<p>Sets attributes on the constructed instance using the names and
|
825
|
values in <code>kwargs</code>.</p>
|
826
|
<p>Only keys that are present as
|
827
|
attributes of the instance's class are allowed. These could be,
|
828
|
for example, any mapped columns or relationships.</p></div>
|
829
|
<details class="source">
|
830
|
<summary>
|
831
|
<span>Expand source code</span>
|
832
|
</summary>
|
833
|
<pre><code class="python">class LDLog(Base):
|
834
|
"""
|
835
|
Class defining database table ld_logs
|
836
|
"""
|
837
|
__tablename__ = "ld_logs"
|
838
|
|
839
|
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"))
|
845
|
|
846
|
# relationships for foreign keys, thus connecting table with pc, head_devices and body_devices
|
847
|
# 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>
|
851
|
</details>
|
852
|
<h3>Ancestors</h3>
|
853
|
<ul class="hlist">
|
854
|
<li>sqlalchemy.orm.decl_api.Base</li>
|
855
|
</ul>
|
856
|
<h3>Instance variables</h3>
|
857
|
<dl>
|
858
|
<dt id="sql_app.models.LDLog.body_device"><code class="name">var <span class="ident">body_device</span></code></dt>
|
859
|
<dd>
|
860
|
<div class="desc"></div>
|
861
|
<details class="source">
|
862
|
<summary>
|
863
|
<span>Expand source code</span>
|
864
|
</summary>
|
865
|
<pre><code class="python">def __get__(self, instance, owner):
|
866
|
if instance is None:
|
867
|
return self
|
868
|
|
869
|
dict_ = instance_dict(instance)
|
870
|
if self._supports_population and self.key in dict_:
|
871
|
return dict_[self.key]
|
872
|
else:
|
873
|
try:
|
874
|
state = instance_state(instance)
|
875
|
except AttributeError as err:
|
876
|
util.raise_(
|
877
|
orm_exc.UnmappedInstanceError(instance),
|
878
|
replace_context=err,
|
879
|
)
|
880
|
return self.impl.get(state, dict_)</code></pre>
|
881
|
</details>
|
882
|
</dd>
|
883
|
<dt id="sql_app.models.LDLog.body_id"><code class="name">var <span class="ident">body_id</span></code></dt>
|
884
|
<dd>
|
885
|
<div class="desc"></div>
|
886
|
<details class="source">
|
887
|
<summary>
|
888
|
<span>Expand source code</span>
|
889
|
</summary>
|
890
|
<pre><code class="python">def __get__(self, instance, owner):
|
891
|
if instance is None:
|
892
|
return self
|
893
|
|
894
|
dict_ = instance_dict(instance)
|
895
|
if self._supports_population and self.key in dict_:
|
896
|
return dict_[self.key]
|
897
|
else:
|
898
|
try:
|
899
|
state = instance_state(instance)
|
900
|
except AttributeError as err:
|
901
|
util.raise_(
|
902
|
orm_exc.UnmappedInstanceError(instance),
|
903
|
replace_context=err,
|
904
|
)
|
905
|
return self.impl.get(state, dict_)</code></pre>
|
906
|
</details>
|
907
|
</dd>
|
908
|
<dt id="sql_app.models.LDLog.head_device"><code class="name">var <span class="ident">head_device</span></code></dt>
|
909
|
<dd>
|
910
|
<div class="desc"></div>
|
911
|
<details class="source">
|
912
|
<summary>
|
913
|
<span>Expand source code</span>
|
914
|
</summary>
|
915
|
<pre><code class="python">def __get__(self, instance, owner):
|
916
|
if instance is None:
|
917
|
return self
|
918
|
|
919
|
dict_ = instance_dict(instance)
|
920
|
if self._supports_population and self.key in dict_:
|
921
|
return dict_[self.key]
|
922
|
else:
|
923
|
try:
|
924
|
state = instance_state(instance)
|
925
|
except AttributeError as err:
|
926
|
util.raise_(
|
927
|
orm_exc.UnmappedInstanceError(instance),
|
928
|
replace_context=err,
|
929
|
)
|
930
|
return self.impl.get(state, dict_)</code></pre>
|
931
|
</details>
|
932
|
</dd>
|
933
|
<dt id="sql_app.models.LDLog.head_id"><code class="name">var <span class="ident">head_id</span></code></dt>
|
934
|
<dd>
|
935
|
<div class="desc"></div>
|
936
|
<details class="source">
|
937
|
<summary>
|
938
|
<span>Expand source code</span>
|
939
|
</summary>
|
940
|
<pre><code class="python">def __get__(self, instance, owner):
|
941
|
if instance is None:
|
942
|
return self
|
943
|
|
944
|
dict_ = instance_dict(instance)
|
945
|
if self._supports_population and self.key in dict_:
|
946
|
return dict_[self.key]
|
947
|
else:
|
948
|
try:
|
949
|
state = instance_state(instance)
|
950
|
except AttributeError as err:
|
951
|
util.raise_(
|
952
|
orm_exc.UnmappedInstanceError(instance),
|
953
|
replace_context=err,
|
954
|
)
|
955
|
return self.impl.get(state, dict_)</code></pre>
|
956
|
</details>
|
957
|
</dd>
|
958
|
<dt id="sql_app.models.LDLog.id"><code class="name">var <span class="ident">id</span></code></dt>
|
959
|
<dd>
|
960
|
<div class="desc"></div>
|
961
|
<details class="source">
|
962
|
<summary>
|
963
|
<span>Expand source code</span>
|
964
|
</summary>
|
965
|
<pre><code class="python">def __get__(self, instance, owner):
|
966
|
if instance is None:
|
967
|
return self
|
968
|
|
969
|
dict_ = instance_dict(instance)
|
970
|
if self._supports_population and self.key in dict_:
|
971
|
return dict_[self.key]
|
972
|
else:
|
973
|
try:
|
974
|
state = instance_state(instance)
|
975
|
except AttributeError as err:
|
976
|
util.raise_(
|
977
|
orm_exc.UnmappedInstanceError(instance),
|
978
|
replace_context=err,
|
979
|
)
|
980
|
return self.impl.get(state, dict_)</code></pre>
|
981
|
</details>
|
982
|
</dd>
|
983
|
<dt id="sql_app.models.LDLog.ldpc"><code class="name">var <span class="ident">ldpc</span></code></dt>
|
984
|
<dd>
|
985
|
<div class="desc"></div>
|
986
|
<details class="source">
|
987
|
<summary>
|
988
|
<span>Expand source code</span>
|
989
|
</summary>
|
990
|
<pre><code class="python">def __get__(self, instance, owner):
|
991
|
if instance is None:
|
992
|
return self
|
993
|
|
994
|
dict_ = instance_dict(instance)
|
995
|
if self._supports_population and self.key in dict_:
|
996
|
return dict_[self.key]
|
997
|
else:
|
998
|
try:
|
999
|
state = instance_state(instance)
|
1000
|
except AttributeError as err:
|
1001
|
util.raise_(
|
1002
|
orm_exc.UnmappedInstanceError(instance),
|
1003
|
replace_context=err,
|
1004
|
)
|
1005
|
return self.impl.get(state, dict_)</code></pre>
|
1006
|
</details>
|
1007
|
</dd>
|
1008
|
<dt id="sql_app.models.LDLog.pc_id"><code class="name">var <span class="ident">pc_id</span></code></dt>
|
1009
|
<dd>
|
1010
|
<div class="desc"></div>
|
1011
|
<details class="source">
|
1012
|
<summary>
|
1013
|
<span>Expand source code</span>
|
1014
|
</summary>
|
1015
|
<pre><code class="python">def __get__(self, instance, owner):
|
1016
|
if instance is None:
|
1017
|
return self
|
1018
|
|
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>
|
1032
|
</dd>
|
1033
|
<dt id="sql_app.models.LDLog.status"><code class="name">var <span class="ident">status</span></code></dt>
|
1034
|
<dd>
|
1035
|
<div class="desc"></div>
|
1036
|
<details class="source">
|
1037
|
<summary>
|
1038
|
<span>Expand source code</span>
|
1039
|
</summary>
|
1040
|
<pre><code class="python">def __get__(self, instance, owner):
|
1041
|
if instance is None:
|
1042
|
return self
|
1043
|
|
1044
|
dict_ = instance_dict(instance)
|
1045
|
if self._supports_population and self.key in dict_:
|
1046
|
return dict_[self.key]
|
1047
|
else:
|
1048
|
try:
|
1049
|
state = instance_state(instance)
|
1050
|
except AttributeError as err:
|
1051
|
util.raise_(
|
1052
|
orm_exc.UnmappedInstanceError(instance),
|
1053
|
replace_context=err,
|
1054
|
)
|
1055
|
return self.impl.get(state, dict_)</code></pre>
|
1056
|
</details>
|
1057
|
</dd>
|
1058
|
<dt id="sql_app.models.LDLog.timestamp"><code class="name">var <span class="ident">timestamp</span></code></dt>
|
1059
|
<dd>
|
1060
|
<div class="desc"></div>
|
1061
|
<details class="source">
|
1062
|
<summary>
|
1063
|
<span>Expand source code</span>
|
1064
|
</summary>
|
1065
|
<pre><code class="python">def __get__(self, instance, owner):
|
1066
|
if instance is None:
|
1067
|
return self
|
1068
|
|
1069
|
dict_ = instance_dict(instance)
|
1070
|
if self._supports_population and self.key in dict_:
|
1071
|
return dict_[self.key]
|
1072
|
else:
|
1073
|
try:
|
1074
|
state = instance_state(instance)
|
1075
|
except AttributeError as err:
|
1076
|
util.raise_(
|
1077
|
orm_exc.UnmappedInstanceError(instance),
|
1078
|
replace_context=err,
|
1079
|
)
|
1080
|
return self.impl.get(state, dict_)</code></pre>
|
1081
|
</details>
|
1082
|
</dd>
|
1083
|
</dl>
|
1084
|
</dd>
|
1085
|
<dt id="sql_app.models.License"><code class="flex name class">
|
1086
|
<span>class <span class="ident">License</span></span>
|
1087
|
<span>(</span><span>**kwargs)</span>
|
1088
|
</code></dt>
|
1089
|
<dd>
|
1090
|
<div class="desc"><p>Class defining database table licenses</p>
|
1091
|
<p>A simple constructor that allows initialization from kwargs.</p>
|
1092
|
<p>Sets attributes on the constructed instance using the names and
|
1093
|
values in <code>kwargs</code>.</p>
|
1094
|
<p>Only keys that are present as
|
1095
|
attributes of the instance's class are allowed. These could be,
|
1096
|
for example, any mapped columns or relationships.</p></div>
|
1097
|
<details class="source">
|
1098
|
<summary>
|
1099
|
<span>Expand source code</span>
|
1100
|
</summary>
|
1101
|
<pre><code class="python">class License(Base):
|
1102
|
"""
|
1103
|
Class defining database table licenses
|
1104
|
"""
|
1105
|
__tablename__ = "licenses"
|
1106
|
|
1107
|
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())
|
1110
|
|
1111
|
# relationships for foreign keys, thus connecting table with devices table
|
1112
|
devices = relationship("DeviceLicense", back_populates="licenses")</code></pre>
|
1113
|
</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>
|
1121
|
<dd>
|
1122
|
<div class="desc"></div>
|
1123
|
<details class="source">
|
1124
|
<summary>
|
1125
|
<span>Expand source code</span>
|
1126
|
</summary>
|
1127
|
<pre><code class="python">def __get__(self, instance, owner):
|
1128
|
if instance is None:
|
1129
|
return self
|
1130
|
|
1131
|
dict_ = instance_dict(instance)
|
1132
|
if self._supports_population and self.key in dict_:
|
1133
|
return dict_[self.key]
|
1134
|
else:
|
1135
|
try:
|
1136
|
state = instance_state(instance)
|
1137
|
except AttributeError as err:
|
1138
|
util.raise_(
|
1139
|
orm_exc.UnmappedInstanceError(instance),
|
1140
|
replace_context=err,
|
1141
|
)
|
1142
|
return self.impl.get(state, dict_)</code></pre>
|
1143
|
</details>
|
1144
|
</dd>
|
1145
|
<dt id="sql_app.models.License.expiration_date"><code class="name">var <span class="ident">expiration_date</span></code></dt>
|
1146
|
<dd>
|
1147
|
<div class="desc"></div>
|
1148
|
<details class="source">
|
1149
|
<summary>
|
1150
|
<span>Expand source code</span>
|
1151
|
</summary>
|
1152
|
<pre><code class="python">def __get__(self, instance, owner):
|
1153
|
if instance is None:
|
1154
|
return self
|
1155
|
|
1156
|
dict_ = instance_dict(instance)
|
1157
|
if self._supports_population and self.key in dict_:
|
1158
|
return dict_[self.key]
|
1159
|
else:
|
1160
|
try:
|
1161
|
state = instance_state(instance)
|
1162
|
except AttributeError as err:
|
1163
|
util.raise_(
|
1164
|
orm_exc.UnmappedInstanceError(instance),
|
1165
|
replace_context=err,
|
1166
|
)
|
1167
|
return self.impl.get(state, dict_)</code></pre>
|
1168
|
</details>
|
1169
|
</dd>
|
1170
|
<dt id="sql_app.models.License.id"><code class="name">var <span class="ident">id</span></code></dt>
|
1171
|
<dd>
|
1172
|
<div class="desc"></div>
|
1173
|
<details class="source">
|
1174
|
<summary>
|
1175
|
<span>Expand source code</span>
|
1176
|
</summary>
|
1177
|
<pre><code class="python">def __get__(self, instance, owner):
|
1178
|
if instance is None:
|
1179
|
return self
|
1180
|
|
1181
|
dict_ = instance_dict(instance)
|
1182
|
if self._supports_population and self.key in dict_:
|
1183
|
return dict_[self.key]
|
1184
|
else:
|
1185
|
try:
|
1186
|
state = instance_state(instance)
|
1187
|
except AttributeError as err:
|
1188
|
util.raise_(
|
1189
|
orm_exc.UnmappedInstanceError(instance),
|
1190
|
replace_context=err,
|
1191
|
)
|
1192
|
return self.impl.get(state, dict_)</code></pre>
|
1193
|
</details>
|
1194
|
</dd>
|
1195
|
<dt id="sql_app.models.License.name"><code class="name">var <span class="ident">name</span></code></dt>
|
1196
|
<dd>
|
1197
|
<div class="desc"></div>
|
1198
|
<details class="source">
|
1199
|
<summary>
|
1200
|
<span>Expand source code</span>
|
1201
|
</summary>
|
1202
|
<pre><code class="python">def __get__(self, instance, owner):
|
1203
|
if instance is None:
|
1204
|
return self
|
1205
|
|
1206
|
dict_ = instance_dict(instance)
|
1207
|
if self._supports_population and self.key in dict_:
|
1208
|
return dict_[self.key]
|
1209
|
else:
|
1210
|
try:
|
1211
|
state = instance_state(instance)
|
1212
|
except AttributeError as err:
|
1213
|
util.raise_(
|
1214
|
orm_exc.UnmappedInstanceError(instance),
|
1215
|
replace_context=err,
|
1216
|
)
|
1217
|
return self.impl.get(state, dict_)</code></pre>
|
1218
|
</details>
|
1219
|
</dd>
|
1220
|
</dl>
|
1221
|
</dd>
|
1222
|
<dt id="sql_app.models.PC"><code class="flex name class">
|
1223
|
<span>class <span class="ident">PC</span></span>
|
1224
|
<span>(</span><span>**kwargs)</span>
|
1225
|
</code></dt>
|
1226
|
<dd>
|
1227
|
<div class="desc"><p>Class defining database table pc</p>
|
1228
|
<p>A simple constructor that allows initialization from kwargs.</p>
|
1229
|
<p>Sets attributes on the constructed instance using the names and
|
1230
|
values in <code>kwargs</code>.</p>
|
1231
|
<p>Only keys that are present as
|
1232
|
attributes of the instance's class are allowed. These could be,
|
1233
|
for example, any mapped columns or relationships.</p></div>
|
1234
|
<details class="source">
|
1235
|
<summary>
|
1236
|
<span>Expand source code</span>
|
1237
|
</summary>
|
1238
|
<pre><code class="python">class PC(Base):
|
1239
|
"""
|
1240
|
Class defining database table pc
|
1241
|
"""
|
1242
|
__tablename__ = "pc"
|
1243
|
|
1244
|
id = Column(Integer, primary_key=True, index=True)
|
1245
|
username = Column(String, index=True, nullable=False)
|
1246
|
hostname = Column(String, index=True, nullable=False)
|
1247
|
assigned = Column(Boolean, index=True, nullable=False)
|
1248
|
team_id = Column(Integer, ForeignKey("teams.id"))
|
1249
|
|
1250
|
# relationships for foreign keys, thus connecting table with teams, usb_logs and ld_logs
|
1251
|
# tables
|
1252
|
team = relationship("Team", back_populates="pcs")
|
1253
|
logs_pc = relationship("USBLog", back_populates="pc")
|
1254
|
ld_pc = relationship("LDLog", back_populates="ldpc")</code></pre>
|
1255
|
</details>
|
1256
|
<h3>Ancestors</h3>
|
1257
|
<ul class="hlist">
|
1258
|
<li>sqlalchemy.orm.decl_api.Base</li>
|
1259
|
</ul>
|
1260
|
<h3>Instance variables</h3>
|
1261
|
<dl>
|
1262
|
<dt id="sql_app.models.PC.assigned"><code class="name">var <span class="ident">assigned</span></code></dt>
|
1263
|
<dd>
|
1264
|
<div class="desc"></div>
|
1265
|
<details class="source">
|
1266
|
<summary>
|
1267
|
<span>Expand source code</span>
|
1268
|
</summary>
|
1269
|
<pre><code class="python">def __get__(self, instance, owner):
|
1270
|
if instance is None:
|
1271
|
return self
|
1272
|
|
1273
|
dict_ = instance_dict(instance)
|
1274
|
if self._supports_population and self.key in dict_:
|
1275
|
return dict_[self.key]
|
1276
|
else:
|
1277
|
try:
|
1278
|
state = instance_state(instance)
|
1279
|
except AttributeError as err:
|
1280
|
util.raise_(
|
1281
|
orm_exc.UnmappedInstanceError(instance),
|
1282
|
replace_context=err,
|
1283
|
)
|
1284
|
return self.impl.get(state, dict_)</code></pre>
|
1285
|
</details>
|
1286
|
</dd>
|
1287
|
<dt id="sql_app.models.PC.hostname"><code class="name">var <span class="ident">hostname</span></code></dt>
|
1288
|
<dd>
|
1289
|
<div class="desc"></div>
|
1290
|
<details class="source">
|
1291
|
<summary>
|
1292
|
<span>Expand source code</span>
|
1293
|
</summary>
|
1294
|
<pre><code class="python">def __get__(self, instance, owner):
|
1295
|
if instance is None:
|
1296
|
return self
|
1297
|
|
1298
|
dict_ = instance_dict(instance)
|
1299
|
if self._supports_population and self.key in dict_:
|
1300
|
return dict_[self.key]
|
1301
|
else:
|
1302
|
try:
|
1303
|
state = instance_state(instance)
|
1304
|
except AttributeError as err:
|
1305
|
util.raise_(
|
1306
|
orm_exc.UnmappedInstanceError(instance),
|
1307
|
replace_context=err,
|
1308
|
)
|
1309
|
return self.impl.get(state, dict_)</code></pre>
|
1310
|
</details>
|
1311
|
</dd>
|
1312
|
<dt id="sql_app.models.PC.id"><code class="name">var <span class="ident">id</span></code></dt>
|
1313
|
<dd>
|
1314
|
<div class="desc"></div>
|
1315
|
<details class="source">
|
1316
|
<summary>
|
1317
|
<span>Expand source code</span>
|
1318
|
</summary>
|
1319
|
<pre><code class="python">def __get__(self, instance, owner):
|
1320
|
if instance is None:
|
1321
|
return self
|
1322
|
|
1323
|
dict_ = instance_dict(instance)
|
1324
|
if self._supports_population and self.key in dict_:
|
1325
|
return dict_[self.key]
|
1326
|
else:
|
1327
|
try:
|
1328
|
state = instance_state(instance)
|
1329
|
except AttributeError as err:
|
1330
|
util.raise_(
|
1331
|
orm_exc.UnmappedInstanceError(instance),
|
1332
|
replace_context=err,
|
1333
|
)
|
1334
|
return self.impl.get(state, dict_)</code></pre>
|
1335
|
</details>
|
1336
|
</dd>
|
1337
|
<dt id="sql_app.models.PC.ld_pc"><code class="name">var <span class="ident">ld_pc</span></code></dt>
|
1338
|
<dd>
|
1339
|
<div class="desc"></div>
|
1340
|
<details class="source">
|
1341
|
<summary>
|
1342
|
<span>Expand source code</span>
|
1343
|
</summary>
|
1344
|
<pre><code class="python">def __get__(self, instance, owner):
|
1345
|
if instance is None:
|
1346
|
return self
|
1347
|
|
1348
|
dict_ = instance_dict(instance)
|
1349
|
if self._supports_population and self.key in dict_:
|
1350
|
return dict_[self.key]
|
1351
|
else:
|
1352
|
try:
|
1353
|
state = instance_state(instance)
|
1354
|
except AttributeError as err:
|
1355
|
util.raise_(
|
1356
|
orm_exc.UnmappedInstanceError(instance),
|
1357
|
replace_context=err,
|
1358
|
)
|
1359
|
return self.impl.get(state, dict_)</code></pre>
|
1360
|
</details>
|
1361
|
</dd>
|
1362
|
<dt id="sql_app.models.PC.logs_pc"><code class="name">var <span class="ident">logs_pc</span></code></dt>
|
1363
|
<dd>
|
1364
|
<div class="desc"></div>
|
1365
|
<details class="source">
|
1366
|
<summary>
|
1367
|
<span>Expand source code</span>
|
1368
|
</summary>
|
1369
|
<pre><code class="python">def __get__(self, instance, owner):
|
1370
|
if instance is None:
|
1371
|
return self
|
1372
|
|
1373
|
dict_ = instance_dict(instance)
|
1374
|
if self._supports_population and self.key in dict_:
|
1375
|
return dict_[self.key]
|
1376
|
else:
|
1377
|
try:
|
1378
|
state = instance_state(instance)
|
1379
|
except AttributeError as err:
|
1380
|
util.raise_(
|
1381
|
orm_exc.UnmappedInstanceError(instance),
|
1382
|
replace_context=err,
|
1383
|
)
|
1384
|
return self.impl.get(state, dict_)</code></pre>
|
1385
|
</details>
|
1386
|
</dd>
|
1387
|
<dt id="sql_app.models.PC.team"><code class="name">var <span class="ident">team</span></code></dt>
|
1388
|
<dd>
|
1389
|
<div class="desc"></div>
|
1390
|
<details class="source">
|
1391
|
<summary>
|
1392
|
<span>Expand source code</span>
|
1393
|
</summary>
|
1394
|
<pre><code class="python">def __get__(self, instance, owner):
|
1395
|
if instance is None:
|
1396
|
return self
|
1397
|
|
1398
|
dict_ = instance_dict(instance)
|
1399
|
if self._supports_population and self.key in dict_:
|
1400
|
return dict_[self.key]
|
1401
|
else:
|
1402
|
try:
|
1403
|
state = instance_state(instance)
|
1404
|
except AttributeError as err:
|
1405
|
util.raise_(
|
1406
|
orm_exc.UnmappedInstanceError(instance),
|
1407
|
replace_context=err,
|
1408
|
)
|
1409
|
return self.impl.get(state, dict_)</code></pre>
|
1410
|
</details>
|
1411
|
</dd>
|
1412
|
<dt id="sql_app.models.PC.team_id"><code class="name">var <span class="ident">team_id</span></code></dt>
|
1413
|
<dd>
|
1414
|
<div class="desc"></div>
|
1415
|
<details class="source">
|
1416
|
<summary>
|
1417
|
<span>Expand source code</span>
|
1418
|
</summary>
|
1419
|
<pre><code class="python">def __get__(self, instance, owner):
|
1420
|
if instance is None:
|
1421
|
return self
|
1422
|
|
1423
|
dict_ = instance_dict(instance)
|
1424
|
if self._supports_population and self.key in dict_:
|
1425
|
return dict_[self.key]
|
1426
|
else:
|
1427
|
try:
|
1428
|
state = instance_state(instance)
|
1429
|
except AttributeError as err:
|
1430
|
util.raise_(
|
1431
|
orm_exc.UnmappedInstanceError(instance),
|
1432
|
replace_context=err,
|
1433
|
)
|
1434
|
return self.impl.get(state, dict_)</code></pre>
|
1435
|
</details>
|
1436
|
</dd>
|
1437
|
<dt id="sql_app.models.PC.username"><code class="name">var <span class="ident">username</span></code></dt>
|
1438
|
<dd>
|
1439
|
<div class="desc"></div>
|
1440
|
<details class="source">
|
1441
|
<summary>
|
1442
|
<span>Expand source code</span>
|
1443
|
</summary>
|
1444
|
<pre><code class="python">def __get__(self, instance, owner):
|
1445
|
if instance is None:
|
1446
|
return self
|
1447
|
|
1448
|
dict_ = instance_dict(instance)
|
1449
|
if self._supports_population and self.key in dict_:
|
1450
|
return dict_[self.key]
|
1451
|
else:
|
1452
|
try:
|
1453
|
state = instance_state(instance)
|
1454
|
except AttributeError as err:
|
1455
|
util.raise_(
|
1456
|
orm_exc.UnmappedInstanceError(instance),
|
1457
|
replace_context=err,
|
1458
|
)
|
1459
|
return self.impl.get(state, dict_)</code></pre>
|
1460
|
</details>
|
1461
|
</dd>
|
1462
|
</dl>
|
1463
|
</dd>
|
1464
|
<dt id="sql_app.models.Team"><code class="flex name class">
|
1465
|
<span>class <span class="ident">Team</span></span>
|
1466
|
<span>(</span><span>**kwargs)</span>
|
1467
|
</code></dt>
|
1468
|
<dd>
|
1469
|
<div class="desc"><p>Class defining database table teams</p>
|
1470
|
<p>A simple constructor that allows initialization from kwargs.</p>
|
1471
|
<p>Sets attributes on the constructed instance using the names and
|
1472
|
values in <code>kwargs</code>.</p>
|
1473
|
<p>Only keys that are present as
|
1474
|
attributes of the instance's class are allowed. These could be,
|
1475
|
for example, any mapped columns or relationships.</p></div>
|
1476
|
<details class="source">
|
1477
|
<summary>
|
1478
|
<span>Expand source code</span>
|
1479
|
</summary>
|
1480
|
<pre><code class="python">class Team(Base):
|
1481
|
"""
|
1482
|
Class defining database table teams
|
1483
|
"""
|
1484
|
__tablename__ = "teams"
|
1485
|
|
1486
|
id = Column(Integer, primary_key=True, index=True)
|
1487
|
name = Column(String, index=True, nullable=False)
|
1488
|
|
1489
|
# relationships for foreign keys, thus connecting table with pc table
|
1490
|
pcs = relationship("PC", back_populates="team")</code></pre>
|
1491
|
</details>
|
1492
|
<h3>Ancestors</h3>
|
1493
|
<ul class="hlist">
|
1494
|
<li>sqlalchemy.orm.decl_api.Base</li>
|
1495
|
</ul>
|
1496
|
<h3>Instance variables</h3>
|
1497
|
<dl>
|
1498
|
<dt id="sql_app.models.Team.id"><code class="name">var <span class="ident">id</span></code></dt>
|
1499
|
<dd>
|
1500
|
<div class="desc"></div>
|
1501
|
<details class="source">
|
1502
|
<summary>
|
1503
|
<span>Expand source code</span>
|
1504
|
</summary>
|
1505
|
<pre><code class="python">def __get__(self, instance, owner):
|
1506
|
if instance is None:
|
1507
|
return self
|
1508
|
|
1509
|
dict_ = instance_dict(instance)
|
1510
|
if self._supports_population and self.key in dict_:
|
1511
|
return dict_[self.key]
|
1512
|
else:
|
1513
|
try:
|
1514
|
state = instance_state(instance)
|
1515
|
except AttributeError as err:
|
1516
|
util.raise_(
|
1517
|
orm_exc.UnmappedInstanceError(instance),
|
1518
|
replace_context=err,
|
1519
|
)
|
1520
|
return self.impl.get(state, dict_)</code></pre>
|
1521
|
</details>
|
1522
|
</dd>
|
1523
|
<dt id="sql_app.models.Team.name"><code class="name">var <span class="ident">name</span></code></dt>
|
1524
|
<dd>
|
1525
|
<div class="desc"></div>
|
1526
|
<details class="source">
|
1527
|
<summary>
|
1528
|
<span>Expand source code</span>
|
1529
|
</summary>
|
1530
|
<pre><code class="python">def __get__(self, instance, owner):
|
1531
|
if instance is None:
|
1532
|
return self
|
1533
|
|
1534
|
dict_ = instance_dict(instance)
|
1535
|
if self._supports_population and self.key in dict_:
|
1536
|
return dict_[self.key]
|
1537
|
else:
|
1538
|
try:
|
1539
|
state = instance_state(instance)
|
1540
|
except AttributeError as err:
|
1541
|
util.raise_(
|
1542
|
orm_exc.UnmappedInstanceError(instance),
|
1543
|
replace_context=err,
|
1544
|
)
|
1545
|
return self.impl.get(state, dict_)</code></pre>
|
1546
|
</details>
|
1547
|
</dd>
|
1548
|
<dt id="sql_app.models.Team.pcs"><code class="name">var <span class="ident">pcs</span></code></dt>
|
1549
|
<dd>
|
1550
|
<div class="desc"></div>
|
1551
|
<details class="source">
|
1552
|
<summary>
|
1553
|
<span>Expand source code</span>
|
1554
|
</summary>
|
1555
|
<pre><code class="python">def __get__(self, instance, owner):
|
1556
|
if instance is None:
|
1557
|
return self
|
1558
|
|
1559
|
dict_ = instance_dict(instance)
|
1560
|
if self._supports_population and self.key in dict_:
|
1561
|
return dict_[self.key]
|
1562
|
else:
|
1563
|
try:
|
1564
|
state = instance_state(instance)
|
1565
|
except AttributeError as err:
|
1566
|
util.raise_(
|
1567
|
orm_exc.UnmappedInstanceError(instance),
|
1568
|
replace_context=err,
|
1569
|
)
|
1570
|
return self.impl.get(state, dict_)</code></pre>
|
1571
|
</details>
|
1572
|
</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>
|
1579
|
<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>
|
1587
|
<details class="source">
|
1588
|
<summary>
|
1589
|
<span>Expand source code</span>
|
1590
|
</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"))
|
1602
|
|
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>
|
1607
|
</details>
|
1608
|
<h3>Ancestors</h3>
|
1609
|
<ul class="hlist">
|
1610
|
<li>sqlalchemy.orm.decl_api.Base</li>
|
1611
|
</ul>
|
1612
|
<h3>Instance variables</h3>
|
1613
|
<dl>
|
1614
|
<dt id="sql_app.models.USBLog.device"><code class="name">var <span class="ident">device</span></code></dt>
|
1615
|
<dd>
|
1616
|
<div class="desc"></div>
|
1617
|
<details class="source">
|
1618
|
<summary>
|
1619
|
<span>Expand source code</span>
|
1620
|
</summary>
|
1621
|
<pre><code class="python">def __get__(self, instance, owner):
|
1622
|
if instance is None:
|
1623
|
return self
|
1624
|
|
1625
|
dict_ = instance_dict(instance)
|
1626
|
if self._supports_population and self.key in dict_:
|
1627
|
return dict_[self.key]
|
1628
|
else:
|
1629
|
try:
|
1630
|
state = instance_state(instance)
|
1631
|
except AttributeError as err:
|
1632
|
util.raise_(
|
1633
|
orm_exc.UnmappedInstanceError(instance),
|
1634
|
replace_context=err,
|
1635
|
)
|
1636
|
return self.impl.get(state, dict_)</code></pre>
|
1637
|
</details>
|
1638
|
</dd>
|
1639
|
<dt id="sql_app.models.USBLog.device_id"><code class="name">var <span class="ident">device_id</span></code></dt>
|
1640
|
<dd>
|
1641
|
<div class="desc"></div>
|
1642
|
<details class="source">
|
1643
|
<summary>
|
1644
|
<span>Expand source code</span>
|
1645
|
</summary>
|
1646
|
<pre><code class="python">def __get__(self, instance, owner):
|
1647
|
if instance is None:
|
1648
|
return self
|
1649
|
|
1650
|
dict_ = instance_dict(instance)
|
1651
|
if self._supports_population and self.key in dict_:
|
1652
|
return dict_[self.key]
|
1653
|
else:
|
1654
|
try:
|
1655
|
state = instance_state(instance)
|
1656
|
except AttributeError as err:
|
1657
|
util.raise_(
|
1658
|
orm_exc.UnmappedInstanceError(instance),
|
1659
|
replace_context=err,
|
1660
|
)
|
1661
|
return self.impl.get(state, dict_)</code></pre>
|
1662
|
</details>
|
1663
|
</dd>
|
1664
|
<dt id="sql_app.models.USBLog.id"><code class="name">var <span class="ident">id</span></code></dt>
|
1665
|
<dd>
|
1666
|
<div class="desc"></div>
|
1667
|
<details class="source">
|
1668
|
<summary>
|
1669
|
<span>Expand source code</span>
|
1670
|
</summary>
|
1671
|
<pre><code class="python">def __get__(self, instance, owner):
|
1672
|
if instance is None:
|
1673
|
return self
|
1674
|
|
1675
|
dict_ = instance_dict(instance)
|
1676
|
if self._supports_population and self.key in dict_:
|
1677
|
return dict_[self.key]
|
1678
|
else:
|
1679
|
try:
|
1680
|
state = instance_state(instance)
|
1681
|
except AttributeError as err:
|
1682
|
util.raise_(
|
1683
|
orm_exc.UnmappedInstanceError(instance),
|
1684
|
replace_context=err,
|
1685
|
)
|
1686
|
return self.impl.get(state, dict_)</code></pre>
|
1687
|
</details>
|
1688
|
</dd>
|
1689
|
<dt id="sql_app.models.USBLog.pc"><code class="name">var <span class="ident">pc</span></code></dt>
|
1690
|
<dd>
|
1691
|
<div class="desc"></div>
|
1692
|
<details class="source">
|
1693
|
<summary>
|
1694
|
<span>Expand source code</span>
|
1695
|
</summary>
|
1696
|
<pre><code class="python">def __get__(self, instance, owner):
|
1697
|
if instance is None:
|
1698
|
return self
|
1699
|
|
1700
|
dict_ = instance_dict(instance)
|
1701
|
if self._supports_population and self.key in dict_:
|
1702
|
return dict_[self.key]
|
1703
|
else:
|
1704
|
try:
|
1705
|
state = instance_state(instance)
|
1706
|
except AttributeError as err:
|
1707
|
util.raise_(
|
1708
|
orm_exc.UnmappedInstanceError(instance),
|
1709
|
replace_context=err,
|
1710
|
)
|
1711
|
return self.impl.get(state, dict_)</code></pre>
|
1712
|
</details>
|
1713
|
</dd>
|
1714
|
<dt id="sql_app.models.USBLog.pc_id"><code class="name">var <span class="ident">pc_id</span></code></dt>
|
1715
|
<dd>
|
1716
|
<div class="desc"></div>
|
1717
|
<details class="source">
|
1718
|
<summary>
|
1719
|
<span>Expand source code</span>
|
1720
|
</summary>
|
1721
|
<pre><code class="python">def __get__(self, instance, owner):
|
1722
|
if instance is None:
|
1723
|
return self
|
1724
|
|
1725
|
dict_ = instance_dict(instance)
|
1726
|
if self._supports_population and self.key in dict_:
|
1727
|
return dict_[self.key]
|
1728
|
else:
|
1729
|
try:
|
1730
|
state = instance_state(instance)
|
1731
|
except AttributeError as err:
|
1732
|
util.raise_(
|
1733
|
orm_exc.UnmappedInstanceError(instance),
|
1734
|
replace_context=err,
|
1735
|
)
|
1736
|
return self.impl.get(state, dict_)</code></pre>
|
1737
|
</details>
|
1738
|
</dd>
|
1739
|
<dt id="sql_app.models.USBLog.status"><code class="name">var <span class="ident">status</span></code></dt>
|
1740
|
<dd>
|
1741
|
<div class="desc"></div>
|
1742
|
<details class="source">
|
1743
|
<summary>
|
1744
|
<span>Expand source code</span>
|
1745
|
</summary>
|
1746
|
<pre><code class="python">def __get__(self, instance, owner):
|
1747
|
if instance is None:
|
1748
|
return self
|
1749
|
|
1750
|
dict_ = instance_dict(instance)
|
1751
|
if self._supports_population and self.key in dict_:
|
1752
|
return dict_[self.key]
|
1753
|
else:
|
1754
|
try:
|
1755
|
state = instance_state(instance)
|
1756
|
except AttributeError as err:
|
1757
|
util.raise_(
|
1758
|
orm_exc.UnmappedInstanceError(instance),
|
1759
|
replace_context=err,
|
1760
|
)
|
1761
|
return self.impl.get(state, dict_)</code></pre>
|
1762
|
</details>
|
1763
|
</dd>
|
1764
|
<dt id="sql_app.models.USBLog.timestamp"><code class="name">var <span class="ident">timestamp</span></code></dt>
|
1765
|
<dd>
|
1766
|
<div class="desc"></div>
|
1767
|
<details class="source">
|
1768
|
<summary>
|
1769
|
<span>Expand source code</span>
|
1770
|
</summary>
|
1771
|
<pre><code class="python">def __get__(self, instance, owner):
|
1772
|
if instance is None:
|
1773
|
return self
|
1774
|
|
1775
|
dict_ = instance_dict(instance)
|
1776
|
if self._supports_population and self.key in dict_:
|
1777
|
return dict_[self.key]
|
1778
|
else:
|
1779
|
try:
|
1780
|
state = instance_state(instance)
|
1781
|
except AttributeError as err:
|
1782
|
util.raise_(
|
1783
|
orm_exc.UnmappedInstanceError(instance),
|
1784
|
replace_context=err,
|
1785
|
)
|
1786
|
return self.impl.get(state, dict_)</code></pre>
|
1787
|
</details>
|
1788
|
</dd>
|
1789
|
</dl>
|
1790
|
</dd>
|
1791
|
</dl>
|
1792
|
</section>
|
1793
|
</article>
|
1794
|
<nav id="sidebar">
|
1795
|
<h1>Index</h1>
|
1796
|
<div class="toc">
|
1797
|
<ul></ul>
|
1798
|
</div>
|
1799
|
<ul id="index">
|
1800
|
<li><h3>Super-module</h3>
|
1801
|
<ul>
|
1802
|
<li><code><a title="sql_app" href="index.html">sql_app</a></code></li>
|
1803
|
</ul>
|
1804
|
</li>
|
1805
|
<li><h3><a href="#header-classes">Classes</a></h3>
|
1806
|
<ul>
|
1807
|
<li>
|
1808
|
<h4><code><a title="sql_app.models.BodyDevice" href="#sql_app.models.BodyDevice">BodyDevice</a></code></h4>
|
1809
|
<ul class="">
|
1810
|
<li><code><a title="sql_app.models.BodyDevice.b_logs" href="#sql_app.models.BodyDevice.b_logs">b_logs</a></code></li>
|
1811
|
<li><code><a title="sql_app.models.BodyDevice.id" href="#sql_app.models.BodyDevice.id">id</a></code></li>
|
1812
|
<li><code><a title="sql_app.models.BodyDevice.serial_number" href="#sql_app.models.BodyDevice.serial_number">serial_number</a></code></li>
|
1813
|
</ul>
|
1814
|
</li>
|
1815
|
<li>
|
1816
|
<h4><code><a title="sql_app.models.Device" href="#sql_app.models.Device">Device</a></code></h4>
|
1817
|
<ul class="two-column">
|
1818
|
<li><code><a title="sql_app.models.Device.assigned" href="#sql_app.models.Device.assigned">assigned</a></code></li>
|
1819
|
<li><code><a title="sql_app.models.Device.id" href="#sql_app.models.Device.id">id</a></code></li>
|
1820
|
<li><code><a title="sql_app.models.Device.licenses" href="#sql_app.models.Device.licenses">licenses</a></code></li>
|
1821
|
<li><code><a title="sql_app.models.Device.logs" href="#sql_app.models.Device.logs">logs</a></code></li>
|
1822
|
<li><code><a title="sql_app.models.Device.product_id" href="#sql_app.models.Device.product_id">product_id</a></code></li>
|
1823
|
<li><code><a title="sql_app.models.Device.serial_number" href="#sql_app.models.Device.serial_number">serial_number</a></code></li>
|
1824
|
<li><code><a title="sql_app.models.Device.vendor_id" href="#sql_app.models.Device.vendor_id">vendor_id</a></code></li>
|
1825
|
</ul>
|
1826
|
</li>
|
1827
|
<li>
|
1828
|
<h4><code><a title="sql_app.models.DeviceLicense" href="#sql_app.models.DeviceLicense">DeviceLicense</a></code></h4>
|
1829
|
<ul class="two-column">
|
1830
|
<li><code><a title="sql_app.models.DeviceLicense.assigned_datetime" href="#sql_app.models.DeviceLicense.assigned_datetime">assigned_datetime</a></code></li>
|
1831
|
<li><code><a title="sql_app.models.DeviceLicense.device_id" href="#sql_app.models.DeviceLicense.device_id">device_id</a></code></li>
|
1832
|
<li><code><a title="sql_app.models.DeviceLicense.device_lic" href="#sql_app.models.DeviceLicense.device_lic">device_lic</a></code></li>
|
1833
|
<li><code><a title="sql_app.models.DeviceLicense.id" href="#sql_app.models.DeviceLicense.id">id</a></code></li>
|
1834
|
<li><code><a title="sql_app.models.DeviceLicense.license_id" href="#sql_app.models.DeviceLicense.license_id">license_id</a></code></li>
|
1835
|
<li><code><a title="sql_app.models.DeviceLicense.licenses" href="#sql_app.models.DeviceLicense.licenses">licenses</a></code></li>
|
1836
|
</ul>
|
1837
|
</li>
|
1838
|
<li>
|
1839
|
<h4><code><a title="sql_app.models.HeadDevice" href="#sql_app.models.HeadDevice">HeadDevice</a></code></h4>
|
1840
|
<ul class="">
|
1841
|
<li><code><a title="sql_app.models.HeadDevice.h_logs" href="#sql_app.models.HeadDevice.h_logs">h_logs</a></code></li>
|
1842
|
<li><code><a title="sql_app.models.HeadDevice.id" href="#sql_app.models.HeadDevice.id">id</a></code></li>
|
1843
|
<li><code><a title="sql_app.models.HeadDevice.serial_number" href="#sql_app.models.HeadDevice.serial_number">serial_number</a></code></li>
|
1844
|
</ul>
|
1845
|
</li>
|
1846
|
<li>
|
1847
|
<h4><code><a title="sql_app.models.LDLog" href="#sql_app.models.LDLog">LDLog</a></code></h4>
|
1848
|
<ul class="two-column">
|
1849
|
<li><code><a title="sql_app.models.LDLog.body_device" href="#sql_app.models.LDLog.body_device">body_device</a></code></li>
|
1850
|
<li><code><a title="sql_app.models.LDLog.body_id" href="#sql_app.models.LDLog.body_id">body_id</a></code></li>
|
1851
|
<li><code><a title="sql_app.models.LDLog.head_device" href="#sql_app.models.LDLog.head_device">head_device</a></code></li>
|
1852
|
<li><code><a title="sql_app.models.LDLog.head_id" href="#sql_app.models.LDLog.head_id">head_id</a></code></li>
|
1853
|
<li><code><a title="sql_app.models.LDLog.id" href="#sql_app.models.LDLog.id">id</a></code></li>
|
1854
|
<li><code><a title="sql_app.models.LDLog.ldpc" href="#sql_app.models.LDLog.ldpc">ldpc</a></code></li>
|
1855
|
<li><code><a title="sql_app.models.LDLog.pc_id" href="#sql_app.models.LDLog.pc_id">pc_id</a></code></li>
|
1856
|
<li><code><a title="sql_app.models.LDLog.status" href="#sql_app.models.LDLog.status">status</a></code></li>
|
1857
|
<li><code><a title="sql_app.models.LDLog.timestamp" href="#sql_app.models.LDLog.timestamp">timestamp</a></code></li>
|
1858
|
</ul>
|
1859
|
</li>
|
1860
|
<li>
|
1861
|
<h4><code><a title="sql_app.models.License" href="#sql_app.models.License">License</a></code></h4>
|
1862
|
<ul class="">
|
1863
|
<li><code><a title="sql_app.models.License.devices" href="#sql_app.models.License.devices">devices</a></code></li>
|
1864
|
<li><code><a title="sql_app.models.License.expiration_date" href="#sql_app.models.License.expiration_date">expiration_date</a></code></li>
|
1865
|
<li><code><a title="sql_app.models.License.id" href="#sql_app.models.License.id">id</a></code></li>
|
1866
|
<li><code><a title="sql_app.models.License.name" href="#sql_app.models.License.name">name</a></code></li>
|
1867
|
</ul>
|
1868
|
</li>
|
1869
|
<li>
|
1870
|
<h4><code><a title="sql_app.models.PC" href="#sql_app.models.PC">PC</a></code></h4>
|
1871
|
<ul class="two-column">
|
1872
|
<li><code><a title="sql_app.models.PC.assigned" href="#sql_app.models.PC.assigned">assigned</a></code></li>
|
1873
|
<li><code><a title="sql_app.models.PC.hostname" href="#sql_app.models.PC.hostname">hostname</a></code></li>
|
1874
|
<li><code><a title="sql_app.models.PC.id" href="#sql_app.models.PC.id">id</a></code></li>
|
1875
|
<li><code><a title="sql_app.models.PC.ld_pc" href="#sql_app.models.PC.ld_pc">ld_pc</a></code></li>
|
1876
|
<li><code><a title="sql_app.models.PC.logs_pc" href="#sql_app.models.PC.logs_pc">logs_pc</a></code></li>
|
1877
|
<li><code><a title="sql_app.models.PC.team" href="#sql_app.models.PC.team">team</a></code></li>
|
1878
|
<li><code><a title="sql_app.models.PC.team_id" href="#sql_app.models.PC.team_id">team_id</a></code></li>
|
1879
|
<li><code><a title="sql_app.models.PC.username" href="#sql_app.models.PC.username">username</a></code></li>
|
1880
|
</ul>
|
1881
|
</li>
|
1882
|
<li>
|
1883
|
<h4><code><a title="sql_app.models.Team" href="#sql_app.models.Team">Team</a></code></h4>
|
1884
|
<ul class="">
|
1885
|
<li><code><a title="sql_app.models.Team.id" href="#sql_app.models.Team.id">id</a></code></li>
|
1886
|
<li><code><a title="sql_app.models.Team.name" href="#sql_app.models.Team.name">name</a></code></li>
|
1887
|
<li><code><a title="sql_app.models.Team.pcs" href="#sql_app.models.Team.pcs">pcs</a></code></li>
|
1888
|
</ul>
|
1889
|
</li>
|
1890
|
<li>
|
1891
|
<h4><code><a title="sql_app.models.USBLog" href="#sql_app.models.USBLog">USBLog</a></code></h4>
|
1892
|
<ul class="two-column">
|
1893
|
<li><code><a title="sql_app.models.USBLog.device" href="#sql_app.models.USBLog.device">device</a></code></li>
|
1894
|
<li><code><a title="sql_app.models.USBLog.device_id" href="#sql_app.models.USBLog.device_id">device_id</a></code></li>
|
1895
|
<li><code><a title="sql_app.models.USBLog.id" href="#sql_app.models.USBLog.id">id</a></code></li>
|
1896
|
<li><code><a title="sql_app.models.USBLog.pc" href="#sql_app.models.USBLog.pc">pc</a></code></li>
|
1897
|
<li><code><a title="sql_app.models.USBLog.pc_id" href="#sql_app.models.USBLog.pc_id">pc_id</a></code></li>
|
1898
|
<li><code><a title="sql_app.models.USBLog.status" href="#sql_app.models.USBLog.status">status</a></code></li>
|
1899
|
<li><code><a title="sql_app.models.USBLog.timestamp" href="#sql_app.models.USBLog.timestamp">timestamp</a></code></li>
|
1900
|
</ul>
|
1901
|
</li>
|
1902
|
</ul>
|
1903
|
</li>
|
1904
|
</ul>
|
1905
|
</nav>
|
1906
|
</main>
|
1907
|
<footer id="footer">
|
1908
|
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
1909
|
</footer>
|
1910
|
</body>
|
1911
|
</html>
|