Esempio n. 1
0
class DummyField:
    """
    Implement a very small subset of WTFormsField to encapsulate csrf tokens if no field is present (e. g. AJAX)

    """
    def __init__(self, data):
        self._translations = DummyTranslations()
        self.data = data

    def gettext(self, string):
        """
        Get a translation for the given message.
        This proxies for the internal translations object.
        :param string: A unicode string to be translated.
        :return: A unicode string which is the translated output.
        """
        return self._translations.gettext(string)
Esempio n. 2
0
class DummyField:
    """
    Implement a very small subset of WTFormsField to encapsulate csrf tokens if no field is present (e. g. AJAX)

    """

    def __init__(self, data):
        self._translations = DummyTranslations()
        self.data = data

    def gettext(self, string):
        """
        Get a translation for the given message.
        This proxies for the internal translations object.
        :param string: A unicode string to be translated.
        :return: A unicode string which is the translated output.
        """
        return self._translations.gettext(string)