aboutsummaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
Diffstat (limited to 'README')
-rw-r--r--README16
1 files changed, 16 insertions, 0 deletions
diff --git a/README b/README
index e41e07a..aa64a1f 100644
--- a/README
+++ b/README
@@ -220,4 +220,20 @@ the global factory, using a simple syntax : ``field__attr=42`` will set the attr
>>> e2.bar
'baz'
+Abstract factories
+------------------
+
+If a ``Factory`` simply defines generic attribute declarations without being bound to a given class,
+it should be marked 'abstract' by declaring ``ABSTRACT_FACTORY = True``.
+Such factories cannot be built/created/....
+
+
+ class AbstractFactory(factory.Factory):
+ ABSTRACT_FACTORY = True
+ foo = 'foo'
+
+ >>> AbstractFactory()
+ Traceback (most recent call last):
+ ...
+ AttributeError: type object 'AbstractFactory' has no attribute '_associated_class'