Guest User

Untitled

a guest
Jan 17th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. for anuncio in anuncios:
  2. data = {}
  3. data['id'] = anuncio['id'],
  4. data['manifestado'] = anuncio['numero_de_manifiesto'],
  5. data['nave'] = anuncio['nave__nombre'],
  6. data['tipo_nave'] = anuncio['tipo_nave__descripcion'],
  7. data['nombre_linea'] = anuncio['linea_naviera__nombre'],
  8. data['nro_viaje'] = anuncio['nro_viaje'],
  9. data['agente_maritimo'] = anuncio['agente_maritimo__nombre'],
  10. data['eslora'] = anuncio['nave__eslora'],
  11. data['eta'] = anuncio['eta'],
  12. data['etb'] = anuncio['etb'],
  13. data['etc'] = anuncio['etc'],
  14. data['etd'] = anuncio['etd'],
  15. data['carga'] = anuncio['carga'].upper()
  16. data['proyecto_articulo'] = anuncio['proyecto_articulo__nombre']
  17. # data['amarradero'] = anuncio['amarradero__nombre']
  18. data['reporte_servicio_url'] = reverse('reporte_servicio', kwargs={"pk": anuncio['id']})
  19. data['atraque_url'] = reverse('acta_maniobra_imprimir', kwargs={"pk": atra[anuncio['id']]}) if anuncio['id'] in atra else None
  20. data['desatraque_url'] = reverse('acta_maniobra_imprimir', kwargs={"pk": desa[anuncio['id']]}) if anuncio['id'] in desa else None
  21. data['foto'] = anuncio['tipo_nave__foto'],
  22.  
  23. resultado.append(data)
  24.  
  25. columns: [
  26. {
  27. data: "foto",
  28. },
  29. {data: "manifestado"},
  30. {data: "nave"},
  31. {data: "tipo_nave"},
  32. {data: "nombre_linea"},
  33. {data: "nro_viaje"},
  34. {data: "agente_maritimo"},
  35. {data: "eslora"},
  36. {data: "eta"},
  37. {data: "etb"},
  38. {data: "etc"},
  39. {data: "etd"},
  40. {data: "carga"},
  41. {data: "proyecto_articulo"},
  42. {
  43. "targets": -1,
  44. "data": null,
  45. "defaultContent": "<i class="fa fa-eye" aria-hidden="true"></i>",
  46. "className": 'anuncio'
  47. },
  48. {
  49. "targets": -1,
  50. "data": null,
  51. "defaultContent": "<i class="fa fa-eye" aria-hidden="true"></i>",
  52. "className": 'atraque'
  53. },
  54. {
  55. "targets": -1,
  56. "data": null,
  57. "defaultContent": "<i class="fa fa-eye" aria-hidden="true"></i>",
  58. "className": 'desatraque'
  59. }
  60. ],
Add Comment
Please, Sign In to add comment