
    VhK                         d dl mZ d dlmZ  G d dej                        Z G d dej                        Z G d dej                        Zy	)
    )models)slugifyc                   ^    e Zd Z ej                  d      Z ej                  d      Zd Zy)BookCategoryd   
max_lengthT)uniquec                     | j                   S Nnameselfs    1/var/www/html/grow-django/grow/bookshop/models.py__str__zBookCategory.__str__       yy    N)	__name__
__module____qualname__r   	CharFieldr   	SlugFieldslugr    r   r   r   r      s+    6s+D64(Dr   r   c                        e Zd Z ej                  dd      Z ej                  dd      Z ej                  e	ddd      Z
 fdZd	 Z xZS )
Authorr   T)r	   r
   )r
   blankauthorsz+Select the categories this author writes in)related_namer   	help_textc                 p    | j                   st        | j                        | _         t        |   |i | y r   )r   r   r   supersave)r   argskwargs	__class__s      r   r$   zAuthor.save   s+    yy		*DId%f%r   c                     | j                   S r   r   r   s    r   r   zAuthor.__str__   r   r   )r   r   r   r   r   r   r   r   ManyToManyFieldr   
categoriesr$   r   __classcell__)r'   s   @r   r   r      sS    !!!S>D!!!T:D'''?	J&r   r   c                   L   e Zd Z ej                  d      Z ej                  d      Z ej                         Z	 ej                  d      Z ej                  eej                  d      Z ej                  ed	d	ej                  d
      Z ej$                  d	      Zd Zy)Book   r   zbook_covers/)	upload_toF)defaultbooks)	on_deleter    T)nullr   r2   r    )auto_now_addc                     | j                   S r   )titler   s    r   r   zBook.__str__6   s    zzr   N)r   r   r   r   r   r6   
ImageFieldcover_imageURLFieldamazon_linkBooleanFieldfeatured
ForeignKeyr   CASCADEcategoryr   authorDateTimeField
created_atr   r   r   r   r-   r-   !   s    #6##s3E$6$$~>K"6??$K&6&&u5H$6$$..H V..F (6''T:Jr   r-   N)	django.dbr   django.utils.textr   Modelr   r   r-   r   r   r   <module>rF      s;     %6<< V\\ *6<< r   