o
    mi                     @   sH   d dl mZ d dlmZ d dlmZmZ d dlmZ G dd deZ	dS )    )ModelSerializer)serializers)timedelta_to_custom_formatduration_string_to_timedelta)Activityc                       sN   e Zd ZejddZejddZejddZG dd dZ	 fddZ
  ZS )	DashboardActivitySerializerzproject.name)sourcezactivity_type.namezactivity_type.is_activec                   @   s   e Zd ZeZdZeZdS )z DashboardActivitySerializer.Meta)id
project_idproject_nameactivity_type_idactivity_typeis_activity_type_activestart_date_timeend_date_timetotal_durationdescription
deleted_atN)__name__
__module____qualname__r   modelfieldsread_only_fields r   r   U/var/www/html/kuke-dev/django-kuke/apps/employee/serializers/dashboard_serializers.pyMeta   s    r   c                    s$   t  |}tt|d |d< |S )Nr   )superto_representationr   r   )selfinstanceres	__class__r   r   r      s   z-DashboardActivitySerializer.to_representation)r   r   r   r   	CharFieldr   r   BooleanFieldr   r   r   __classcell__r   r   r"   r   r   
   s    r   N)
rest_framework.serializersr   rest_frameworkr   core.utils.helperr   r   apps.employee.modelsr   r   r   r   r   r   <module>   s
    