o
    6A5hO$                     @   s>  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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editabled   
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   choicesx   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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%   L   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   r%   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%   U      zProductImage.__str__N)r'   r(   r)   r   r?   rB   r@   rj   r2   imager/   r]   r%   r#   r#   r#   r$   ru   P   
    ru   c                   @   rt   )
ProductVideovideosr`   zproduct_videos/rw   Trh   c                 C   rx   Nz
Video for rz   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~   Y   r}   r~   c                   @   st   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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   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%   j   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$   Metam   s    
r   N)r'   r(   r)   r   r?   r   r@   r   rB   rj   rm   ratingr-   review_headingrU   review_textr/   r0   r%   r   r#   r#   r#   r$   r   a   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   p   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   x   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                   @   rt   )
CustomProductImagerv   r`   zcustom_product_images/rw   Trh   c                 C   rx   ry   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                   @   rt   )
CustomProductVideor   r`   zcustom_product_videos/rw   Trh   c                 C   rx   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   )	django.dbr   r+   shops.modelsr   accounts.modelsr   Modelr   r:   rB   r^   ru   r~   r   r   r   r   r   r   r   r   r   r#   r#   r#   r$   <module>   s&    	
	