Skip to content

Instantly share code, notes, and snippets.

@deboraazevedo
Created October 2, 2014 01:59
Show Gist options
  • Save deboraazevedo/098b1688fd1df29e9cff to your computer and use it in GitHub Desktop.
Save deboraazevedo/098b1688fd1df29e9cff to your computer and use it in GitHub Desktop.
#!/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