Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gsathya/2179019 to your computer and use it in GitHub Desktop.
Save gsathya/2179019 to your computer and use it in GitHub Desktop.
From 199ce7b8f86c815500c0621610daaa2b4fac04ba Mon Sep 17 00:00:00 2001
From: Sathyanarayanan Gunasekaran <[email protected]>
Date: Sat, 24 Mar 2012 11:55:39 +0530
Subject: [PATCH] Move foreign key to cms_resource_keywords
---
modules/eden/cms.py | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/modules/eden/cms.py b/modules/eden/cms.py
index 82d8d08..fa801ff 100644
--- a/modules/eden/cms.py
+++ b/modules/eden/cms.py
@@ -247,8 +247,6 @@ 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())
@@ -268,9 +266,8 @@ class S3ContentModel(S3Model):
tablename = "cms_resource_keyword"
table = self.define_table(tablename,
Field("keyword"),
- Field("keyword_id",
- type=s3uuid,
- length=128),
+ Field("keyword_id", "reference cms_keyword",
+ requires = IS_ONE_OF(db,"cms_keyword.id")),
Field("resource"),
Field("record_uuid",
type=s3uuid,
--
1.7.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment