dump_object does not follow object relations
Environment: Django 3.0.6
In my case the app does not follow relations when exporting data with dump_object
Simplified models:
class Member(BaseModel):
email = models.EmailField(unique=True)
class Subscription(BaseModel):
member = models.ForeignKey(Member, on_delete=models.CASCADE)
When I execute python manage.py dump_object members.member --query '{"pk__in": [1]} for a Member with several Subscriptions I only get the Member model dumped:
[
{
"model": "accounts.member",
"pk": 1,
"fields": {
"email": "[email protected]",
}
}
]
@DataGreed are those relations required properties for the model?
@dopry sorry, no idea, it was two years ago, I don't even remember this case. But judging from the code, they are
@DataGreed thanks. are you still using fixture magic at all?
@DataGreed thanks. are you still using fixture magic at all?
not a t the moment, I've used it several times to generate test fixture, and I think I'll use it in the future for the same purppose :)
we have the same use case. :)