From 4985ad1b9e57f5bcdf0605a5a41d677445fd8485 Mon Sep 17 00:00:00 2001 From: resteve Date: Sat, 10 Jan 2015 21:42:25 +0100 Subject: [PATCH] Visibility --- tutorial.py | 9 +++++++++ view/tutorial_form.xml | 2 ++ view/tutorial_tree.xml | 1 + 3 files changed, 12 insertions(+) diff --git a/tutorial.py b/tutorial.py index 0466653..edd4423 100644 --- a/tutorial.py +++ b/tutorial.py @@ -31,6 +31,11 @@ class GalateaTutorial(ModelSQL, ModelView): metatitle = fields.Char('Meta Title', translate=True) active = fields.Boolean('Active', help='Dissable to not show content tutorial.') + visibility = fields.Selection([ + ('public','Public'), + ('register','Register'), + ('manager','Manager'), + ], 'Visibility', required=True) user = fields.Many2One('galatea.user', 'User', required=True) websites = fields.Many2Many('galatea.tutorial-galatea.website', 'tutorial', 'website', 'Websites', @@ -45,6 +50,10 @@ class GalateaTutorial(ModelSQL, ModelView): def default_active(): return True + @staticmethod + def default_visibility(): + return 'public' + @staticmethod def default_websites(): Website = Pool().get('galatea.website') diff --git a/view/tutorial_form.xml b/view/tutorial_form.xml index 24ca067..77ca8e1 100644 --- a/view/tutorial_form.xml +++ b/view/tutorial_form.xml @@ -25,6 +25,8 @@ this repository contains the full copyright notices and license terms. --> +