views:

42

answers:

2

hi guys, i have a django 'templating' question

if i have in views.py:

def cv(request):
 if request.user.is_authenticated():
     cv = OpenCv.objects.filter(created_by=request.user)
 return render_to_response('cv/cv.html', {
    'object_list': cv,

    }, 
    context_instance=RequestContext(request)) 

and in cv.html something like:

{% for object in object_list %}
<li>
First Name {{ object.first_name }} <br />
Last Name {{ object.last_name }} <br /> 
Url {{object.url}} <br />
Picture {{object.picture}} <br />
Bio {{object.bio}} <br />
Date of birth {{object.date_birth}} <br />

{% endfor %}

but i want this content to appear on the profile.html page too, how can i do it? a smple {% include "cv/cv.html" %} in the profile.html doesn't work. Also, is there another way to 'parse the object list' than explicitly write all the objects, like above? thanks in advance!

A: 

It's not very clear what you're asking, but I suspect a custom template tag might be what you're after.

Daniel Roseman
+2  A: 

You need to pass object_list to profile.html as well.

Ignacio Vazquez-Abrams