diff --git a/server/src/uds/REST/model.py b/server/src/uds/REST/model.py index bb671285e..4657093ee 100644 --- a/server/src/uds/REST/model.py +++ b/server/src/uds/REST/model.py @@ -54,7 +54,7 @@ import logging logger = logging.getLogger(__name__) -__updated__ = '2018-10-29' +__updated__ = '2018-11-05' # a few constants OVERVIEW = 'overview' @@ -896,7 +896,7 @@ class ModelHandler(BaseModelHandler): # Now if tags, update them if tags is not None: logger.debug('Updating tags: {}'.format(tags)) - item.tags.set([ Tag.objects.get_or_create(tag=val)[0] for val in tags]) + item.tags.set([ Tag.objects.get_or_create(tag=val)[0] for val in tags if val != '']) except self.model.DoesNotExist: raise NotFound('Item not found') diff --git a/server/src/uds/core/ui/UserInterface.py b/server/src/uds/core/ui/UserInterface.py index 4a7fddb10..d85fbcf2d 100644 --- a/server/src/uds/core/ui/UserInterface.py +++ b/server/src/uds/core/ui/UserInterface.py @@ -781,7 +781,7 @@ class UserInterfaceType(type): better place """ - def __new__(mcs, classname, bases, classDict): + def __new__(cls, classname, bases, classDict): newClassDict = {} _gui = {} # We will keep a reference to gui elements also at _gui so we can access them easily @@ -790,10 +790,10 @@ class UserInterfaceType(type): _gui[attrName] = attr newClassDict[attrName] = attr newClassDict['_gui'] = _gui - return type.__new__(mcs, classname, bases, newClassDict) + return type.__new__(cls, classname, bases, newClassDict) -#@six.add_metaclass(UserInterfaceType) +# @six.add_metaclass(UserInterfaceType) class UserInterface(object, metaclass=UserInterfaceType): """ This class provides the management for gui descriptions (user forms) diff --git a/server/src/uds/services/Sample/SampleProvider.py b/server/src/uds/services/Sample/SampleProvider.py index b7c93e360..434cb16a9 100644 --- a/server/src/uds/services/Sample/SampleProvider.py +++ b/server/src/uds/services/Sample/SampleProvider.py @@ -120,6 +120,15 @@ class Provider(ServiceProvider): defvalue=gui.TRUE # : By default, at new item, check this ) + methText = gui.TextField(order=5, + length=512, + multiline=5, + label=_('Text area'), + tooltip=_('This is a text area'), + requred=False, + defvalue='Write\nsomething' # : This will not get translated + ) + # There is more fields type, but not here the best place to cover it def initialize(self, values=None): """