Skip to content

Instantly share code, notes, and snippets.

@andrellima
Created December 7, 2010 12:16
Show Gist options
  • Save andrellima/731733 to your computer and use it in GitHub Desktop.
Save andrellima/731733 to your computer and use it in GitHub Desktop.
def requisicao_empresa(request):
empresa = Empresa.objects.all()
t = loader.get_template("empresa.html")
c = Context({'empresa' : empresa })
return HttpResponse(t.render(c))
<h2>{{ empresa.titulo }}</h2>
<p>{{ empresa.texto }}</p>
<p>{{ empresa.imagem }}</p>
class Noticia(models.Model):
titulo = models.CharField(max_length = 200)
texto = models.TextField()
imagem = models.ImageField(upload_to = 'photos')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment