B
    b5                 @   s   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
 d dlmZ d dlmZmZ G dd	 d	ejZG d
d dejZdS )    )ModelChoiceField)gettext_lazy)admin)forms)ActionHandleError)widgets)Employee
Departmentc               @   s   e Zd ZejedddZdS )SetDepartmentFormemployeeF)labelrequiredN)__name__
__module____qualname__r   ZEmployeeManyToManyField_Zemp r   r   DG:\easytimepro\master/mysite/personnel\actions\department_actions.pyr
      s   r
   c               @   s8   e Zd ZedZedZedZeZdZ	dZ
dd ZdS )SetDepartmentZ department_action_adjustEmployeeZ'department_action_adjustEmployeeHelpTxtZ+department_action_adjustEmployeeDescriptionTc             O   s>   | j jd}|sttdtjj|dj| jd d d S )Nr   Zselect_none_employee)Zid__inr   )Z
department)	ZrequestZPOSTZgetlistr   r   r   Zobjectsfilterupdate)selfargskwargsZempsr   r   r   action   s    zSetDepartment.actionN)r   r   r   r   Zverbose_nameZhelp_txtZshort_descriptionr
   Zaction_formZunique_object_requiredZbatch_selectr   r   r   r   r   r      s   r   N)Zdjango.formsr   Zdjango.utils.translationr   r   mysiter   Zmysite.adminr   Zmysite.admin.actionr   Zmysite.personnelr   Zmysite.personnel.modelsr   r	   ZZKActionFormr
   ZZKModelActionr   r   r   r   r   <module>   s   