# -*- coding: utf-8 -*- 
from neuron.models import DataSet
import logging
import time


loggermsg = logging.getLogger('django')

def makeDict():
	dictonary = dict()
	qeuryDataSet = DataSet.objects.exclude(close_effectivnes__isnull=True)
	for each_deal in qeuryDataSet:
		time_tuple = time.strptime(str(each_deal.open_time).split('+')[0], "%Y-%m-%d %H:%M:%S")
	        open_time = time.mktime(time_tuple)


		dictonary[str(each_deal.open_magicnum)] = [
			    each_deal.open_close_1,\
			    each_deal.open_open_1,\
			    each_deal.open_high_1,\
			    each_deal.open_low_1,\
			    each_deal.open_upband_1,\
			    each_deal.open_lowband_1,\
			    each_deal.open_midleband_1,\
			    each_deal.open_jaw_1,\
			    each_deal.open_lips_1,\
			    each_deal.open_teeth_1,\
			    each_deal.open_volume_1,\

			    each_deal.open_close_2,\
			    each_deal.open_open_2,\
			    each_deal.open_high_2,\
			    each_deal.open_low_2,\
			    each_deal.open_upband_2,\
			    each_deal.open_lowband_2,\
			    each_deal.open_midleband_2,\
			    each_deal.open_jaw_2,\
			    each_deal.open_lips_2,\
			    each_deal.open_teeth_2,\
			    each_deal.open_volume_2,\

			    each_deal.open_close_3,\
			    each_deal.open_open_3,\
			    each_deal.open_high_3,\
			    each_deal.open_low_3,\
			    each_deal.open_upband_3,\
			    each_deal.open_lowband_3,\
			    each_deal.open_midleband_3,\
			    each_deal.open_jaw_3,\
			    each_deal.open_lips_3,\
			    each_deal.open_teeth_3,\
			    each_deal.open_volume_3,\

			    each_deal.open_close_4,\
			    each_deal.open_open_4,\
			    each_deal.open_high_4,\
			    each_deal.open_low_4,\
			    each_deal.open_upband_4,\
			    each_deal.open_lowband_4,\
			    each_deal.open_midleband_4,\
			    each_deal.open_jaw_4,\
			    each_deal.open_lips_4,\
			    each_deal.open_teeth_4,\
			    each_deal.open_volume_4,\

			    each_deal.open_close_5,\
			    each_deal.open_open_5,\
			    each_deal.open_high_5,\
			    each_deal.open_low_5,\
			    each_deal.open_upband_5,\
			    each_deal.open_lowband_5,\
			    each_deal.open_midleband_5,\
			    each_deal.open_jaw_5,\
			    each_deal.open_lips_5,\
			    each_deal.open_teeth_5,\
			    each_deal.open_volume_5,\

			    each_deal.open_close_6,\
			    each_deal.open_open_6,\
			    each_deal.open_high_6,\
			    each_deal.open_low_6,\
			    each_deal.open_upband_6,\
			    each_deal.open_lowband_6,\
			    each_deal.open_midleband_6,\
			    each_deal.open_jaw_6,\
			    each_deal.open_lips_6,\
			    each_deal.open_teeth_6,\
			    each_deal.open_volume_6,\

			    each_deal.open_close_7,\
			    each_deal.open_open_7,\
			    each_deal.open_high_7,\
			    each_deal.open_low_7,\
			    each_deal.open_upband_7,\
			    each_deal.open_lowband_7,\
			    each_deal.open_midleband_7,\
			    each_deal.open_jaw_7,\
			    each_deal.open_lips_7,\
			    each_deal.open_teeth_7,\
			    each_deal.open_volume_7,\

			    each_deal.open_close_8,\
			    each_deal.open_open_8,\
			    each_deal.open_high_8,\
			    each_deal.open_low_8,\
			    each_deal.open_upband_8,\
			    each_deal.open_lowband_8,\
			    each_deal.open_midleband_8,\
			    each_deal.open_jaw_8,\
			    each_deal.open_lips_8,\
			    each_deal.open_teeth_8,\
			    each_deal.open_volume_8,\

			    each_deal.open_close_9,\
			    each_deal.open_open_9,\
			    each_deal.open_high_9,\
			    each_deal.open_low_9,\
			    each_deal.open_upband_9,\
			    each_deal.open_lowband_9,\
			    each_deal.open_midleband_9,\
			    each_deal.open_jaw_9,\
			    each_deal.open_lips_9,\
			    each_deal.open_teeth_9,\
			    each_deal.open_volume_9,\

			    each_deal.open_close_10,\
			    each_deal.open_open_10,\
			    each_deal.open_high_10,\
			    each_deal.open_low_10,\
			    each_deal.open_upband_10,\
			    each_deal.open_lowband_10,\
			    each_deal.open_midleband_10,\
			    each_deal.open_jaw_10,\
			    each_deal.open_lips_10,\
			    each_deal.open_teeth_10,\
			    each_deal.open_volume_10,\

			    each_deal.open_close_11,\
			    each_deal.open_open_11,\
			    each_deal.open_high_11,\
			    each_deal.open_low_11,\
			    each_deal.open_upband_11,\
			    each_deal.open_lowband_11,\
			    each_deal.open_midleband_11,\
			    each_deal.open_jaw_11,\
			    each_deal.open_lips_11,\
			    each_deal.open_teeth_11,\
			    each_deal.open_volume_11,\

			    each_deal.open_close_12,\
			    each_deal.open_open_12,\
			    each_deal.open_high_12,\
			    each_deal.open_low_12,\
			    each_deal.open_upband_12,\
			    each_deal.open_lowband_12,\
			    each_deal.open_midleband_12,\
			    each_deal.open_jaw_12,\
			    each_deal.open_lips_12,\
			    each_deal.open_teeth_12,\
			    each_deal.open_volume_12,\

			    each_deal.open_close_13,\
			    each_deal.open_open_13,\
			    each_deal.open_high_13,\
			    each_deal.open_low_13,\
			    each_deal.open_upband_13,\
			    each_deal.open_lowband_13,\
			    each_deal.open_midleband_13,\
			    each_deal.open_jaw_13,\
			    each_deal.open_lips_13,\
			    each_deal.open_teeth_13,\
			    each_deal.open_volume_13,\

			    each_deal.open_close_14,\
			    each_deal.open_open_14,\
			    each_deal.open_high_14,\
			    each_deal.open_low_14,\
			    each_deal.open_upband_14,\
			    each_deal.open_lowband_14,\
			    each_deal.open_midleband_14,\
			    each_deal.open_jaw_14,\
			    each_deal.open_lips_14,\
			    each_deal.open_teeth_14,\
			    each_deal.open_volume_14,\

			    each_deal.open_close_15,\
			    each_deal.open_open_15,\
			    each_deal.open_high_15,\
			    each_deal.open_low_15,\
			    each_deal.open_upband_15,\
			    each_deal.open_lowband_15,\
			    each_deal.open_midleband_15,\
			    each_deal.open_jaw_15,\
			    each_deal.open_lips_15,\
			    each_deal.open_teeth_15,\
			    each_deal.open_volume_15,\

			    each_deal.open_close_16,\
			    each_deal.open_open_16,\
			    each_deal.open_high_16,\
			    each_deal.open_low_16,\
			    each_deal.open_upband_16,\
			    each_deal.open_lowband_16,\
			    each_deal.open_midleband_16,\
			    each_deal.open_jaw_16,\
			    each_deal.open_lips_16,\
			    each_deal.open_teeth_16,\
			    each_deal.open_volume_16,\

			    each_deal.open_close_17,\
			    each_deal.open_open_17,\
			    each_deal.open_high_17,\
			    each_deal.open_low_17,\
			    each_deal.open_upband_17,\
			    each_deal.open_lowband_17,\
			    each_deal.open_midleband_17,\
			    each_deal.open_jaw_17,\
			    each_deal.open_lips_17,\
			    each_deal.open_teeth_17,\
			    each_deal.open_volume_17,\

			    each_deal.open_close_18,\
			    each_deal.open_open_18,\
			    each_deal.open_high_18,\
			    each_deal.open_low_18,\
			    each_deal.open_upband_18,\
			    each_deal.open_lowband_18,\
			    each_deal.open_midleband_18,\
			    each_deal.open_jaw_18,\
			    each_deal.open_lips_18,\
			    each_deal.open_teeth_18,\
			    each_deal.open_volume_18,\

			    each_deal.open_close_19,\
			    each_deal.open_open_19,\
			    each_deal.open_high_19,\
			    each_deal.open_low_19,\
			    each_deal.open_upband_19,\
			    each_deal.open_lowband_19,\
			    each_deal.open_midleband_19,\
			    each_deal.open_jaw_19,\
			    each_deal.open_lips_19,\
			    each_deal.open_teeth_19,\
			    each_deal.open_volume_19,\

			    each_deal.open_close_20,\
			    each_deal.open_open_20,\
			    each_deal.open_high_20,\
			    each_deal.open_low_20,\
			    each_deal.open_upband_20,\
			    each_deal.open_lowband_20,\
			    each_deal.open_midleband_20,\
			    each_deal.open_jaw_20,\
			    each_deal.open_lips_20,\
			    each_deal.open_teeth_20,\
			    each_deal.open_volume_20,\

			    each_deal.open_close_21,\
			    each_deal.open_open_21,\
			    each_deal.open_high_21,\
			    each_deal.open_low_21,\
			    each_deal.open_upband_21,\
			    each_deal.open_lowband_21,\
			    each_deal.open_midleband_21,\
			    each_deal.open_jaw_21,\
			    each_deal.open_lips_21,\
			    each_deal.open_teeth_21,\
			    each_deal.open_volume_21,\

			    each_deal.open_close_22,\
			    each_deal.open_open_22,\
			    each_deal.open_high_22,\
			    each_deal.open_low_22,\
			    each_deal.open_upband_22,\
			    each_deal.open_lowband_22,\
			    each_deal.open_midleband_22,\
			    each_deal.open_jaw_22,\
			    each_deal.open_lips_22,\
			    each_deal.open_teeth_22,\
			    each_deal.open_volume_22,\

			    each_deal.open_close_23,\
			    each_deal.open_open_23,\
			    each_deal.open_high_23,\
			    each_deal.open_low_23,\
			    each_deal.open_upband_23,\
			    each_deal.open_lowband_23,\
			    each_deal.open_midleband_23,\
			    each_deal.open_jaw_23,\
			    each_deal.open_lips_23,\
			    each_deal.open_teeth_23,\
			    each_deal.open_volume_23,\

			    each_deal.open_close_24,\
			    each_deal.open_open_24,\
			    each_deal.open_high_24,\
			    each_deal.open_low_24,\
			    each_deal.open_upband_24,\
			    each_deal.open_lowband_24,\
			    each_deal.open_midleband_24,\
			    each_deal.open_jaw_24,\
			    each_deal.open_lips_24,\
			    each_deal.open_teeth_24,\
			    each_deal.open_volume_24,\
			    open_time,\

			    int(each_deal.close_effectivnes),\
			    each_deal.open_type
			]
	loggermsg.info(dictonary)
	return dictonary
