Author: floguy
Date: Sun Sep 7 17:08:52 2008
New Revision: 11
Modified:
trunk/things/options.py
trunk/things/templates/things/detail.html
trunk/thingsproject/dev.db
trunk/thingsproject/twitter/thing.py
Log:
Added a back link to be able to go back from the detail page to the
object_list page.
Modified: trunk/things/options.py
==============================================================================
--- trunk/things/options.py (original)
+++ trunk/things/options.py Sun Sep 7 17:08:52 2008
@@ -24,7 +24,7 @@
__metaclass__ = ModelThingMetaclass
fields = {}
- comments = False
+ comments = True
def __init__(self, model, thing_site):
self.model = model
@@ -84,8 +84,14 @@
obj = get_object_or_404(self.model, pk=pk)
templates = ['things/%s_detail.html' % (template_name,),
'things/detail.html']
+ list_url = reverse('%s_list' % (self.name_prefix,), kwargs={
+ 'app_label': self.opts.app_label,
+ 'model_name': self.opts.module_name,
+ })
t = select_template(templates)
c = RequestContext(request, {
template_object_name: obj,
+ 'comments': self.comments,
+ 'list_url': list_url,
})
return HttpResponse(t.render(c))
Modified: trunk/things/templates/things/detail.html
==============================================================================
--- trunk/things/templates/things/detail.html (original)
+++ trunk/things/templates/things/detail.html Sun Sep 7 17:08:52 2008
@@ -1 +1,11 @@
-{{ object }}
\ No newline at end of file
+{% load comments %}
+<a href="{{ list_url }}">← Back to List</a>
+{{ object }}
+
+{% if comments %}
+ {% get_comment_list for object as comment_list %}
+ {% for comment in comment_list %}
+ <p>{{ comment }}</p>
+ {% endfor %}
+ {% render_comment_form for object %}
+{% endif %}
\ No newline at end of file
Modified: trunk/thingsproject/dev.db
==============================================================================
Binary files. No diff available.
Modified: trunk/thingsproject/twitter/thing.py
==============================================================================
--- trunk/thingsproject/twitter/thing.py (original)
+++ trunk/thingsproject/twitter/thing.py Sun Sep 7 17:08:52 2008
@@ -6,6 +6,5 @@
verbose_name_desc='Oldest', url_asc='newest', url_desc='oldest',
field_url='date')
message = things.OrderField()
- comments = True
things.site.register(Tweet, TweetThing)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---