o
    ÎY&j‘&  ã                   @   sP  d dl mZ d dl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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 )%é    )ÚmodelsN)ÚShop)ÚUsersc                   @   s¨   e Zd Zejdejddd�Zejdd�Zejddd�Z	ej
ddd�Zej
ddd	�Zejd
ddd�Zejdddd�Zejdddd�Zejddd�Zejdd�Zdd„ ZdS )ÚProductCategoryTF©Úprimary_keyÚdefaultÚuniqueÚeditableéd   ©Ú
max_lengthéÈ   ©r   r	   ©Úauto_now_addÚnull©Úauto_nowr   úicons/©Ú	upload_tor   Úblankústandard_images/úbanners/ú
shops.Shop©r   ©r   c                 C   ó   | j S ©N)Úcategory_name©Úself© r#   ú9/var/www/html/Testing_prj/Navya-Bakers/products/models.pyÚ__str__   ó   zProductCategory.__str__N)Ú__name__Ú
__module__Ú__qualname__r   Ú	UUIDFieldÚuuidÚuuid4Ú	CharFieldr    Úcategory_codeÚDateTimeFieldÚ
created_atÚupdated_dateÚ
ImageFieldÚiconÚstandard_imageÚbanner_imageÚManyToManyFieldÚ
sales_unitÚBooleanFieldÚlong_distance_availabilityr%   r#   r#   r#   r$   r   
   s    r   c                   @   s˜   e Zd Zejdejddd�Zejdd�Zejddd�Z	ej
