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

fix: visualise data models #30

Merged
merged 30 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c671458
add foreign key id fields
SKairinos Dec 12, 2023
ffc147b
add permissions
SKairinos Dec 12, 2023
181eb96
support checking admin teachers
SKairinos Dec 12, 2023
9864ed5
replace permissions
SKairinos Dec 12, 2023
cfdc9ca
remove unused requirements and fix test discovery
SKairinos Dec 13, 2023
80622a9
fix unit tests
SKairinos Dec 14, 2023
617d62b
add module docstrings
SKairinos Dec 14, 2023
dbc3df6
pylint disable
SKairinos Dec 14, 2023
8c7e197
create unit tests
SKairinos Dec 14, 2023
0bf84a0
call action
SKairinos Dec 14, 2023
ff64936
use ocadotech org
SKairinos Dec 14, 2023
5bd3d69
use sub dir
SKairinos Dec 15, 2023
64412d7
in .github sub dir
SKairinos Dec 15, 2023
3730645
feedback
SKairinos Dec 15, 2023
42f6bf4
fix pipeline
SKairinos Dec 15, 2023
39b32da
graph django models
SKairinos Dec 15, 2023
8ab718a
remove test for now
SKairinos Dec 15, 2023
cbb1c01
chore: entity relationship diagram [skip ci]
cfl-bot Dec 15, 2023
a3b827a
test 2 pushes in a row
SKairinos Dec 15, 2023
3f629b6
test modifying model fields
SKairinos Dec 15, 2023
5a893ec
chore: entity relationship diagram [skip ci]
cfl-bot Dec 15, 2023
07754ac
remove middle name
SKairinos Dec 15, 2023
9b9fa18
chore: entity relationship diagram [skip ci]
cfl-bot Dec 15, 2023
f4b5821
add middle_name
SKairinos Dec 15, 2023
cf4ab9e
chore: entity relationship diagram [skip ci]
cfl-bot Dec 15, 2023
377d6b2
remove middle name
SKairinos Dec 15, 2023
5784e76
chore: entity relationship diagram [skip ci]
cfl-bot Dec 15, 2023
ee749ba
use actions
SKairinos Dec 15, 2023
321d66f
add pytest-xdist
SKairinos Dec 15, 2023
790986f
merge from new_data_models
SKairinos Dec 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 11 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,26 @@ jobs:
matrix:
python-version: [3.8]
steps:
- name: 🛫 Checkout
uses: actions/checkout@v3

- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: ocadotechnology/codeforlife-workspace/.github/actions/python/test@main
with:
python-version: ${{ matrix.python-version }}

- name: 🛠 Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pipenv
pipenv install --dev
- name: 🔎 Check Code Format
run: if ! pipenv run black --check .; then exit 1; fi

- name: 🔎 Check Migrations
run: pipenv run python manage.py makemigrations --check --dry-run

# TODO: assert code coverage target.
- name: 🧪 Test Code Units
run: pipenv run pytest
docs:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: ocadotechnology/codeforlife-workspace/.github/actions/python/docs@main
with:
python-version: ${{ env.PYTHON_VERSION }}

release:
concurrency: release
runs-on: ubuntu-latest
needs: [test]
needs: [docs]
if: github.ref_name == 'main'
steps:
- name: 🛫 Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fetch-depth: 0
Expand All @@ -67,10 +55,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install python-semantic-release~=7.33
- name: ⚙️ Configure Git
run: |
git config --local user.name cfl-bot
git config --local user.email [email protected]
- uses: ocadotechnology/codeforlife-workspace/.github/actions/git/setup-bot@main

- name: 🚀 Publish Semantic Release
env:
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ pip-log.txt
pip-delete-this-directory.txt

# Any graphs generated in the docs
docs/*.png
# docs/*.png

# Any dot files generated by pydot
*.dot
# *.dot

# Unit test / coverage reports
htmlcov/
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"--load-plugins=pylint_django"
],
"python.testing.pytestArgs": [
"-n=auto",
"-c=pyproject.toml",
"."
],
Expand Down
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ django-stubs = {version = "==4.2.6", extras = ["compatible-mypy"]}
djangorestframework-stubs = {version = "==3.14.4", extras = ["compatible-mypy"]}
pylint = "==3.0.2"
pylint-django = "==2.5.5"
pygraphviz = "==1.11"
pytest-xdist = {version = "==3.5.0", extras = ["psutil"]}

[requires]
python_version = "3.8"
55 changes: 51 additions & 4 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions codeforlife/settings/third_party.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,16 @@
],
"DEFAULT_PAGINATION_CLASS": "codeforlife.pagination.LimitOffsetPagination",
}

# Django Extensions - Graph Models
# https://django-extensions.readthedocs.io/en/latest/graph_models.html?highlight=graph_models#default-settings

GRAPH_MODELS = {
"all_applications": True,
"group_models": True,
"pygraphviz": True,
"output": "docs/entity_relationship_diagram.png",
"arrow_shape": "normal",
"color_code_deletions": True,
"rankdir": "BT",
}
2 changes: 1 addition & 1 deletion codeforlife/user/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 3.2.20 on 2023-12-15 17:11
# Generated by Django 3.2.20 on 2023-12-18 11:09

from django.conf import settings
import django.core.validators
Expand Down
Binary file added docs/entity_relationship_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"django.contrib.staticfiles",
"django.contrib.sites",
"codeforlife.user",
"django_extensions",
]

MIDDLEWARE = [
Expand Down
Loading