Created
October 2, 2014 01:59
-
-
Save deboraazevedo/098b1688fd1df29e9cff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from django.shortcuts import render | |
from django.http import HttpResponse | |
from historicos.models import Usuario, Historico | |
# Create your views here. | |
def show_histories(request, usuario): | |
saida = ['<h2> Lista de históricos registrados</h2>'] | |
saida.append('<ul>') | |
for h in Historico.objects.all(): | |
saida.append('<li> {}: <a href = "{}/"> {} </a></li>'.format(h.nome,h.data, h.comando)) | |
saida.append('</ul>') | |
return HttpResponse('\n'.join(saida)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment