U
    Ä®wh  ã                   @   s*   d dl T d dlZG dd„ dejjjƒZdS )é    )Ú*Nc                       s,   e Zd ZdZ‡ fdd„Z‡ fdd„Z‡  ZS )ÚCmfStatusHistoryTc              
      s    t ƒ  ¡ ddddddddd	g	 S )
Nzfrom_status.status_typezto_status.status_typeÚfrom_status_codeÚfrom_status_nameÚfrom_status_typeÚto_status_codeÚto_status_nameÚto_status_typeÚobj)ÚsuperÚsave_preload_fields)Úself©Ú	__class__© ú%./common/models/cmf_status_history.pyr      s        þz$CmfStatusHistory.save_preload_fieldsc                    s`   | j r$| j j| _| j j| _| j j| _| jrH| jj| _| jj| _	| jj| _
| jj| _tƒ j||ŽS )N)Zfrom_statusÚcoder   Únamer   Zstatus_typer   Z	to_statusr   r   r	   r
   Zobj_coder   Úsave)r   ÚargsÚkwargsr   r   r   r      s    






zCmfStatusHistory.save)Ú__name__Ú
__module__Ú__qualname__Z	api_allowr   r   Ú__classcell__r   r   r   r   r      s   r   )Zcmf.includeZ common.fields.cmf_status_historyÚcommonZfieldsZcmf_status_historyr   r   r   r   r   Ú<module>   s   