eejd�Zejd	ddd
�Zejddd�Zejddd�Zejddd�Zejdd�Zdd„ ZdS )ÚProductSubCategoryTFr   r   r   r   r   ©Ú	on_deleter   r   r   r   r   r   r   c                 C   r   r   )Úsub_category_namer!   r#   r#   r$   r%   &   r&   zProductSubCategory.__str__N)r'   r(   r)   r   r*   r+   r,   r-   r=   Úsub_category_codeÚ
ForeignKeyr   ÚCASCADEÚcategoryr2   r4   r/   r0   r1   r6   r7   r8   r9   r%   r#   r#   r#   r$   r:      s    r:   c                   @   sò   e Zd Zejdddgd�Zejdd�Zejdd�Zeje	ej
d�Zejeej
d�Zejdd�Zejdd	d
gd�Zejdddd�Zejdddd�Zejdddd�Zejdddd�Zejddd�Zejddd�Zejddd�Zejdd�Zdd„ ZdS )ÚProductsr   )úMaster ProductrC   )úCustom ProductrD   ©r   Úchoiceséx   r   r;   é  ©ÚVegrJ   ©úNon VegrL   é   T©r   r   r   r   r   r   r   Fr   c                 C   s   | j › d| j› d| j› �S ©Nz - )Úitem_categoryÚitem_sub_categoryÚ	item_namer!   r#   r#   r$   r%   ;   s   zProducts.__str__N)r'   r(   r)   r   r-   Úproduct_typerR   Ú	item_coder?   r   r@   rP   r:   rQ   Ú	TextFieldÚitem_descriptionÚveg_or_non_veg_statusÚ
FloatFieldÚi_gstÚs_gstÚc_gstÚcessr/   Úcreated_dater1   r6   r7   r8   r9   r%   r#   r#   r#   r$   rB   *   s"    rB   c                   @   sÂ   e Zd Zejedejd�Zejdd�Z	ejdd�Z
e ¡ Zejdd�Zejdddd�Ze ¡ Ze ¡ Zejdg d	¢d
�Zejdd�Zejddd�Zejdd�Zejdd�Zejdd�Zdd„ ZdS )ÚSKUÚskus©Úrelated_namer<   rG   r   rM   TrN   r   ©)ÚVisiblerc   ©ÚDisabledre   ©úOut of Stockrg   rE   ©r   r   r   Fr   c                 C   s   d| j j› d| j› �S )NzSKU for ú: )ÚproductrR   Úsku_namer!   r#   r#   r$   r%   N   s   zSKU.__str__N)r'   r(   r)   r   r?   rB   r@   rj   r-   rk   Úsku_codeÚPositiveIntegerFieldÚsku_quantityÚsku_unitrX   Úsku_mrpÚsku_expiry_durationÚsku_bulk_qty_limitÚ
sku_statusr/   r0   r6   r7   r8   r9   Úsame_day_deliveryÚcustomization_availabler%   r#   r#   r#   r$   r^   >   s     r^   c                   @   ó>   e Zd Zejedejd�Zejdd�Z	ej
dd�Zdd„ Zd	S )
ÚProductImageÚimagesr`   zproduct_images/©r   Trh   c                 C   ó   d| j j› �S ©Nz
Image for ©rj   rR   r!   r#   r#   r$   r%   W   ó   zProductImage.__str__N)r'   r(   r)   r   r?   rB   r@   rj   r2   Úimager/   r]   r%   r#   r#   r#   r$   rw   R   ó
    rw   c                   @   rv   )
ÚProductVideoÚvideosr`   zproduct_videos/ry   Trh   c                 C   rz   ©Nz
Video for r|   r!   r#   r#   r$   r%   `   r}   zProductVideo.__str__N)r'   r(   r)   r   r?   rB   r@   rj   Ú	FileFieldÚvideor/   r]   r%   r#   r#   r#   r$   r€   [   r   r€   c                   @   s€   e Zd Zejeejd�Zejedejd�Z	ej
g d¢d�Zejdd�Ze ¡ Zejdd	�Zejd
d�Zdd„ ZG dd„ dƒZdS )ÚProductReviewr;   Úreviewsr`   ))é   z1 Star)é   z2 Stars)é   z3 Stars)é   z4 Stars)é   z5 Stars)rF   é–   r   Fr   Trh   c                 C   s    | j j› d| j j› d| jj› �S )Nú z's review on ©ÚuserÚ
first_nameÚ	last_namerj   rR   r!   r#   r#   r$   r%   l   s    zProductReview.__str__c                   @   s   e Zd ZdgZdS )zProductReview.Metaz-created_atN)r'   r(   r)   Úorderingr#   r#   r#   r$   ÚMetao   s    
r“   N)r'   r(   r)   r   r?   r   r@   r�   rB   rj   rm   Úratingr-   Úreview_headingrU   Úreview_textr8   Úis_approvedr/   r0   r%   r“   r#   r#   r#   r$   r…   c   s    r…   c                   @   sV   e Zd Zejeejd�Zejeejddd�Z	ej
dg d¢dd�Zej
dg d¢d�Zd	S )
ÚSalesUnitProductSelectionr;   T)r<   r   r   r   rb   re   ©r   rF   r   rE   N)r'   r(   r)   r   r?   r   r@   r7   r^   Úskur-   Úshop_admin_statusÚstatusr#   r#   r#   r$   r˜   r   s
    r˜   c                   @   sF   e Zd Zejdd�Zejdddd�Ze e	¡Z
ejdd�Zdd„ Zd	S )
ÚTagsé#   r   r   Tr   rh   c                 C   r   r   )Útag_namer!   r#   r#   r$   r%   €   r&   zTags.__str__N)r'   r(   r)   r   r-   rŸ   r2   r3   r6   rB   Úproductsr/   r0   r%   r#   r#   r#   r$   r�   z   s    
r�   c                   @   s6   e Zd Zejdd�Ze e¡Zej	dd�Z
dd„ ZdS )ÚDynamicFilteringrž   r   Trh   c                 C   r   r   )Úfilter_namer!   r#   r#   r$   r%   ‰   r&   zDynamicFiltering.__str__N)r'   r(   r)   r   r-   r¢   r6   rB   r    r/   r0   r%   r#   r#   r#   r$   r¡   „   s
    
r¡   c                   @   sf   e Zd Zejdd�Zejdddd�Zejdddd�Zejdddd�Z	e 
e¡Zejdd�Zd	d
„ ZdS )ÚSpecialListrž   r   r   Tr   r   r   rh   c                 C   r   r   )Úspecial_namer!   r#   r#   r$   r%   •   r&   zSpecialList.__str__N)r'   r(   r)   r   r-   r¤   r2   r3   r4   r5   r6   rB   r    r/   r0   r%   r#   r#   r#   r$   r£   �   s    
r£   c                   @   s¬   e Zd Zejdd�Zejdd�Zejdd�Zejdddgd�Z	ej
dd	�Zej
d
d	�Zejdg d¢ddd�Zg d¢Zejdedd�Zejddd�Zejddd�Zdd„ ZdS )ÚCustomProductrG   r   rH   r   rI   rK   rE   zMinimum size of the product)Ú	help_textzMaximum size of the productrM   ))Úgr§   )Úkgr¨   )Úmlr©   )Úlrª   r§   z2Unit of size (grams, kilograms, milliliters, etc.))r   rF   r   r¦   ))Ú	Availabler«   rd   rf   r«   r™   Tr   r   c                 C   s   | j › d| j› �S rO   )rR   rW   r!   r#   r#   r$   r%   ¬   s   zCustomProduct.__str__N)r'   r(   r)   r   r-   rR   rT   rU   rV   rW   rm   Úmin_sizeÚmax_sizeÚ	size_unitÚAVAILABILITY_CHOICESÚavailabilityr/   r]   r1   r%   r#   r#   r#   r$   r¥   ™   s    r¥   c                   @   rv   )
ÚCustomProductImagerx   r`   zcustom_product_images/ry   Trh   c                 C   rz   r{   ©Úcustom_productrR   r!   r#   r#   r$   r%   ´   r}   zCustomProductImage.__str__N)r'   r(   r)   r   r?   r¥   r@   r³   r2   r~   r/   r]   r%   r#   r#   r#   r$   r±   ¯   r   r±   c                   @   rv   )
ÚCustomProductVideor�   r`   zcustom_product_videos/ry   Trh   c                 C   rz   r‚   r²   r!   r#   r#   r$   r%   ¼   r}   zCustomProductVideo.__str__N)r'   r(   r)   r   r?   r¥   r@   r³   rƒ   r„   r/   r]   r%   r#   r#   r#   r$   r´   ·   r   r´   c                   @   s\   e Zd Zejeejd�Zejeejd�Z	ej
dd�Zej
ddd�ZG dd„ dƒZdd„ Zd	S )
ÚWishlistr;   Trh   r   c                   @   s   e Zd ZdZdS )zWishlist.Meta)r�   rj   N)r'   r(   r)   Úunique_togetherr#   r#   r#   r$   r“   Å   s    r“   c                 C   s"   d| j j› d| j j› d| jj› �S )NzWishlist item for r�   ri   rŽ   r!   r#   r#   r$   r%   È   s   "zWishlist.__str__N)r'   r(   r)   r   r?   r   r@   r�   rB   rj   r/   r0   Ú
updated_atr“   r%   r#   r#   r#   r$   rµ   ¿   s    rµ   c                   @   sJ   e Zd Zejeejdd�Ze e¡Z	ej
dd�Zej
ddd�Zdd„ ZdS )	ÚYouMayAlsoLiker    )r<   ra   Trh   r   c                 C   rz   )NzAlso Liked Items for r|   r!   r#   r#   r$   r%   Ð   r}   zYouMayAlsoLike.__str__N)r'   r(   r)   r   ÚOneToOneFieldrB   r@   rj   r6   Úliked_productsr/   r0   r·   r%   r#   r#   r#   r$   r¸   Ë   s    
r¸   )Ú	django.dbr   r+   Úshops.modelsr   Úaccounts.modelsr   ÚModelr   r:   rB   r^   rw   r€   r…   r˜   r�   r¡   r£   r¥   r±   r´   rµ   r¸   r#   r#   r#   r$   Ú<module>   s(    	
	