Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dump_object does not follow object relations #78

Open
DataGreed opened this issue Jul 7, 2020 · 5 comments
Open

dump_object does not follow object relations #78

DataGreed opened this issue Jul 7, 2020 · 5 comments

Comments

@DataGreed
Copy link

DataGreed commented Jul 7, 2020

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 DataGreed changed the title Does not follow relatoin dump_object does not follow object relations Jul 7, 2020
@dopry
Copy link

dopry commented Nov 17, 2022

@DataGreed are those relations required properties for the model?

@DataGreed
Copy link
Author

DataGreed commented Nov 17, 2022

@dopry sorry, no idea, it was two years ago, I don't even remember this case. But judging from the code, they are

@dopry
Copy link

dopry commented Nov 18, 2022

@DataGreed thanks. are you still using fixture magic at all?

@DataGreed
Copy link
Author

@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 :)

@dopry
Copy link

dopry commented Nov 28, 2022

we have the same use case. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants