Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
VT2 Видеотехнологии
ONVIF-PTZ proxy
Commits
5b315a8d
Commit
5b315a8d
authored
1 year ago
by
Mikhail Sennikov
Browse files
Options
Download
Patches
Plain Diff
Fix warmup
parent
4242af82
main
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
database/models/base.py
+4
-8
database/models/base.py
database/models/cams.py
+2
-2
database/models/cams.py
with
6 additions
and
10 deletions
+6
-10
database/models/base.py
+
4
−
8
View file @
5b315a8d
from
typing
import
Any
,
Dict
from
sqlalchemy.orm
import
declarative_base
from
sqlalchemy.orm
import
declarative_base
Base
=
declarative_base
()
class
Base
(
declarative_base
()):
def
to_dict
(
self
)
->
Dict
[
str
,
Any
]:
result
:
Dict
[
str
,
Any
]
=
{}
for
column
in
self
.
__table__
.
columns
:
result
[
column
.
name
]
=
getattr
(
self
,
column
.
name
)
return
result
class
SerializerMixin
:
def
to_dict
(
self
):
return
{
column
.
name
:
getattr
(
self
,
column
.
name
)
for
column
in
self
.
__table__
.
columns
}
This diff is collapsed.
Click to expand it.
database/models/cams.py
+
2
−
2
View file @
5b315a8d
from
sqlalchemy
import
Column
,
Integer
,
String
,
ForeignKey
,
\
from
sqlalchemy
import
Column
,
Integer
,
String
,
ForeignKey
,
\
Index
,
UniqueConstraint
Index
,
UniqueConstraint
from
.base
import
Base
from
.base
import
Base
,
SerializerMixin
class
Cam
(
Base
):
class
Cam
(
Base
,
SerializerMixin
):
__tablename__
=
'cams'
__tablename__
=
'cams'
id
:
Column
=
Column
(
Integer
,
primary_key
=
True
)
# Will make SERIAL
id
:
Column
=
Column
(
Integer
,
primary_key
=
True
)
# Will make SERIAL
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets