Commits

Gael Pasgrimaud committed 6db1769

Backed out changeset cfea030658e6

  • Participants
  • Parent commits cfea030

Comments (0)

Files changed (2)

File formalchemy/forms.py

         return errors
     errors = property(errors)
 
+    def __repr__(self):
+        _fields = self._fields
+        conf = ''
+        if self._render_fields:
+            conf = ' (configured)'
+            _fields = self._render_fields
+        return '<%s%s with %r>' % (self.__class__.__name__, conf,
+                                   _fields.keys())
+
 
 class FieldSet(AbstractFieldSet):
     """

File formalchemy/tests/test_fieldset.py

 </div>
 
 >>> fs = FieldSet(Two)
+>>> fs
+<FieldSet with ['id', 'foo']>
 >>> fs.configure(pk=True)
+>>> fs
+<FieldSet (configured) with ['id', 'foo']>
 >>> print fs.render()
 <div>
  <label class="field_req" for="Two--id">