U
    9g                     @   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   