Ajout contrainte pour topic : name <> description
authorAlicia FLOREZ <alicflorez@gmail.com>
Thu, 21 Mar 2013 16:22:51 +0000 (17:22 +0100)
committerAlicia FLOREZ <alicflorez@gmail.com>
Thu, 21 Mar 2013 16:22:51 +0000 (17:22 +0100)
todolist.py

index cc15f7f..a25878f 100644 (file)
@@ -206,3 +206,12 @@ class Topic(osv.Model):
     _defaults = {
         "activated": "Active",
     }
+
+
+    _sql_constraints = [
+        (
+            "name_different_from_description_constraint",
+            "CHECK(name <> description)",
+            "Fields name and description should be different",
+        ),
+    ]