Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
evm-store
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanli
evm-store
Commits
c8ebc791
Commit
c8ebc791
authored
Jul 01, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
0f1c2144
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
backend/model/device.py
backend/model/device.py
+9
-1
backend/model/monitor.py
backend/model/monitor.py
+12
-1
No files found.
backend/model/device.py
View file @
c8ebc791
'''
Author: your name
Date: 2021-04-14 14:12:18
LastEditTime: 2021-07-01 17:54:11
LastEditors: your name
Description: In User Settings Edit
FilePath:
\
evm-store
\b
ackend
\
model
\
device.py
'''
#!/usr/bin/env python
# -*- coding: utf_8 -*-
import
uuid
from
datetime
import
datetime
from
pony.orm
import
PrimaryKey
,
Required
,
Optional
,
Set
,
LongStr
,
Json
from
pony.orm
import
PrimaryKey
,
Required
,
Optional
,
Set
from
app
import
config
from
.
import
fullStackDB
...
...
backend/model/monitor.py
View file @
c8ebc791
'''
Author: your name
Date: 2021-04-14 14:12:18
LastEditTime: 2021-0
6-30 23:52:39
LastEditTime: 2021-0
7-01 17:55:08
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath:
\
evm-store
\b
ackend
\
model
\
monitor.py
...
...
@@ -136,6 +136,17 @@ class Image(Base):
def
to_dict
(
self
):
return
{
c
.
name
:
getattr
(
self
,
c
.
name
)
for
c
in
self
.
__table__
.
columns
}
class
Device
(
Base
):
__tablename__
=
'monitor_system'
id
=
Column
(
Integer
,
primary_key
=
True
,
autoincrement
=
True
)
watch
=
Column
(
Integer
)
# 手表ID
free_size
=
Column
(
Integer
)
# 单位:字节
timestamp
=
Column
(
DateTime
(
timezone
=
True
),
default
=
get_current_datetime
,
server_default
=
func
.
now
(),
onupdate
=
func
.
now
())
def
to_dict
(
self
):
return
{
c
.
name
:
getattr
(
self
,
c
.
name
)
for
c
in
self
.
__table__
.
columns
}
Base
.
metadata
.
create_all
(
engine
,
checkfirst
=
True
)
# engine是2.2中创建的连接
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment