diff --git a/beat/web/plotters/models.py b/beat/web/plotters/models.py index 03da7c3964bc78d9878b7ddeb20b675ca7877733..0396001a23124e48338d483f7b11c6806fed7d6e 100755 --- a/beat/web/plotters/models.py +++ b/beat/web/plotters/models.py @@ -50,6 +50,7 @@ from ..common.models import get_contribution_description_filename from ..code.models import Code from ..code.models import CodeManager from ..code.models import get_contribution_source_code_filename +from ..common.models import Shareable import simplejson import collections @@ -275,6 +276,15 @@ class PlotterParameter(Contribution): description = models.TextField(default='', blank=True, null=True, help_text=Messages['description']) plotter = models.ForeignKey(Plotter, related_name='plotting_parameters', null=True) + #_____ Methods __________ + + def modifiable(self): + """Can be modified if nobody points at me""" + return super(PlotterParameter, self).modifiable() and (self.defaults.count() == 0) + + def deletable(self): + """Can be deleted if nobody points at me""" + return super(PlotterParameter, self).deletable() and (self.defaults.count() == 0) and (self.sharing == Shareable.PRIVATE) #_____ Utilities __________