o
    `:i
                     @   s  d dl mZ d dlmZ d dlT 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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G dd dejZG dd dejZdS )    )User)serializers)*)RefreshTokenc                   @   sB   e Zd ZejddZejddZG dd dZdd Zdd Z	d	S )
AuthenticationSerializerT)	read_onlyc                   @      e Zd ZeZg dZdS )zAuthenticationSerializer.Meta)idemailusernametokenrefreshTokenN)__name__
__module____qualname__r   modelfields r   r   0/var/www/html/premium_crap/admins/serializers.pyMeta       r   c                 C   s   t |}t|jS N)r   for_userstraccess_tokenselfinstancerefreshr   r   r   	get_token   s   

z"AuthenticationSerializer.get_tokenc                 C   s   t |}t|S r   )r   r   r   r   r   r   r   get_refreshToken   s   
z)AuthenticationSerializer.get_refreshTokenN)
r   r   r   r   SerializerMethodFieldr   r   r   r   r    r   r   r   r   r   
   s    r   c                   @   s,   e Zd ZejddZejddidddZdS )AdminLoginSerializerTrequired
input_typepasswordstyle
write_onlyr$   N)r   r   r   r   
EmailFieldr
   	CharFieldr&   r   r   r   r   r"      s    r"   c                   @      e Zd ZejddZdS )!AdminForgotPasswordViewSerializerTr#   N)r   r   r   r   r*   r
   r   r   r   r   r-           r-   c                   @   s$   e Zd ZejddZejddZdS )&AdminVerifyForgotPasswordOTPSerializerTr#   N)r   r   r   r   r*   r
   IntegerFieldotpr   r   r   r   r/   $   s    r/   c                   @   s@   e Zd ZejddZejddidddZejddidddZdS )AdminSetNewPasswordSerializerTr#   r%   r&   r'   N)	r   r   r   r   r*   r
   r+   newPasswordconfirmPasswordr   r   r   r   r2   )   s    r2   c                   @   r,   )AdminLogoutSerializerTr#   N)r   r   r   r   r+   r   r   r   r   r   r5   /   r.   r5   c                   @      e Zd ZG dd dZdS )CategoryGetSerializerc                   @      e Zd ZeZdZdS )zCategoryGetSerializer.Meta__all__Nr   r   r   Categoryr   r   r   r   r   r   r   4       r   Nr   r   r   r   r   r   r   r   r7   3       r7   c                   @   r6   )CategoryCreateSerializerc                   @   r8   )zCategoryCreateSerializer.Metar9   Nr:   r   r   r   r   r   :   r<   r   Nr=   r   r   r   r   r?   9   r>   r?   c                   @   r6   )CategoryUpdateSerializerc                   @   r8   )zCategoryUpdateSerializer.Metar9   Nr:   r   r   r   r   r   @   r<   r   Nr=   r   r   r   r   r@   ?   r>   r@   c                   @   r6   )CraptitudeGetSerializerc                   @   r8   )zCraptitudeGetSerializer.Metar9   Nr   r   r   
Craptituder   r   r   r   r   r   r   F   r<   r   Nr=   r   r   r   r   rA   E   r>   rA   c                   @   r6   )CraptitudeCreateSerializerc                   @   r8   )zCraptitudeCreateSerializer.Metar9   NrB   r   r   r   r   r   L   r<   r   Nr=   r   r   r   r   rD   K   r>   rD   c                   @   r6   )CraptitudeUpdateSerializerc                   @   r   )zCraptitudeUpdateSerializer.Meta)r	   diaperPrefixdumpsterPrefixNrB   r   r   r   r   r   R   r   r   Nr=   r   r   r   r   rE   Q   r>   rE   N)django.contrib.auth.modelsr   rest_frameworkr   
api.modelsrest_framework_simplejwt.tokensr   ModelSerializerr   
Serializerr"   r-   r/   r2   r5   r7   r?   r@   rA   rD   rE   r   r   r   r   <module>   s     