Common recipe for reverse dependencies doesn't work
See original GitHub issueThe common recipe for a RelatedFactory (on http://factoryboy.readthedocs.org/en/latest/recipes.html) shows as this:
# models.py
class User(models.Model):
pass
class UserLog(models.Model):
user = models.ForeignKey(User)
action = models.CharField()
# factories.py
class UserFactory(factory.django.DjangoModelFactory):
class Meta:
model = models.User
log = factory.RelatedFactory(UserLogFactory, 'user', action=models.UserLog.ACTION_CREATE)
At least with Django 1.8.2 these actions are nowhere to be found, raising an attribute error.
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
rez-cook: a rez package manager · Discussion #1347 - GitHub
Given a package request to cook, it will find a matching recipe, and the recipes for its entire dependency tree, figure out which...
Read more >Why reverse dependencies does not work with rpm command?
While checking the package dependencies for one package, it works well as below :- Raw. This is just an example # rpm -qR...
Read more >Package reverse dependency checks (especially on Windows)
I would like to hear how folks do their reverse dependency checks on ... on CRAN yet and which does not build in...
Read more >Is the crate dependency becoming a problem? : r/rust - Reddit
Hey there,. I am new to Rust and having a blast. I really enjoy the language. However, I noticed that dependencies are really...
Read more >Common recipes — Factory Boy stable documentation
Reverse dependencies (reverse ForeignKey) . When a related object should be created upon object creation (e.g a reverse ForeignKey from another Model...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pavan-blackbuck If I understand correctly, the issue was that the example code expected the user to have defined some
ACTION_CREATE
on the customUserLog
model; obviously, this would fail if you don’t define such fields on your own models.@rbarrois Thank you. Got this resolved.