Created
March 24, 2012 06:15
-
-
Save gsathya/2178947 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 899259984355efc37fbd4f322267c7b13167866b Mon Sep 17 00:00:00 2001 | |
From: Sathyanarayanan Gunasekaran <[email protected]> | |
Date: Sat, 24 Mar 2012 11:44:45 +0530 | |
Subject: [PATCH 2/2] Fix message_id() and add foreign key | |
--- | |
modules/eden/cms.py | 8 +++++++- | |
1 files changed, 7 insertions(+), 1 deletions(-) | |
diff --git a/modules/eden/cms.py b/modules/eden/cms.py | |
index ab55620..82d8d08 100644 | |
--- a/modules/eden/cms.py | |
+++ b/modules/eden/cms.py | |
@@ -247,6 +247,8 @@ class S3ContentModel(S3Model): | |
tablename = "cms_keywords" | |
table = define_table(tablename, | |
+ Field("keyword_id", "reference cms_keyword", | |
+ requires = IS_ONE_OF(db,"cms_keyword.id")), | |
Field("keyword", "text", | |
notnull=True,) | |
*meta_fields()) | |
@@ -265,7 +267,10 @@ class S3ContentModel(S3Model): | |
tablename = "cms_resource_keyword" | |
table = self.define_table(tablename, | |
- message_id(), | |
+ Field("keyword"), | |
+ Field("keyword_id", | |
+ type=s3uuid, | |
+ length=128), | |
Field("resource"), | |
Field("record_uuid", | |
type=s3uuid, | |
@@ -274,6 +279,7 @@ class S3ContentModel(S3Model): | |
self.configure(tablename, | |
list_fields=[ "id", | |
+ "keyword" | |
"keyword_id", | |
"record_uuid", | |
"resource", | |
-- | |
1.7.6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment