Fix missing recursion constraint (issue1954)

This commit is contained in:
Max Holtzberg committed 2011-04-15 17:16:36 +02:00
1 parent e939a46ab4
commit 5baded9a0f
1 file changed
+7
+7
View File
@@ -16,6 +16,13 @@ class Category(ModelSQL, ModelView):
def __init__(self):
super(Category, self).__init__()
self._order.insert(0, ('name', 'ASC'))
self._constraints += [
('check_recursion', 'recursive_categories'),
]
self._error_messages.update({
'recursive_categories': 'You can not create recursive categories!',
})
def get_rec_name(self, ids, name):
if not ids: