django integrate htmls into templates

Posted by dana on Stack Overflow See other posts from Stack Overflow or by dana
Published on 2010-05-24T21:05:46Z Indexed on 2010/05/24 21:11 UTC
Read the original article Hit count: 218

Filed under:
|
|
|

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!

  • © Stack Overflow or respective owner

    Related posts about html

    Related posts about django