-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
41 lines (31 loc) · 1.15 KB
/
Copy pathmodels.py
File metadata and controls
41 lines (31 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import datetime
from sqlalchemy import schema
from sqlalchemy import types
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
def now():
return datetime.datetime.now()
class Networks(Base):
__tablename__ = 'apptimized_networks'
id = schema.Column(types.Integer, primary_key=True)
bssid = schema.Column(types.String)
ssid = schema.Column(types.String)
date_added = schema.Column(types.DateTime, default=now)
enabled = schema.Column(types.Boolean)
def __init__(self, bssid, ssid, date_added, enabled):
self.bssid = bssid
self.ssid = ssid
self.date_added = date_added
self.enabled = enabled
class Applications(Base):
__tablename__ = 'apptimized_applications'
id = schema.Column(types.Integer, primary_key=True)
name = schema.Column(types.String)
path = schema.Column(types.String)
date_added = schema.Column(types.DateTime, default=now)
enabled = schema.Column(types.Boolean)
def __init__(self, name, path, date_added, enabled):
self.name = name
self.path = path
self.date_added = date_added
self.enabled = enabled