Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. No:
  2.  
  3. def view(request):
  4. data = getDataFromSomehwere()
  5.  
  6. processedData = []
  7. for datum in data:
  8. processedDatum = this that and the other thing
  9. processedData.append(processedDatum)
  10.  
  11. output = render(template, processedData)
  12. return Response(output)
  13.  
  14. Yes:
  15.  
  16. def processData(data):
  17. processedData = []
  18. for datum in data:
  19. processedDatum = this that and the other thing
  20. processedData.append(processedDatum)
  21. return processedData
  22.  
  23. def view(request):
  24. data = getDataFromSomehwere()
  25.  
  26. processedData = processData(data)
  27.  
  28. output = render(template, processedData)
  29. return Response(output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement