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

Feature request: command to generate diagram from DB #12

Open
dkdndes opened this issue Jan 4, 2022 · 1 comment
Open

Feature request: command to generate diagram from DB #12

dkdndes opened this issue Jan 4, 2022 · 1 comment

Comments

@dkdndes
Copy link

dkdndes commented Jan 4, 2022

The dumpdata command allows the generation of data that can be imported via fixtures. The structure is very similar, and could work as a starting point.

Example in the Django docs for fixtures, and the inspectdb command.

As an example, though, here’s what a fixture for a Person model might look like in JSON:

[
  {
    "model": "myapp.person",
    "pk": 1,
    "fields": {
      "first_name": "John",
      "last_name": "Lennon"
    }
  },
  {
    "model": "myapp.person",
    "pk": 2,
    "fields": {
      "first_name": "Paul",
      "last_name": "McCartney"
    }
  }
]

And here’s that same fixture as YAML:

- model: myapp.person
  pk: 1
  fields:
    first_name: John
    last_name: Lennon
- model: myapp.person
  pk: 2
  fields:
    first_name: Paul
    last_name: McCartney
@mehran-rahmanzadeh
Copy link
Collaborator

Hi Peter, Thank you for this feature request, It seems to be good for migrating already developed projects to a django-sage-painless version of that project.

We can add a management command for example named dump_to_diagram for this feature.

I suggest you help us develop this feature.

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