# -*- 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

        
    