aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/anon_collection.py
diff options
context:
space:
mode:
authorZachary Sloan2014-05-05 17:09:24 +0000
committerZachary Sloan2014-05-05 17:09:24 +0000
commit759a7a23b0ea848b8c8ffe2804841322254d8696 (patch)
treef2994e8228c96cb8dbf39e69a34dedf65acc6f14 /wqflask/base/anon_collection.py
parentd2454fe1306b298d5b7a4dd349a4f26ebc7307a2 (diff)
downloadgenenetwork2-759a7a23b0ea848b8c8ffe2804841322254d8696.tar.gz
Committing a bunch of changes related to integrating GEMMA and
adding the correlation matrix page
Diffstat (limited to 'wqflask/base/anon_collection.py')
-rwxr-xr-xwqflask/base/anon_collection.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/wqflask/base/anon_collection.py b/wqflask/base/anon_collection.py
new file mode 100755
index 00000000..8ee73296
--- /dev/null
+++ b/wqflask/base/anon_collection.py
@@ -0,0 +1,21 @@
+class AnonCollection(TraitCollection):
+
+ def __init__(self, anon_id)
+ self.anon_id = anon_id
+ self.collection_members = Redis.smembers(self.anon_id)
+ print("self.collection_members is:", self.collection_members)
+ self.num_members = len(self.collection_members)
+
+
+ @app.route("/collections/remove", methods=('POST',))
+ def remove_traits(traits_to_remove):
+ print("traits_to_remove:", traits_to_remove)
+ for trait in traits_to_remove:
+ Redis.srem(self.anon_id, trait)
+ members_now = self.collection_members - traits_to_remove
+ print("members_now:", members_now)
+ print("Went from {} to {} members in set.".format(len(self.collection_members), len(members_now)))
+
+ # We need to return something so we'll return this...maybe in the future
+ # we can use it to check the results
+ return str(len(members_now))