2👍
✅
You need to call all
and then use the file’s path
, as exemplified in the documentation. Or for this simple test you could use first
:
file = ScheduleFile.objects.first().csvSchedule
with open(file.path, 'rt', encoding='windows 1250') as csv_input:
reader = csv.reader(csv_input, delimiter=';')
print(reader)
Source:stackexchange.com