Created
November 25, 2010 03:46
-
-
Save johnboxall/714869 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def view(request, template_name): | |
| def obj_iterator(): | |
| for obj in Objs.objects.iterator(): | |
| obj.do_something() | |
| yield obj | |
| ctx = { | |
| 'objs': obj_iterator | |
| } | |
| return render_to_response(template_name, ctx) | |
| # Later in the Template! | |
| {% for obj in objs %} | |
| {{ obj }} | |
| {% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment