B
    ADbN                 @   s   d dl mZ d dlmZ d dlmZ G dd dejZG dd dejZG dd	 d	ejZ	G d
d dejZ
G dd dejZdS )    )serializers)AttShift)util_serializersc               @   s8   e Zd Ze ZejdddZdd ZG dd dZ	dS )	AttShiftSerializerget_cycle_unit_displayT)source
allow_nullc             C   sB   |j jddd}g }xt|D ]}|r|| qW dt|S )Ntime_interval__aliasT)flat,)shiftdetail_setvalues_listlistappendjoinset)selfobjtbsZtemp_tbstb r   HG:\easytimepro\master/mysite/att\api\serializers\attshift_serializers.pyget_shift_timetable   s    z&AttShiftSerializer.get_shift_timetablec               @   s    e Zd ZeZddddddgZdS )zAttShiftSerializer.Metaidaliasshift_timetable
cycle_unitshift_cycle
auto_shiftN)__name__
__module____qualname__r   modelfieldsr   r   r   r   Meta   s   r$   N)
r   r    r!   r   SerializerMethodFieldr   	CharFieldr   r   r$   r   r   r   r   r   
   s
   r   c               @   s8   e Zd Ze ZejdddZdd ZG dd dZ	dS )	AttShiftExportSerializerr   T)r   r   c             C   s   |j jddd}dt|S )Nr	   T)r
   r   )r   r   r   r   )r   r   r   r   r   r   r   !   s    z,AttShiftExportSerializer.get_shift_timetablec               @   s    e Zd ZeZddddddgZdS )zAttShiftExportSerializer.Metar   r   r   r   r   r   N)r   r    r!   r   r"   r#   r   r   r   r   r$   %   s   r$   N)
r   r    r!   r   r%   r   r&   r   r   r$   r   r   r   r   r'      s
   r'   c               @   s   e Zd ZG dd dZdS )AttShiftCreateSerializerc               @   s   e Zd ZeZdZdS )zAttShiftCreateSerializer.Meta__all__N)r   r    r!   r   r"   r#   r   r   r   r   r$   ,   s   r$   N)r   r    r!   r$   r   r   r   r   r(   *   s   r(   c               @   s   e Zd ZG dd dZdS )AttShiftEditSerializerc               @   s   e Zd ZeZdZdS )zAttShiftEditSerializer.Metar)   N)r   r    r!   r   r"   r#   r   r   r   r   r$   3   s   r$   N)r   r    r!   r$   r   r   r   r   r*   1   s   r*   c               @   s   e Zd ZG dd dZdS )AttShiftActionSerializerc               @   s   e Zd ZeZdZdS )zAttShiftActionSerializer.Meta))deleter,   N)r   r    r!   r   r"   Zaction_type_choicesr   r   r   r   r$   :   s   r$   N)r   r    r!   r$   r   r   r   r   r+   8   s   r+   N)Zrest_frameworkr   Z mysite.att.models.model_attshiftr   Zmysite.att.api.serializersr   ZModelSerializerr   r'   r(   r*   ZObjectActionSerializerr+   r   r   r   r   <module>   s   