summaryrefslogtreecommitdiff
path: root/factory/base.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2012-01-12 23:21:38 +0100
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2012-01-12 23:21:38 +0100
commitc60c3106c700f5f42ad4fcf82f327da98ec5eb9e (patch)
tree570302046f68591b05a7178152c610917c71fe45 /factory/base.py
parent0c4b9334c93170ce6df17506f48e3937090aec05 (diff)
downloadfactory-boy-c60c3106c700f5f42ad4fcf82f327da98ec5eb9e.tar
factory-boy-c60c3106c700f5f42ad4fcf82f327da98ec5eb9e.tar.gz
Add __repr__ / __str__ to a couple of objects.
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Diffstat (limited to 'factory/base.py')
-rw-r--r--factory/base.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/factory/base.py b/factory/base.py
index 19d441b..b2f437d 100644
--- a/factory/base.py
+++ b/factory/base.py
@@ -341,6 +341,10 @@ class Factory(BaseFactory):
# from turning it into an instance method.
_creation_function = (DJANGO_CREATION,)
+ def __str__(self):
+ return '<%s for %s>' % (self.__class__.__name__,
+ getattr(self, CLASS_ATTRIBUTE_ASSOCIATED_CLASS).__name__)
+
@classmethod
def set_creation_function(cls, creation_function):
"""Set the creation function for this class.