-
Notifications
You must be signed in to change notification settings - Fork 0
dev
Adrian Wilke edited this page Sep 12, 2024
·
1 revision
- Added .gitignore
- Virtual environment
- Installed conda https://docs.conda.io/projects/miniconda/en/latest/
- Created new, plain virtual environment:
(only python package installed, pip installed, seeconda list
)
conda create --name events python
conda activate events
pip freeze > requirements_dev.txt
-
python --version
-> Python 3.11.5
-
pip install Django
pip freeze > requirements_dev_1_django.txt
python -m django startproject event_management
python .\manage.py startapp events
python .\manage.py makemigrations events
python .\manage.py migrate
python manage.py createsuperuser
python manage.py runserver
- Notes branch
git switch --orphan notes
git commit --allow-empty -m "created branch"
git push -u origin notes
- Learned: Delete (database and) migrations, except of init.py to revert migrations https://simpleisbetterthancomplex.com/tutorial/2016/07/26/how-to-reset-migrations.html
- Learned: In models.py for models.ForeignKey
- Only 'blank=True' results in IntegrityError
- Only 'blank=True' results in 'This field is required' in saving in admin view
- 'null=True' results in 'null has no effect on ManyToManyField' in 'python manage.py createsuperuser'
- models.py: Check deletion cases (CASCADE), https://docs.djangoproject.com/en/4.2/ref/models/fields/#django.db.models.ForeignKey.on_delete
- models.py: Check if working: 'self' https://docs.djangoproject.com/en/4.2/ref/models/fields/#module-django.db.models.fields.related
- 13:45 Meeting
- Proof of concept: Simplified course registration.
- Who has registered?
- Are cancellations possible?
- How many participants?
- Name, first name, unit, country, tech level, email
- Flag: Approved by manager ("Bedarfsmeldung")
- Course: Name, description, day, time
- 17:40 Chat
- There are two levels: Supervisor and unit leader
- In principle, we need a supervisor or a representative
+--+
m:n | | representative of
+ v
+------+ 1:n +------------+ +------------------------+
| Unit | +---+ | Person | +---+ | Course |
+------+ | | m:n | |
| First name | | Name |
+---------+ 1:n | Last name | | Description |
| Country | +---+ | Email | | Day |
+---------+ | | | Time |
| | | Maximum participants |
+------------+ 1:n | | | Cancellation possible |
| Tech Level | +---+ | | | |
+------------+ +------------+ +------------------------+
+ ^ + +
supervisor of | | 1:n | 1:n | 1:n
+--+ + +
+--------------+
| Registration |
| |
| (Registered) |
| Approved |
| Cancelled |
+--------------+
https://asciiflow.com/legacy/
- Course: It's Event, not Course
- Event: Should be not active until published
- Event -> Cancelable: What's the meaning? Can participants cancel? Can event be canceled?
Better: Canceled instead of Cancelable - Event: End time or duration missing
- Event: No registration required? (in leisure time)
- Note: Event<->Person is ownership; participants handled via Registration
- Unit: TechLead Teams? Other units in other countries? Depending on pillar?
- Tech Level: Correct name? Which Tech Levels exist?
- Note: Supervisor has to approve registrations
- Note: Representatives have same rights (e.g. for vacations).
- Registration -> Registered: Not required, will be created when registered
- Registration -> Canceled: Not required, just delete
- Person: Who can have representatives? -> Has to be a supervisor (approving participation)
- Person: Who can set supervisors? -> Has to be a moderator
+--+
m:n | | representatives
+ +
+------------+ organizes +----------------------+
+------+ 1:n | Person | +-------+ | Event |
| Unit | +---+ | | m:n | |
+------+ | First name | | Title |
| Last name | | Description |
+---------+ 1:n | Email | | Day |
| Country | +---+ | Supervisor | | Begin time |
+---------+ | Moderator | | Duration |
| | | Maximum participants |
+------------+ 1:n | | | Published |
| Tech Level | +---+ | | | Canceled |
+------------+ | | | Leisure |
+------------+ +----------------------+
+ ^ + +
supervisor | | n:1 | 1:n | 1:n
+--+ + +
+--------------+
| Registration |
| |
| Approved |
| Canceled |
+--------------+
https://asciiflow.com/legacy/