Davi-Galati
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
16 deletions
-
sigi/apps/eventos/views.py
|
|
@ -300,7 +300,6 @@ def deleta_itens_carrinho(request): |
|
|
|
|
|
|
|
@login_required |
|
|
|
def export_csv(request): |
|
|
|
<<<<<<< HEAD |
|
|
|
def rm_rows(lista,reg): |
|
|
|
for a in lista: |
|
|
|
if a in lista: |
|
|
@ -308,13 +307,6 @@ def export_csv(request): |
|
|
|
else: |
|
|
|
pass |
|
|
|
|
|
|
|
======= |
|
|
|
# response = HttpResponse(content_type='text/csv') |
|
|
|
# response['Content-Disposition'] = 'attachment; filename=eventos.csv' |
|
|
|
|
|
|
|
# csv_writer = csv.writer(response) |
|
|
|
# eventos = carrinhoOrGet_for_qs(request) |
|
|
|
>>>>>>> 2e7851b317e95eb3048959966ddfd30ebec0772c |
|
|
|
def serialize(r, field): |
|
|
|
value = (getattr(r, 'get_{0}_display'.format(field.name), None) or |
|
|
|
getattr(r, field.name, "")) |
|
|
@ -351,8 +343,10 @@ def export_csv(request): |
|
|
|
response['Content-Disposition'] = 'attachment; filename=eventos.csv' |
|
|
|
rm_list = ['Descrição do evento', 'Local do evento', 'Público alvo', 'Motivo do cancelamento', 'Descrição do módulo'] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for a in head: |
|
|
|
if 'Observações_' in a: |
|
|
|
rm_list.append(a) |
|
|
|
|
|
|
|
for a in rm_list: |
|
|
|
if a in head: |
|
|
|
head.remove(a) |
|
|
@ -395,13 +389,7 @@ def export_csv(request): |
|
|
|
writer.writerow(reg) |
|
|
|
|
|
|
|
if evento.convite_set.count() == 0: |
|
|
|
<<<<<<< HEAD |
|
|
|
rm_rows(rm_list,reg) |
|
|
|
======= |
|
|
|
writer.writerow(reg) |
|
|
|
|
|
|
|
# csv_writer.writerow(reg) |
|
|
|
>>>>>>> 2e7851b317e95eb3048959966ddfd30ebec0772c |
|
|
|
|
|
|
|
writer.writerow(reg) |
|
|
|
|
|
|
|