Closed guillaumecharbonnier closed 2 years ago
Hi @guillaumecharbonnier
I applied ba2a767 and it appears to have solved the issue. Instead of giving a date instance to the orm, I give it the date as string in the format it wants, and works like a charm.
About to do the same for training
Hi @bryan-brancotte
Thanks for the solution. I can apply the fix for training.
You should know load_training.py
diverged a lot in my branch from master if you are also tempted to update other parts of the file.
Hi, indeed ! Here is the "patch"
from ifbcat_api.management.commands.load_events import parse_date
if "to" in data_object[7]:
data_object[7] = data_object[7].split(" to ")
formation_start_date = parse_date(data_object[7][0])
formation_end_date = parse_date(data_object[7][1])
else:
formation_start_date = parse_date(data_object[7])
formation_end_date = None
Hi @Aziguy could you check if it is still the case ?
Hi @Aziguy could you check if it is still the case ?
For items in events.csv
all going well. However, for the items in training.csv
date session is wrong (the system remove 1day each time).
I noticed that this function was 'nt used to parse
training_start_date
andtraining_end_date
. I applied the parse and I think, all going well now.
I have noticed the dates are shifted by 1 day when imported with the code chunk in
load_events.csv
andload_training.csv
(the same code chunk pasted below).Here is an example for the training named "Formation librairie GATB" from events.csv | 15/6/2017 from load_events | 2017-06-14 from training.csv | 16-06-2017 from load_training | 2017-06-15
Note the dates for the (very likely) same event are also not the same when exported from Drupal to
events.csv
andtraining.csv
, meaning it is not straightforward to update the same training events when importingtraining.csv
afterevents.csv
. The easiest solution may be to work on Drupal table export to get a clean and complete table for trainings with all infos currently disseminated throughevents.csv
andtraining.csv
.