aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask/model.py
diff options
context:
space:
mode:
authorSam2013-12-31 08:52:23 +0000
committerSam2013-12-31 08:52:23 +0000
commita9f63aadeeedb7c28bbcd16396c8c6e7d5cbbfd0 (patch)
treeaca928b31c4f0d7b9efac51a76b427690089fd76 /wqflask/wqflask/model.py
parent957ec58b605af421947335197ed09eddf72479a0 (diff)
downloadgenenetwork2-a9f63aadeeedb7c28bbcd16396c8c6e7d5cbbfd0.tar.gz
Finished code to remove a trait or multiple traits from a collection
Wrote code to make buttons a little cleaner and more obvious when dealing with collections (they now enable themselves when traits that can be added or removed to/from a collection are selected)
Diffstat (limited to 'wqflask/wqflask/model.py')
-rw-r--r--wqflask/wqflask/model.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/wqflask/wqflask/model.py b/wqflask/wqflask/model.py
index 192aedd0..e588e78a 100644
--- a/wqflask/wqflask/model.py
+++ b/wqflask/wqflask/model.py
@@ -10,6 +10,8 @@ from flask.ext.sqlalchemy import SQLAlchemy
from wqflask import app
+import sqlalchemy
+
from sqlalchemy import (Column, Integer, String, Table, ForeignKey, Unicode, Boolean, DateTime,
Text, Index)
from sqlalchemy.orm import relationship, backref
@@ -153,3 +155,7 @@ class UserCollection(Base):
def num_members(self):
print("members are:", json.loads(self.members))
return len(json.loads(self.members))
+
+
+ def members_as_set(self):
+ return set(json.loads(self.members))