Skip to content

Instantly share code, notes, and snippets.

@TimFletcher
Last active August 29, 2015 14:08
# views.py
context = {
contacts: Contacts.objects.some_custom_method.values('id', 'name') # Only allow access to id and name
}
# Pass context to view rendering code
# Template
{% for contact in contacts %}
{{ contact.name }}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment