-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
107 lines (67 loc) · 1.99 KB
/
notes.txt
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
## Sequence
py -m venv
venv\Scipts\activate
py -m pip
install django
install django-crispy-forms
install crispy-bootstrap5
freeze > requirements.txt
django-admin startproject timetable .
py manage.py
migrate
createsuperuser
runserver
django-admin startapp core
settings.py
add 'core' to INSTALLED_APPS
TIME_ZONE = 'Asia/Manila'
touch core\urls.py
create test view
create test template
## Ideas
- use table/cards
- sort by time
- filters
- add, edit/delete
- add models.py to common folder -NOT WORKING
- calculate rowspan: (endtime - starttime) * 2 = no. of rows
## Table display components
- queryset record sorter
- schedule conflict detector
- queryset to dense matrix converter
- dense matrix to html table renderer
## Table display steps
- fetch records
- group records by time ranges [def groupby(queryset, interval_minutes=30) return dict]
- sort each group by day [groupby() -> sort_day(dict):for e in dict sort e.x by x.day desc]
- if there are records within the time range that has the same day, mark those records as conflicting [for e in len(dict.e)-1 then set conflict if [x-1].day == [x].day]
## Timetable as object
structure of a timetable:
table->row->column
row 1: ['time', weekday headers]
row n: [time range header, event cells]
table = [
['time', 'monday', 'tuesday',..], # row 1
[time range 1, mon event, tue event,..], # row n
[time range 2, mon event, tue event,..], # row n
]
attributes of a timetable:
- time range headers
- index
- string value
- weekday headers
- index
- string value
- column span
- event cells
- event text
- row
- column
- row span
## Incremental development
v.1
- display basic timetable with 7-day week and 30-minute time range from 7:30 AM to 8:30 PM
- using text choices for time fields and basic string matching
- adding methods to models.Set such as get_matrix()
## References
https://www.w3schools.com/html/html_table_headers.asp