---------- Forwarded message ----------
From: satvik chauhan <mystic.sat...@gmail.com>
Date: Tue, Mar 29, 2011 at 2:01 PM
Subject: Help with creating a list in the template
To: django-develop...@googlegroups.com



Hey ,
 I am using the contrib.comments app and have created a custom
my_comment_app with one additional field 'xuser' which is a foreignkeyfield
of 'User' model. I am successfully able to post comments.I am  using this
code to display my comments :
{% for comments in comment_list %}

do something

{% endfor %}

but what I want is to display comments on the basis of  the user in the
'xuser' field.
example suppose for all comments 'xuser' field have two users as 'foo' and
'bar'. then It should first display all the comments of foo then the 'post
comment form' , then all the comments  of bar then post comment form and so
on.
What I thought a solution of it as to create a list of users in the 'xuser'
field with no user repeated, and then iterate over it and display comments.
but what I am stuck at is how to create the list in the template.


-Satvik



-- 
--------------------------------------------------------------------------------------------------
Satvik Chauhan
Sophomore Under Graduate Student
Deptt. of Computer Science and Engineering
Indian Institute of Technology Kanpur
Kanpur-208016, INDIA
Email: mystic.sat...@gmail.com , satv...@iitk.ac.in

--------------------------------------------------------------------------------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to