Mercurial > public > sg101
comparison forums/management/commands/topic_export.py @ 680:91de9b15b410
For Django 1.5.2: select_related's depth argument is deprecated.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 15 Aug 2013 20:35:02 -0500 |
parents | 2a4e2e86c65e |
children | 4aadaf3bc234 |
comparison
equal
deleted
inserted
replaced
679:89b240fe9297 | 680:91de9b15b410 |
---|---|
46 try: | 46 try: |
47 topic = Topic.objects.get(pk=tid) | 47 topic = Topic.objects.get(pk=tid) |
48 except Topic.DoesNotExist: | 48 except Topic.DoesNotExist: |
49 raise CommandError('topic ID does not exist') | 49 raise CommandError('topic ID does not exist') |
50 | 50 |
51 posts = topic.posts.select_related(depth=1) | 51 posts = topic.posts.select_related('user') |
52 | 52 |
53 try: | 53 try: |
54 content = render_to_string(template_name, {'topic': topic, 'posts': | 54 content = render_to_string(template_name, {'topic': topic, 'posts': |
55 posts}) | 55 posts}) |
56 except TemplateDoesNotExist: | 56 except TemplateDoesNotExist: |