Skip to content

Instantly share code, notes, and snippets.

@gsathya
Created March 24, 2012 03:35
Show Gist options
  • Save gsathya/2177932 to your computer and use it in GitHub Desktop.
Save gsathya/2177932 to your computer and use it in GitHub Desktop.
From b92e68277fb207d9aad2482718235ee355d7a3ba Mon Sep 17 00:00:00 2001
From: Sathyanarayanan Gunasekaran <[email protected]>
Date: Sat, 24 Mar 2012 09:04:41 +0530
Subject: [PATCH] Add tag table
Add a tag table with link table to project_task table
---
modules/eden/msg.py | 43 +++++++++++++++++++++++++++----------------
1 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/modules/eden/msg.py b/modules/eden/msg.py
index f6a78d0..274ca2f 100644
--- a/modules/eden/msg.py
+++ b/modules/eden/msg.py
@@ -50,7 +50,7 @@ class S3MessagingModel(S3Model):
names = ["msg_log",
"msg_limit",
- #"msg_tag",
+ "msg_tag",
"msg_outbox",
#"msg_channel",
"msg_message_id",
@@ -134,21 +134,32 @@ class S3MessagingModel(S3Model):
# ---------------------------------------------------------------------
# Message Tag - Used to tag a message to a resource
- # tablename = "msg_tag"
- # table = self.define_table(tablename,
- # message_id(),
- # Field("resource"),
- # Field("record_uuid", # null in this field implies subscription to the entire resource
- # type=s3uuid,
- # length=128),
- # *s3.meta_fields())
-
- # self.configure(tablename,
- # list_fields=[ "id",
- # "message_id",
- # "record_uuid",
- # "resource",
- # ])
+ tablename = "msg_tag"
+ table = self.define_table(tablename,
+ message_id(),
+ Field("resource"),
+ Field("record_uuid", null in this field implies subscription to the entire resource
+ type=s3uuid,
+ length=128),
+ *s3.meta_fields())
+
+ self.configure(tablename,
+ list_fields=[ "id",
+ "message_id",
+ "record_uuid",
+ "resource",
+ ])
+
+
+ self.add_component("project_task",
+ event_event=Storage(
+ link="msg_task",
+ joinby="msg_id",
+ key="task_id",
+ actuate="link",
+ autocomplete="name",
+ autodelete=False))
+
# ---------------------------------------------------------------------
# Outbound Messages
--
1.7.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment