Commits

anti_social committed a954eb9

Label can be callable.

Comments (0)

Files changed (1)

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()