Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Alsijil
Merge requests
!80
Resolve "Add student view with further information"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Add student view with further information"
93-add-students-list-and-view-with-further-information
into
master
Overview
7
Commits
11
Pipelines
5
Changes
8
2 unresolved threads
Hide all comments
Merged
Jonathan Weth
requested to merge
93-add-students-list-and-view-with-further-information
into
master
4 years ago
Overview
7
Commits
11
Pipelines
5
Changes
9
2 unresolved threads
Hide all comments
Expand
Closes
#93 (closed)
Closes
#92 (closed)
Edited
4 years ago
by
Jonathan Weth
0
0
Merge request reports
Compare
version 3
version 5
2ef14bf4
4 years ago
version 4
0e436334
4 years ago
version 3
f85f91b5
4 years ago
version 2
f85f91b5
4 years ago
version 1
f85f91b5
4 years ago
master (base)
and
version 5
latest version
71bf7438
11 commits,
4 years ago
version 5
2ef14bf4
9 commits,
4 years ago
version 4
0e436334
7 commits,
4 years ago
version 3
f85f91b5
1 commit,
4 years ago
version 2
f85f91b5
1 commit,
4 years ago
version 1
f85f91b5
1 commit,
4 years ago
Show latest version
9 files
+
318
−
50
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
9
Search (e.g. *.vue) (Ctrl+P)
aleksis/apps/alsijil/migrations/0007_personal_note_lesson_documentation_year.py
0 → 100644
+
55
−
0
Options
# Generated by Django 3.0.9 on 2020-08-15 09:39
from
django.db
import
migrations
,
models
import
aleksis.apps.chronos.util.date
def
migrate_data
(
apps
,
schema_editor
):
PersonalNote
=
apps
.
get_model
(
"
alsijil
"
,
"
PersonalNote
"
)
LessonDocumentation
=
apps
.
get_model
(
"
alsijil
"
,
"
LessonDocumentation
"
)
db_alias
=
schema_editor
.
connection
.
alias
for
note
in
PersonalNote
.
objects
.
using
(
db_alias
).
all
():
year
=
note
.
lesson_period
.
lesson
.
validity
.
date_start
.
year
if
note
.
week
<
int
(
note
.
lesson_period
.
lesson
.
validity
.
date_start
.
strftime
(
"
%V
"
)
):
year
+=
1
note
.
year
=
year
note
.
save
()
for
doc
in
LessonDocumentation
.
objects
.
using
(
db_alias
).
all
():
year
=
doc
.
lesson_period
.
lesson
.
validity
.
date_start
.
year
if
doc
.
week
<
int
(
doc
.
lesson_period
.
lesson
.
validity
.
date_start
.
strftime
(
"
%V
"
)):
year
+=
1
doc
.
year
=
year
doc
.
save
()
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
"
alsijil
"
,
"
0006_delete_personal_notes_filter
"
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
"
lessondocumentation
"
,
name
=
"
year
"
,
field
=
models
.
IntegerField
(
default
=
aleksis
.
apps
.
chronos
.
util
.
date
.
get_current_year
,
verbose_name
=
"
Year
"
,
),
),
migrations
.
AddField
(
model_name
=
"
personalnote
"
,
name
=
"
year
"
,
field
=
models
.
IntegerField
(
default
=
aleksis
.
apps
.
chronos
.
util
.
date
.
get_current_year
,
verbose_name
=
"
Year
"
,
),
),
migrations
.
RunPython
(
migrate_data
),
]
Loading