Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- No:
- def view(request):
- data = getDataFromSomehwere()
- processedData = []
- for datum in data:
- processedDatum = this that and the other thing
- processedData.append(processedDatum)
- output = render(template, processedData)
- return Response(output)
- Yes:
- def processData(data):
- processedData = []
- for datum in data:
- processedDatum = this that and the other thing
- processedData.append(processedDatum)
- return processedData
- def view(request):
- data = getDataFromSomehwere()
- processedData = processData(data)
- output = render(template, processedData)
- return Response(output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement