summaryrefslogtreecommitdiff
path: root/opendc/models/job.py
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-08-08 12:04:45 +0300
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-08-08 12:04:45 +0300
commit958d67efbe6724d5b1b4cd56347e44464bc74d7d (patch)
tree691486278592e013fa83f9b5341f51eeadf14d42 /opendc/models/job.py
parent693a23d17c8783e51a97fd5a2439b5d1ceaa003c (diff)
Add job to models
Diffstat (limited to 'opendc/models/job.py')
-rw-r--r--opendc/models/job.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/opendc/models/job.py b/opendc/models/job.py
new file mode 100644
index 00000000..fb133a72
--- /dev/null
+++ b/opendc/models/job.py
@@ -0,0 +1,19 @@
+from opendc.models.model import Model
+
+class Job(Model):
+
+ JSON_TO_PYTHON_DICT = {
+ 'Job': {
+ 'id': 'id',
+ 'name': 'name'
+ }
+ }
+
+ TABLE_NAME = 'jobs'
+ COLUMNS = ['id', 'name']
+ COLUMNS_PRIMARY_KEY = ['id']
+
+ def google_id_has_at_least(self, google_id, authorization_level):
+ """Return True if the user has at least the given auth level over this Job."""
+
+ return authorization_level not in ['EDIT', 'OWN']