B
    GDbt                 @   sL   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 edd Z
dS )	    )TemplateResponse)JsonResponse)csrf_exempt)check_formula)LeaveCategoryc             C   s~   | j dkrD| jdd}t|\}}|s6td|dS tdddS tjj| jj	d
d	}d
d |D }d|i}t| d|S )NPOSTcheck )codemsgr   ZSuccess)Z
company_idcategory_namec             S   s   g | ]}t |d  qS )r   )str).0i r   8G:\easytimepro\master/mysite/payroll\views\calculator.py
<listcomp>   s    z#calculator_view.<locals>.<listcomp>Zleave_categoryszpayroll/calculator.html)methodr   getr   r   r   ZobjectsfilteruserZcurrent_companyvaluesr   )Zrequestr   resr   Z	categoryscontextr   r   r   calculator_view	   s    
r   N)Zdjango.template.responser   Zdjango.httpr   Zdjango.views.decorators.csrfr   Zmysite.payroll.utilsr   Z%mysite.att.models.model_leavecategoryr   r   r   r   r   r   <module>   s
   