Skip to content

Instantly share code, notes, and snippets.

@melinath
Created March 12, 2012 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melinath/2023812 to your computer and use it in GitHub Desktop.
Save melinath/2023812 to your computer and use it in GitHub Desktop.
Templating test
from django.db import models
class Bar(models.Model):
name = models.CharField(max_length=30)
class Foo(models.Model):
name = models.CharField(max_length=200)
date = models.DateTimeField()
bars = models.ManyToManyField(Bar, blank=True)
from models import Foo
context = {
"foos": Foo.objects.all(),
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment