Update: revert
This commit is contained in:
parent
a5f8ba7a84
commit
66fe84e3eb
7 changed files with 45 additions and 39 deletions
33
backend/application/logs_model.py
Normal file
33
backend/application/logs_model.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
from . import db
|
||||
|
||||
|
||||
class Logs(db.Model):
|
||||
__bind_key__ = 'logs'
|
||||
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
date = db.Column(db.Date(), nullable=False)
|
||||
user = db.Column(db.String(), nullable=False)
|
||||
ip = db.Column(db.String(), nullable=False)
|
||||
table = db.Column(db.String(), nullable=False)
|
||||
action = db.Column(db.String(), nullable=False)
|
||||
status = db.Column(db.String(), nullable=False)
|
||||
status_code = db.Column(db.Integer, nullable=False)
|
||||
|
||||
def __init__(self, date, user, ip, table, action, status):
|
||||
self.date = date
|
||||
self.user = user
|
||||
self.ip = ip
|
||||
self.table = table
|
||||
self.action = action
|
||||
self.status = status
|
||||
|
||||
def __repr__(self):
|
||||
return {
|
||||
'id': self.id,
|
||||
'date': self.date,
|
||||
'user': self.user,
|
||||
'ip': self.ip,
|
||||
'table': self.table,
|
||||
'action': self.action,
|
||||
'status': self.status
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue