Skip to content
GitLab
Explore
Sign in
Commits on Source (1)
Improve activity interface
· 4984159a
ynerant
authored
Aug 06, 2020
4984159a
Hide whitespace changes
Inline
Side-by-side
management/commands/import_activities.py
View file @
4984159a
...
...
@@ -40,7 +40,8 @@ class Command(ImportCommand):
cur
.
execute
(
"
SELECT * FROM activites ORDER by id
"
)
n
=
cur
.
rowcount
bulk_mgr
=
BulkCreateManager
(
chunk_size
=
chunk
)
activity_type_id
=
ActivityType
.
objects
.
get
(
name
=
"
Pot
"
).
pk
# Need to be fixed manually
pot_id
=
ActivityType
.
objects
.
get
(
name
=
"
Pot
"
).
pk
club_id
=
ActivityType
.
objects
.
get
(
name
=
"
Soirée de club
"
).
pk
kfet
=
Club
.
objects
.
get
(
name
=
"
Kfet
"
)
pk_activity
=
1
for
idx
,
row
in
enumerate
(
cur
):
...
...
@@ -64,7 +65,7 @@ class Command(ImportCommand):
"
name
"
:
row
[
"
titre
"
],
"
description
"
:
row
[
"
description
"
],
"
location
"
:
row
[
"
lieu
"
],
"
activity_type_id
"
:
activity_type_id
,
# By default Pot
"
activity_type_id
"
:
pot_id
if
row
[
"
liste
"
]
else
club_id
,
"
creater_id
"
:
NoteUser
.
objects
.
get
(
pk
=
note
).
user
.
id
,
"
organizer_id
"
:
organizer
.
pk
,
"
attendees_club_id
"
:
kfet
.
pk
,
# Maybe fix manually
...
...