SEESenv/web/hgbook/comments/views.py
changeset 6 1ce9b33fb6ff
parent 3 6cee07c589cb
equal deleted inserted replaced
5:c9c9819cd5e5 6:1ce9b33fb6ff
     8 from django.template.loader import get_template
     8 from django.template.loader import get_template
     9 from django.utils.simplejson import dumps 
     9 from django.utils.simplejson import dumps 
    10 from p_list import *
    10 from p_list import *
    11 from BeautifulSoup import BeautifulSoup
    11 from BeautifulSoup import BeautifulSoup
    12 import glob
    12 import glob
    13 html_folder='/home/hg/repos/SEES-hacks/SEESenv/web/html/'
    13 import os
    14 
    14 home_dir=os.getenv("HOME")
    15 def sort_dict(dict):
    15 if home_dir=='/home/amit':    
    16 	new_dict = {}
    16     html_folder='/home/amit/SEES-hacks/SEESenv/web/html/'
    17 	sorted_keys = dict.keys()
    17 else:
    18 	sorted_keys.sort()
    18     html_folder='/home/hg/repos/SEES-hacks/SEESenv/web/html/'
    19 	print >> sys.stderr , sorted_keys
       
    20 	for key in sorted_keys:
       
    21 		new_dict[key] = dict[key]
       
    22 
       
    23 	return new_dict
       
    24 
    19 
    25 def dump_queries():
    20 def dump_queries():
    26     # requires settings.DEBUG to be set to True in order to work
    21     # requires settings.DEBUG to be set to True in order to work
    27     if len(connection.queries) == 1:
    22     if len(connection.queries) == 1:
    28         print connection.queries
    23         print connection.queries