# HG changeset patch # Parent 121bbfe120be3007f5e04611dbc27038abafcce8 Index: doc-backend/openacademy/models.py =================================================================== --- doc-backend.orig/openacademy/models.py 2014-08-24 12:17:23.789386299 +0200 +++ doc-backend/openacademy/models.py 2014-08-24 12:17:23.785386299 +0200 @@ -14,6 +14,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'