Skip to content

Instantly share code, notes, and snippets.

@amccartney
Last active March 22, 2016 22:00
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 amccartney/f17266b90c44e6330594 to your computer and use it in GitHub Desktop.
Save amccartney/f17266b90c44e6330594 to your computer and use it in GitHub Desktop.
Resolving multiple objects to one detail view

So given a bunch of Django objects -- as in the objects represented in the JSON -- how can i create a summary detail view that will resolve all of the different objects into one, like the sample page below?

[
{
"name": "Shepard Elementary School",
"school-id": "12032",
"expense": "playground equipment",
"amount": 1200
},
{
"name": "Shepard Elementary School",
"school-id": "12032",
"expense": "field day",
"amount": 2300
},
{
"name": "Jackson Elementary School",
"school-id": "12057",
"expense": "arts and crafts",
"amount": 400
},
{
"name": "Merrimack Elementary School",
"school-id": "13902",
"expense": "first aid kits",
"amount": 900
}
{
"name": "Shepard Elementary School",
"school-id": "12032",
"expense": "arts and crafts",
"amount": 300
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment