2.1. UML About
UML - Unified Modeling Language
14 diagrams
ERD Diagram
Structure Diagrams:
Class Diagram
Component Diagram
Deployment Diagram
Object Diagram
Package Diagram
Profile Diagram
Composite Structure Diagram
Behavioral Diagrams:
Use Case Diagram
Activity Diagram
State Machine Diagram
Sequence Diagram
Communication Diagram
Interaction Overview Diagram
Timing Diagram

2.1.1. Rationale


2.1.2. Class Diagram

@startuml
class Account {
- username
- password
+ login()
+ logout()
}
class User {
- firstname
- lastname
- email
+ change_firstname()
+ change_lastname()
+ change_email()
}
class Admin {
- is_active
- is_staff
- is_admin
+ add_user()
+ edit_user()
+ delete_user()
}
Account <|-- User
Account <|-- Admin
note as COMMENT
class User inherits from Account
class Admin inherits from Account
endnote
@enduml
2.1.3. Sequence Diagram

@startuml
autonumber
actor User
participant Server
database Database
activate User
User -> Server: HTTP Request
activate Server
Server -> Database: SQL Query
activate Database
Database --> Server: Result
deactivate Database
Server --> User: HTTP Response
deactivate Server
deactivate User
@enduml
2.1.4. Component Diagram

2.1.5. Deployment Diagram

2.1.6. Object Diagram

2.1.7. Package Diagram

2.1.8. Profile Diagram

2.1.9. Composite Structure Diagram

2.1.10. Use Case Diagram

2.1.11. Activity Diagram

2.1.12. State Machine Diagram

2.1.13. Sequence Diagram
Conversation over time


2.1.14. Communication Diagram

2.1.15. Interaction Overview Diagram

2.1.16. Timing Diagram

2.1.17. Entity Relationship Diagram
Entity Relationship
Database

2.1.18. Generate from code
sphinx.ext.graphviz
(fromsphinx
) - https://www.sphinx-doc.org/en/master/usage/extensions/graphviz.htmlpyreverse
(frompylint
) - https://www.logilab.org/blogentry/6883GraphModels
(fromdjango-command-extensions
) - https://django-extensions.readthedocs.io/en/latest/graph_models.html#example-usageepydoc
- http://epydoc.sourceforge.net - http://epydoc.sourceforge.net/api/epydoc.apidoc.VariableDoc-class.htmlpynsource
- http://pynsource.com/lumpy
- http://www.greenteapress.com/thinkpython/swampy/lumpy.htmlObjectDomain
- http://www.objectdomain.com/products/od-featuresargouml-python
- http://argouml-python.tigris.org/pywebuml
- https://bitbucket.org/tzulberti/pywebumluml-to-django
- https://github.com/auvipy/uml-to-djangoPython Vipera
- https://sourceforge.net/projects/pythonvipera/gaphor
- https://github.com/gaphor/gaphor
$ pyreverse -o png -p mymodule .
$ brew install graphviz
$ pip install pydotplus
$ pip install django-extensions
# Add 'django_extensions' to INSTALLED_APP
$ python manage.py graph_models -a -g -o all.png

