<commit_before># Create your views here.

from django.contrib.auth.decorators import login_required
from django.http import HttpResponse


from django.shortcuts import render, redirect

import json


@login_required
def show_dashboard(request):
    return render(request, 'dashboard/index.html', {})

@login_required
def get_all_resumes(request):
    #try :
    numOfCv = len(request.user.resumizr_data.resume_data['resume'])
    _json = {}
    for x in xrange(1,numOfCv + 1):
        x = str(x)
        _json[x] = request.user.resumizr_data.resume_data['resume'][x]['UpdatedOn']

    return HttpResponse(json.dumps(_json),mimetype='application/json')
        #return HttpResponse(json.dumps(request.user.resumizr_data.resume_data['resume']),mimetype='application/json')
    #except :
    #    return HttpResponse(json.dumps({'ERROR':'No such resumse data found'}),mimetype='application/json')
<commit_msg>showing different resumes along with last updated dateime<commit_after># Create your views here.

from django.contrib.auth.decorators import login_required
from django.http import HttpResponse


from django.shortcuts import render, redirect

import json

import time

@login_required
def show_dashboard(request):    
    return render(request, 'dashboard/index.html', {})

@login_required
def create_new_resume(request):
    numOfCv = len(request.user.resumizr_data.resume_data['resume']) + 1;
    now = time.strftime('%x %X')
    #request.user.resumizr_data.resume_data['resume'] = {}
    request.user.resumizr_data.resume_data['resume'][str(numOfCv)]= {'UpdatedOn': now}
    request.user.resumizr_data.save()
    return HttpResponse(json.dumps({'no':numOfCv}),mimetype='application/json')

@login_required
def get_all_resumes(request):
    #try :
    numOfCv = len(request.user.resumizr_data.resume_data['resume'])
    _json = {}
    for x in xrange(1,numOfCv + 1):
        x = str(x)
        try:
            _json[x] = request.user.resumizr_data.resume_data['resume'][x]['UpdatedOn']
        except:
            _json[x] = ''
    return HttpResponse(json.dumps(_json),mimetype='application/json')
        #return HttpResponse(json.dumps(request.user.resumizr_data.resume_data['resume']),mimetype='application/json')
    #except :
    #    return HttpResponse(json.dumps({'ERROR':'No such resumse data found'}),mimetype='application/json')

{'fraction_non_alphanumeric': 0.13239676458067262, 'fraction_numerical': 0.0021285653469561515, 'mean_word_length': 4.635491606714628, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6093688', 'n_tokens_mistral': 777, 'n_tokens_neox': 792, 'n_words': 134}