
    Jh                         d dl m Z  d dlmZ d dlmZmZmZmZmZm	Z	m
Z
 d dlmZ d dlmZ  G d de      Z G d d	e      Zy
)    )datetime)Optional)ColumnDateTime
ForeignKeyIntegerStringUniqueConstraintIndex)relationship)Basec                      e Zd ZdZ eedd      Z e ed      d      Z ee e	d      dd      Z
 ee e	d	      dd      Z ee e	d
      dd      Z eeej                  d      Z eeej                  ej                  d      Z eed      Z edd      Z edd      Z edddd      Z edd      Z edddddd       edddd       edd      fZy)AppellationappellationsTprimary_keyindex   Fnullablecountries.idr   r   
regions.idsub_regions.iddefaultr   r   onupdater   Countryback_populatesRegionSubAppellationappellationzall, delete-orphan)r!   cascadepassive_deletesWine
country_id	region_idsub_region_idname
deleted_at!uq_appellation_scope_name_deletedr+   ix_appellations_scopeix_appellations_nameN)__name__
__module____qualname____tablename__r   r   idr	   r+   r   r(   r)   r*   r   r   utcnowdate_createdlast_updatedr,   r   countryregionsub_appellationswinesr
   r   __table_args__     f/var/www/html/wine-match-dev/backend/winematch-backend/src/apps/wine/appellation/models/appellation.pyr   r      s   "M	T	6B&+.DN!;eSWXJw
< 85PTUI7J/?$@5X\]M(HOOeLL(HOOhoo`efL40J9^DG(>BF#$$	 >E 	+4	
 	%|[/R$f-Nr?   r   c                      e Zd ZdZdZ eedd      Z e ed      d      Z	 ee e
d      dd	      Z ee e
d
      dd	      Z ee e
d      dd	      Z ee e
d      dd	      Z eeej"                  d      Z eeej"                  ej"                  d      Z eed      Z edd      Z edd      Z edd      Z edddd       eddddd       edd      fZy)r#   zY
    Represents the 'site' level in your Groovy code.
    Belongs to an Appellation.
    r;   Tr   r   Fr   zappellations.idr   r   r   r   r   r   r   r    r   r"   appellation_idr+   r,   +uq_sub_appellation_appellation_name_deletedr.   ix_sub_appellations_lineager(   r)   r*   ix_sub_appellations_nameN)r1   r2   r3   __doc__r4   r   r   r5   r	   r+   r   rB   r(   r)   r*   r   r   r6   r7   r8   r,   r   r$   r9   r:   r
   r   r=   r>   r?   r@   r#   r#   5   s    'M	T	6B&+.DGZ0A%BUZ^_NN!;eSWXJw
< 85PTUI7J/?$@5X\]M(HOOeLL(HOOhoo`efL40J}=OPK95GHG(3EFF 	fl>	
 	+\;Yij(&1Nr?   r#   N)r   typingr   
sqlalchemyr   r   r   r   r	   r
   r   sqlalchemy.ormr   src.core.models.baser   r   r#   r>   r?   r@   <module>rK      s;        ( % $  FT r?   