src/hdalab/views/profile.py
author cavaliet
Fri, 18 Jul 2014 12:57:31 +0200
changeset 297 0a742e5a25aa
parent 296 c69dfb9d410e
child 299 8e00641076e7
permissions -rw-r--r--
save and load renkan to edit from profile page

# -*- coding: utf-8 -*-
'''
Created on Jul 01, 2014

@author: tc
'''
from datetime import datetime
from django.conf import settings
from django.views.generic import TemplateView
from hdalab.models.renkan import Renkan
import uuid

import logging
logger = logging.getLogger(__name__)


class ProfileHome(TemplateView):
    
    template_name = "profile_home.html"
    
    def get_context_data(self, **kwargs):
        context = super(ProfileHome, self).get_context_data(**kwargs)
        
#        now = datetime.utcnow().isoformat()
         
#         rk = Renkan()
#         rk.rk_id = unicode(uuid.uuid1())
#         rk.owner = self.request.user
#         rk.content = '{"parrot":"dead"}'
#         rk.title = now
#         rk.save()
        
        context['renkan_list'] = Renkan.objects.filter(owner=self.request.user).order_by("-modification_date")
        
        #now = datetime.utcnow()
        #context['renkan_list'] = [
        #    {"id":"a", "title":"title Renkan 1", "modification_date":now, "thumbnail":"http://icons.iconarchive.com/icons/visualpharm/ios7v2/256/Charts-Mind-map-icon.png"}, 
        #    {"id":"b", "title":"2 title Renkan 2", "modification_date":now, "thumbnail":"http://a5.mzstatic.com/us/r30/Purple4/v4/ec/6f/d1/ec6fd10f-f295-eed7-d94f-3d9da39efc64/icon_256.png"}
        #]
        
        return context