public
Last active

  • Download Gist
CreateView.dot
DOT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
digraph CreateView {
 
// Basic graph, node, and edge styling.
splines="true";
ranksep=0.4;
node [shape="box", style="rounded" fontsize="9", height="0.3", fontname="Open Sans Light"];
edge [headport="n"];
 
// Graph title - \G means "title of the graph"; the \ns are the only way
// I can find to visuall separate the title from the rest of the graph.
label="\G\n\n";
labelloc="t";
fontname="Open Sans Bold";
fontsize=16;
 
// Styling and labels for the "links" (visually, not really) to the the "get
// form" and "render page" subgraphs. There are essentially "fake" nodes
// (formflow_get, renderflow_post, etc) which serve as terminal points
// visually; the actual subflows themselves then get stacked side by side.
subgraph subflows {
node [style="dashed", shape="circle", fontname="Open Sans Light Italic", width=0.6, fixedsize=true];
formflow_get [label="get\nform"];
formflow_post [label="get\nform"];
formflow [label="get\nform"];
renderflow_get [label="render\npage"];
renderflow_post [label="render\npage"];
renderflow [label="render\npage"];
}
 
// The "main" flow - method, get/post, form handling.
subgraph main {
// dispatch -> Http method?
dispatch -> ifmethod;
dispatch [style="bold"];
ifmethod [label="Http\nmethod?", shape="diamond", style=""]
 
// method not allowed
ifmethod -> http_method_not_allowed [color="grey"];
http_method_not_allowed [color="grey", fontcolor="grey"];
 
// get flow: get the form, render the page
ifmethod -> get;
get:s -> formflow_get;
get:s -> renderflow_get;
 
// post flow: get form; if valid: form_valid; if invalid: render page
ifmethod -> post;
post:s -> formflow_post;
post:s -> ifvalid
ifvalid -> form_valid;
form_valid -> get_success_url;
ifvalid -> form_invalid;
form_invalid -> renderflow_post;
ifvalid [label="form\nvalid?", shape="diamond", style=""]
 
// put/post handling
ifmethod -> put [color="grey"];
put [color="grey", fontcolor="grey"];
put:w -> post:e [constraint=false, color="grey"];
}
 
// the "get the form" flow
subgraph formflow {
edge [tailport="s"];
formflow -> get_form_class;
get_form_class -> get_queryset;
formflow -> get_form;
get_form -> get_form_kwargs;
get_form_kwargs -> get_initial;
}
 
// the "render the page" flow
subgraph renderflow {
edge [tailport="s"];
renderflow -> get_context_data;
get_context_data -> get_context_object_name;
renderflow -> render_to_response;
render_to_response -> get_template_names;
}
 
}
ListView.dot
DOT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
digraph ListView {
// Basic graph, node, and edge styling.
rankdir="LR";
splines="true";
concentrate=true;
ranksep=0.6;
node [shape="box", style="rounded" fontsize="9", height="0.3", fontname="Open Sans Light"];
edge [headport="w", tailport="e"];
 
// Graph title - \G means "title of the graph"; the \ns are the only way
// I can find to visuall separate the title from the rest of the graph.
label="\G\n\n";
labelloc="t";
fontname="Open Sans Bold";
fontsize=16;
 
// dispatch -> Http method?
dispatch -> ifmethod;
dispatch [style="bold"];
ifmethod [label="Http\nmethod?", shape="diamond", style=""]
 
// method not allowed
subgraph not_allowed {
node [color="grey", fontcolor="grey"];
rank=same;
ifmethod:s -> http_method_not_allowed:n [color="grey"];
}
 
ifmethod -> get;
get -> get_queryset;
get -> get_allow_empty;
get -> get_context_data;
get_context_data -> get_paginate_by;
get_context_data -> get_context_object_name;
get_context_data -> paginate_queryset;
paginate_queryset -> get_paginator;
get -> render_to_response;
render_to_response -> get_template_names;
 
}
RedirectView.dot
DOT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
digraph RedirectView {
// Basic graph options
rankdir="LR";
splines="true";
concentrate="true";
ranksep="0.6";
 
// Graph title - \G means "title of the graph"; the \ns are the only way
// I can find to visuall separate the title from the rest of the graph.
label="\G\n\n";
labelloc="t";
fontname="Open Sans Bold";
fontsize=16;
 
node [shape="box", style="rounded" fontsize="9", height="0.3", fontname="Open Sans Light"];
 
// Control the grouping of the not-allowed / other methods nodes.
// This is a bit hackish, but it makes them show up in the same rank (column)
// which is most readable. This has to come before dispatch so that the
// order works out correctly.
http_method_not_allowed; ifmethod; other;
subgraph httpmethods {
rank="same";
ifmethod -> http_method_not_allowed [constraint="false", color="grey"];
ifmethod -> other [color="grey"];
other [label="delete, head,\noptions, post, put", color="grey", fontcolor="grey"];
http_method_not_allowed [color="grey", fontcolor="grey"];
}
other:e -> get:s [constraint="false", color="grey"];
 
// dispatch -> Http method?
dispatch -> ifmethod;
dispatch [style="bold"];
ifmethod [label="Http\nmethod?", shape="diamond", style=""];
 
// get
ifmethod -> get;
get -> get_redirect_url;
 
}
TemplateView.dot
DOT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
digraph TemplateView {
// Basic graph options
rankdir="LR";
splines="true";
concentrate="true";
ranksep="0.6";
 
// Graph title - \G means "title of the graph"; the \ns are the only way
// I can find to visuall separate the title from the rest of the graph.
label="\G\n\n";
labelloc="t";
fontname="Open Sans Bold";
fontsize=16;
 
node [shape="box", style="rounded" fontsize="9", height="0.3", fontname="Open Sans Light"];
 
// dispatch -> Http method?
dispatch -> ifmethod;
dispatch [style="bold"];
ifmethod [label="Http\nmethod?", shape="diamond", style=""];
 
// get
ifmethod -> get;
get -> get_context_data;
get -> render_to_response;
render_to_response -> get_template_names
 
// method not allowed
subgraph not_allowed {
rank=same;
ifmethod -> http_method_not_allowed [color="grey"];
http_method_not_allowed [color="grey", fontcolor="grey"];
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.