summaryrefslogtreecommitdiff
path: root/doc/howtos/backend/exercise-constraint-sql
diff options
context:
space:
mode:
authorRaphael Collet <rco@openerp.com>2014-08-22 17:51:20 +0200
committerRaphael Collet <rco@openerp.com>2014-08-22 17:51:20 +0200
commit2ad092b5e54fa39a906b38d9240e08b9800ea0da (patch)
tree1879c2a6efe8ed1626d92635870aaff922306492 /doc/howtos/backend/exercise-constraint-sql
parent97256fa1fba6c7d3d02962b5948158d17852cf43 (diff)
[ADD] doc: new documentation, with training tutorials, and new scaffolding
Diffstat (limited to 'doc/howtos/backend/exercise-constraint-sql')
-rw-r--r--doc/howtos/backend/exercise-constraint-sql24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/howtos/backend/exercise-constraint-sql b/doc/howtos/backend/exercise-constraint-sql
new file mode 100644
index 00000000000..2b6714a949e
--- /dev/null
+++ b/doc/howtos/backend/exercise-constraint-sql
@@ -0,0 +1,24 @@
+# HG changeset patch
+# Parent 121bbfe120be3007f5e04611dbc27038abafcce8
+
+Index: doc-backend/openacademy/course.py
+===================================================================
+--- doc-backend.orig/openacademy/course.py 2014-08-22 17:02:07.363103425 +0200
++++ doc-backend/openacademy/course.py 2014-08-22 17:02:07.359103425 +0200
+@@ -13,6 +13,16 @@
+ 'openacademy.session', 'course_id', string="Session")
+
+
++ _sql_constraints = [
++ ('name_description_check',
++ 'CHECK(name != description)',
++ "The title of the course should not be the description"),
++
++ ('name_unique',
++ 'UNIQUE(name)',
++ "The course title must be unique"),
++ ]
++
+ class Session(models.Model):
+ _name = 'openacademy.session'
+