diff options
| author | Raphael Collet <rco@openerp.com> | 2014-08-22 17:51:20 +0200 |
|---|---|---|
| committer | Raphael Collet <rco@openerp.com> | 2014-08-22 17:51:20 +0200 |
| commit | 2ad092b5e54fa39a906b38d9240e08b9800ea0da (patch) | |
| tree | 1879c2a6efe8ed1626d92635870aaff922306492 /doc/howtos/backend/exercise-constraint-sql | |
| parent | 97256fa1fba6c7d3d02962b5948158d17852cf43 (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-sql | 24 |
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' + |
