Commits

anti_social  committed a954eb9

Label can be callable.

  • Participants
  • Parent commits 4f802f8

Comments (0)

Files changed (1)

File wtforms/fields.py

     """
     def __init__(self, field_id, text):
         self.field_id = field_id
-        self.text = text
+        self._text = text
+
+    @property
+    def text(self):
+        return self._text() if callable(self._text) else self._text
 
     def __str__(self):
         return self()