Skip to content

Commit

Permalink
Replace Database Schema chapter with auto-generated model diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Oct 30, 2017
1 parent 7aaef94 commit de82be5
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 459 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
TAGS
build/
dist/
docs/source/guide/*.dot
docs/guide/target
docs/target/
env.sh
Expand Down
12 changes: 11 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand All @@ -22,6 +22,15 @@
sys.path.insert(1, os.path.abspath('../../'))

import tcms
import subprocess

manage_py = os.path.abspath(os.path.join('..', '..', 'manage.py'))
docs_dir = os.path.abspath(os.path.join('..', '..', 'docs/source/guide'))

# generate source images for model diagrams
subprocess.run([manage_py, 'graph_models', '--pydot', '-g', 'testplans', '-o', '%s/testplans.dot' % docs_dir], check=True)
subprocess.run([manage_py, 'graph_models', '--pydot', '-g', 'testcases', '-o', '%s/testcases.dot' % docs_dir], check=True)
subprocess.run([manage_py, 'graph_models', '--pydot', '-g', 'testruns', '-o', '%s/testruns.dot' % docs_dir], check=True)

# -- General configuration ------------------------------------------------

Expand All @@ -34,6 +43,7 @@
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.graphviz',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
Expand Down

0 comments on commit de82be5

Please sign in to comment.