Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oser-backend
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hamza Touizrat
oser-backend
Commits
15e28a65
Commit
15e28a65
authored
Nov 25, 2021
by
Thomas Bidot-naude
Browse files
Options
Downloads
Patches
Plain Diff
Rectification Exportation excel sorties
parent
f7a39a7c
No related branches found
No related tags found
1 merge request
!41
Rectification Exportation excel sorties
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
visits/admin.py
+7
-8
7 additions, 8 deletions
visits/admin.py
with
7 additions
and
8 deletions
visits/admin.py
+
7
−
8
View file @
15e28a65
...
...
@@ -63,7 +63,6 @@ class RegistrationsOpenFilter(admin.SimpleListFilter):
class
VisitForm
(
forms
.
ModelForm
):
"""
Custom admin form for Visit.
"""
class
Meta
:
# noqa
model
=
Visit
fields
=
'
__all__
'
...
...
@@ -119,6 +118,7 @@ class ParticipationInline(admin.TabularInline):
class
Media
:
css
=
{
"
all
"
:
(
"
css/hide_admin_original.css
"
,)}
def
accept_selected_participations
(
modeladmin
,
request
,
queryset
):
"""
Accept selected participations in list view.
"""
for
obj
in
queryset
:
...
...
@@ -182,7 +182,6 @@ class ParticipationAdmin(admin.ModelAdmin):
response
.
write
(
codecs
.
BOM_UTF8
)
# force response to be UTF-8
writer
=
csv
.
writer
(
response
,
delimiter
=
'
;
'
)
writer
.
writerow
([
'
first_name
'
,
'
last_name
'
,
'
school
'
,
'
grade
'
,
'
phone_number
'
,
'
scholarship
'
]
+
field_names
)
...
...
@@ -193,9 +192,9 @@ class ParticipationAdmin(admin.ModelAdmin):
name
=
User
.
objects
.
filter
(
email
=
str
(
list_email
[
nb_user
])).
values
(
'
first_name
'
,
'
last_name
'
,
'
phone_number
'
)
school
=
Student
.
objects
.
filter
(
user__email
=
str
(
list_email
[
nb_user
])).
values
(
'
school
'
,
'
scholarship
'
)
user__email
=
str
(
list_email
[
nb_user
])).
values
(
'
school
'
,
'
grade
'
,
'
scholarship
'
)
row
=
writer
.
writerow
([
name
[
0
][
'
first_name
'
],
name
[
0
][
'
last_name
'
],
school
[
0
][
'
school
'
],
name
[
0
][
'
phone_number
'
],
school
[
0
][
'
scholarship
'
]]
+
[
getattr
(
obj
,
field
)
row
=
writer
.
writerow
([
name
[
0
][
'
first_name
'
],
name
[
0
][
'
last_name
'
],
school
[
0
][
'
school
'
],
school
[
0
][
'
grade
'
],
name
[
0
][
'
phone_number
'
],
school
[
0
][
'
scholarship
'
]]
+
[
getattr
(
obj
,
field
)
for
field
in
field_names
])
nb_user
+=
1
...
...
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