django integrate htmls into templates
- by dana
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 %}
First Name {{ object.first_name }}
Last Name {{ object.last_name }}
Url {{object.url}}
Picture {{object.picture}}
Bio {{object.bio}}
Date of birth {{object.date_birth}}
{% endfor %}
but i want this content to appear on the profile.html page too, how can i do it?
a smple {% include 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!