aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2015-10-20 23:21:33 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2015-10-20 23:21:33 +0200
commit1e1adebe92397b405563dc141c853f62feca6c82 (patch)
tree0cf22a36e6594e9c766e5e8a5ecddab81aa9743c
parentf30c7b243a112eb07af0bcddbd9a211596ed80d7 (diff)
downloadfactory-boy-1e1adebe92397b405563dc141c853f62feca6c82.tar
factory-boy-1e1adebe92397b405563dc141c853f62feca6c82.tar.gz
Docs: Fix typo in M2M recipes (Closes #226)
As spotted by @stephane, thanks!
-rw-r--r--docs/recipes.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/recipes.rst b/docs/recipes.rst
index 3cbe6d2..df86bac 100644
--- a/docs/recipes.rst
+++ b/docs/recipes.rst
@@ -148,8 +148,8 @@ factory_boy related factories.
method.
-Simple ManyToMany
------------------
+Simple Many-to-many relationship
+--------------------------------
Building the adequate link between two models depends heavily on the use case;
factory_boy doesn't provide a "all in one tools" as for :class:`~factory.SubFactory`
@@ -167,7 +167,7 @@ hook:
class User(models.Model):
name = models.CharField()
- groups = models.ManyToMany(Group)
+ groups = models.ManyToManyField(Group)
# factories.py
@@ -204,8 +204,8 @@ the ``groups`` declaration will add passed in groups to the set of groups for th
user.
-ManyToMany with a 'through'
----------------------------
+Many-to-many relation with a 'through'
+--------------------------------------
If only one link is required, this can be simply performed with a :class:`RelatedFactory`.
@@ -219,7 +219,7 @@ If more links are needed, simply add more :class:`RelatedFactory` declarations:
class Group(models.Model):
name = models.CharField()
- members = models.ManyToMany(User, through='GroupLevel')
+ members = models.ManyToManyField(User, through='GroupLevel')
class GroupLevel(models.Model):
user = models.ForeignKey(User)