From b0e66de926eeca82a645d3140a5dd20efad99892 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 16 Jun 2016 09:56:09 +0200 Subject: [PATCH] common: add a real __repr__ method to Form --- eopayment/common.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eopayment/common.py b/eopayment/common.py index 0a5881f..6d6e073 100644 --- a/eopayment/common.py +++ b/eopayment/common.py @@ -124,6 +124,15 @@ class Form(object): self.submit_value = submit_value def __repr__(self): + s = '%s(' % self.__class__.__name__ + kwargs = [] + for k in ('url', 'method', 'fields', 'encoding', 'submit_name', 'submit_value'): + kwargs.append('%s=%r' % (k, getattr(self, k))) + s += ', '.join(kwargs) + s += ')' + return s + + def __str__(self): s = '
' % (self.method, self.url) for field in self.fields: s += '\n ' % (