summaryrefslogtreecommitdiff
path: root/guard/model.py
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2015-05-09 00:07:35 +0200
committerYves Fischer <yvesf-git@xapek.org>2016-08-21 15:13:57 +0200
commite4e413ede34a2ae306ddd130324435d0e735f064 (patch)
treed6d438ee1702b8c3bd294baa415be6d6694b2698 /guard/model.py
downloadinfluxdb-guard-e4e413ede34a2ae306ddd130324435d0e735f064.tar.gz
influxdb-guard-e4e413ede34a2ae306ddd130324435d0e735f064.zip
influxdb-guard
Diffstat (limited to 'guard/model.py')
-rw-r--r--guard/model.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/guard/model.py b/guard/model.py
new file mode 100644
index 0000000..7372da0
--- /dev/null
+++ b/guard/model.py
@@ -0,0 +1,16 @@
+from datetime import datetime
+
+import peewee as p
+
+db = p.SqliteDatabase(None)
+
+
+class Access(p.Model):
+ class Meta:
+ database = db
+
+ id = p.PrimaryKeyField()
+ token = p.CharField(null=False, index=True)
+ pattern = p.CharField(null=False)
+ comment = p.CharField()
+ create_date = p.DateTimeField(default=datetime.now)