django-fsm icon indicating copy to clipboard operation
django-fsm copied to clipboard

graph_transitions throwing error

Open stevejalim opened this issue 7 years ago • 3 comments

On Django 1.10.7, I get this when I try to generate a state transition diagram:

python_user@5db50b80be4b:/app$ python manage.py graph_transitions -o REDACTED/apps/profiles/state_transitions.png profiles

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/python_user/.pyenv/versions/3.6.1/lib/python3.6/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/home/python_user/.pyenv/versions/3.6.1/lib/python3.6/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/python_user/.pyenv/versions/3.6.1/lib/python3.6/site-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/python_user/.pyenv/versions/3.6.1/lib/python3.6/site-packages/django/core/management/base.py", line 345, in execute
    output = self.handle(*args, **options)
  File "/home/python_user/.pyenv/versions/3.6.1/lib/python3.6/site-packages/django_fsm/management/commands/graph_transitions.py", line 160, in handle
    app = apps.get_app(field_spec[0])
AttributeError: 'Apps' object has no attribute 'get_app'

stevejalim avatar Jul 17 '17 12:07 stevejalim

+1, having the same issue.

Temporary fix in graph_transitions.py: #app = apps.get_app(field_spec[0]) #models = apps.get_models(app) app = apps.get_app_config(field_spec[0]) models = app.models.values()

wrvdklooster avatar Jul 17 '17 13:07 wrvdklooster

Sounds like that'd be a pretty easy patch/PR -- any downsides you know of @wrvdklooster if it were done in a backwards compatible way?

stevejalim avatar Jul 20 '17 16:07 stevejalim

Still getting this

nabinkhadka avatar Jun 09 '20 10:06 nabinkhadka

Closing since the graph generation was reworded since the issue was raised

kmmbvnr avatar Dec 21 '23 08:12 kmmbvnr