Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMASCH
scheduling-system
Commits
a82d785c
There was a problem fetching the pipeline mini graph.
Commit
a82d785c
authored
7 years ago
by
Valentin Groues
Browse files
Options
Downloads
Patches
Plain Diff
change some appointment types descriptions - fixes
#98
parent
b775ff2d
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/web/migrations/0037_appointment_types_descriptions_changes.py
+43
-0
43 additions, 0 deletions
...migrations/0037_appointment_types_descriptions_changes.py
with
43 additions
and
0 deletions
smash/web/migrations/0037_appointment_types_descriptions_changes.py
0 → 100644
+
43
−
0
View file @
a82d785c
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-04-20 14:35
from
__future__
import
unicode_literals
from
django.db
import
migrations
updates_to_perform
=
[
(
"
SB
"
,
"
Skin Biopsy
"
,
"
Level B Skin Biopsy
"
),
(
"
B
"
,
"
Level B NP
"
,
"
Level B
"
),
(
"
PSP
"
,
"
Level B PSP
"
,
"
PSP
"
),
]
def
add_prefixes
(
apps
,
schema_editor
):
AppointmentType
=
apps
.
get_model
(
"
web
"
,
"
AppointmentType
"
)
for
update_to_perform
in
updates_to_perform
:
code
,
description
,
_
=
update_to_perform
appointment_type
=
AppointmentType
.
objects
.
filter
(
code
=
code
).
first
()
if
appointment_type
is
not
None
:
appointment_type
.
description
=
description
appointment_type
.
save
()
def
revert_prefixes
(
apps
,
schema_editor
):
AppointmentType
=
apps
.
get_model
(
"
web
"
,
"
AppointmentType
"
)
for
update_to_perform
in
updates_to_perform
:
code
,
_
,
previous_description
=
update_to_perform
appointment_type
=
AppointmentType
.
objects
.
filter
(
code
=
code
).
first
()
if
appointment_type
is
not
None
:
appointment_type
.
description
=
previous_description
appointment_type
.
save
()
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
web
'
,
'
0036_year_of_diagnosis_default
'
),
]
operations
=
[
migrations
.
RunPython
(
add_prefixes
,
reverse_code
=
revert_prefixes
),
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment