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
9ac062fd
Commit
9ac062fd
authored
4 years ago
by
Carlos Vega
Browse files
Options
Downloads
Patches
Plain Diff
change column labels in the export checkboxes
parent
adf07a27
No related branches found
No related tags found
1 merge request
!250
Virus visit column changes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/web/views/export.py
+16
-1
16 additions, 1 deletion
smash/web/views/export.py
with
16 additions
and
1 deletion
smash/web/views/export.py
+
16
−
1
View file @
9ac062fd
...
...
@@ -7,7 +7,11 @@ from django.http import HttpResponse
from
notifications
import
get_today_midnight_date
from
web.decorators
import
PermissionDecorator
from
.
import
e500_error
,
wrap_response
from
..models
import
Subject
,
StudySubject
,
Appointment
from
..models
import
Subject
,
StudySubject
,
Appointment
,
ConfigurationItem
from
web.models.constants
import
VISIT_SHOW_VISIT_NUMBER_FROM_ZERO
from
distutils.util
import
strtobool
from
web.templatetags.filters
import
display_visit_number
import
re
@PermissionDecorator
(
'
export_subjects
'
,
'
subject
'
)
...
...
@@ -86,12 +90,23 @@ def filter_fields_from_selected_fields(fields, selected_fields):
def
get_default_subject_fields
():
visit_from_zero
=
ConfigurationItem
.
objects
.
get
(
type
=
VISIT_SHOW_VISIT_NUMBER_FROM_ZERO
).
value
visit_from_zero
=
strtobool
(
visit_from_zero
)
subject_fields
=
[]
for
field
in
Subject
.
_meta
.
fields
:
if
field
.
name
.
upper
()
!=
"
ID
"
:
subject_fields
.
append
(
field
)
for
field
in
StudySubject
.
_meta
.
fields
:
if
field
.
name
.
upper
()
!=
"
ID
"
and
field
.
name
.
upper
()
!=
"
SUBJECT
"
:
if
visit_from_zero
:
match
=
re
.
match
(
r
'
^virus_test_(\d*)$
'
,
field
.
name
)
if
match
:
number
=
int
(
match
.
groups
()[
0
])
field
.
verbose_name
=
'
Virus {} RT-PCR
'
.
format
(
display_visit_number
(
number
))
match
=
re
.
match
(
r
'
^virus_test_(\d*)_updated$
'
,
field
.
name
)
if
match
:
number
=
int
(
match
.
groups
()[
0
])
field
.
verbose_name
=
'
Virus {} RT-PCR date
'
.
format
(
display_visit_number
(
number
))
subject_fields
.
append
(
field
)
subject_fields
.
append
(
DROP_OUT_FIELD
)
return
subject_fields
...
...
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