Advertisement
Guest User

Untitled

a guest
Mar 20th, 2015
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1.     args["turmas"] = [{
  2.         "nome":t.nome,
  3.         "disciplinas":[{
  4.             "nome":d.disciplina,
  5.             "professor":nome(d.professor),
  6.             "paracasas":[{
  7.                 "data_publicacao":unicode(pc.data_postagem),
  8.                 "data_entrega":unicode(pc.data_entrega),
  9.                 "tarefas":pc.tarefas,
  10.                 "resumo":pc.tarefas if len(pc.tarefas) <= 50 else u'{0}...'.format(pc.tarefas[0:50]),
  11.                 "anexos":[{
  12.                     "url":a.anexo.url,
  13.                     "nome":a.anexo.name.split('/')[-1],
  14.                     "extensao":a.anexo.name.split('.')[-1],
  15.                 } for a in pc.anexoparacasa_set.all()]
  16.             } for pc in d.paracasa_set.all()],
  17.         } for d in t.professorturma_set.all()]
  18.     } for t in turmas]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement