
    h                        d dl Z d dlmZ d dlmZ d dlmZmZ d dlm	Z	m
Z
mZ d dlmZ  G d de	      Z G d	 d
e      Z G d de	      Z G d dej"                        Z G d de	      Z G d de      Z G d de	      Z G d de	      Z G d de	      Z G d de	      Z G d de	      Z G d de	      Z G d d e      Z G d! d"e	      Z G d# d$e	      Z G d% d&e      Z G d' d(e	      Z G d) d*e      Z  G d+ d,e	      Z! G d- d.e      Z" G d/ d0e      Z# G d1 d2ejH                        Z% G d3 d4e	      Z& G d5 d6e      Z' G d7 d8e	      Z( G d9 d:e	      Z) G d; d<e	      Z* G d= d>e	      Z+ G d? d@e      Z, G dA dBejH                        Z- G dC dDe	      Z. G dE dFejH                        Z/ G dG dHe	      Z0 G dI dJejH                        Z1y)K    N)models)reverse)TranslatedFieldTranslationsForeignKey)TranslatableModelTranslatedFieldsTranslatedFieldsModel)switch_languagec                   4    e Zd Z ej                  dd      Zy)ManualModel    
max_lengthdefaultN__name__
__module____qualname__r   	CharFieldshared     K/home/dcms/DCMS/lib/python3.12/site-packages/parler/tests/testapp/models.pyr   r          Vb9Fr   r   c                   \    e Zd Z eedej                        Z ej                  d      Z	y)ManualModelTranslationstranslationsrelated_name	on_deleter   r   N)
r   r   r   r   r   r   CASCADEmasterr   tr_titler   r   r   r   r      s+    #.FNNF  v3/Hr   r   c                   p    e Zd Z ej                  dd      Z e ej                  dd            Zd Zy)	SimpleModelr   r   r   Translated Titler"   r%   c                     | j                   S Nr)   selfs    r   __str__zSimpleModel.__str__       }}r   N	r   r   r   r   r   r   r   r   r.   r   r   r   r'   r'      s7    Vb9F#-=V-=-=>P]`-abLr   r'   c                        e Zd Z fdZ xZS )CleanCharFieldc                 .    t         |   ||       |dz   S )N
_cleanchar)superclean)r-   valuemodel_instance	__class__s      r   r6   zCleanCharField.clean    s    e^,|##r   )r   r   r   r6   __classcell__)r9   s   @r   r2   r2      s    $ $r   r2   c                   :    e Zd Z edd      Z e       Zd Zd Zy)CleanFieldModelr   r   r   c                     | j                   S r+   r)   r,   s    r   r.   zCleanFieldModel.__str__)   r/   r   c                 .    | xj                   dz  c_         y )N_cleansharedr   r,   s    r   r6   zCleanFieldModel.clean,   s    ~%r   N)	r   r   r   r2   r   r   r%   r.   r6   r   r   r   r<   r<   %   s     sB7F H&r   r<   c                   h    e Zd Z eedddej                        Z edd      Z	 G d d	      Z
d
 Zy)CleanFieldModelTranslationr   T   )r    nullr   r!   r(   r   r"   c                       e Zd ZdZy)CleanFieldModelTranslation.Meta)language_coder$   N)r   r   r   unique_togetherr   r   r   MetarF   :   s    5r   rI   c                 .    | xj                   dz  c_         y )N_cleantransr)   r,   s    r   r6   z CleanFieldModelTranslation.clean=   s    &r   N)r   r   r   r   r<   r   r#   r$   r2   r%   rI   r6   r   r   r   rB   rB   0   s=    ##..F 0SAH6 6'r   rB   c                       e Zd Z ej                  dd      Z ej                         Z e ej                  dd            Z	d Z
y)	DateTimeModelr   r   r   r(   r"   r)   c                     | j                   S r+   r)   r,   s    r   r.   zDateTimeModel.__str__G   r/   r   N)r   r   r   r   r   r   DateTimeFielddatetimer   r   r.   r   r   r   rM   rM   A   sG    Vb9F#v##%H#-=V-=-=>P]`-abLr   rM   c                       e Zd Z ej                  dd      Z ed      Z e ej                  d            Z	d Z
y	)
AnyLanguageModelr   r   r   Tany_languager"   r)   c                     | j                   S r+   r)   r,   s    r   r.   zAnyLanguageModel.__str__Q   r/   r   N)r   r   r   r   r   r   r   r%   r   r   r.   r   r   r   rR   rR   K   s=    Vb9FD1H#-=V-=-=-MNLr   rR   c                   p    e Zd Z ej                  dd      Z e ej                  dd            Zd Zy)NotRequiredModelr   r   r   DEFAULT_TRANS_TITLEr)   c                     | j                   S r+   r)   r,   s    r   r.   zNotRequiredModel.__str__\   r/   r   Nr0   r   r   r   rW   rW   U   s8    Vb9F#!!!S:OPLr   rW   c                   H    e Zd Z ej                  dd      Z e       Zd Zy)
EmptyModelr   r   r   c                     | j                   S r+   r@   r,   s    r   r.   zEmptyModel.__str__g   s    {{r   Nr0   r   r   r   r[   r[   `   s%    Vb9F $%Lr   r[   c                   H    e Zd Z e ej
                               Zd Zd Zy)ArticleSlugModelslugc                     | j                   S r+   r_   r,   s    r   r.   zArticleSlugModel.__str__n   s    yyr   c                 v    t        |       5  t        dd| j                  i      cd d d        S # 1 sw Y   y xY w)Nzarticle-slug-test-viewr`   )kwargs)r
   r   r`   r,   s    r   get_absolute_urlz!ArticleSlugModel.get_absolute_urlq   s7    T" 	Q3VTYY<OP	Q 	Q 	Qs   /8N)	r   r   r   r   r   	SlugFieldr   r.   rd   r   r   r   r^   r^   k   s#    #)9)9)9);<LQr   r^   c                   2    e Zd Z ed      Z G d d      Zy)AbstractModelTrS   c                       e Zd ZdZy)AbstractModel.MetaTN)r   r   r   abstractr   r   r   rI   ri   z   s    r   rI   N)r   r   r   r   r%   rI   r   r   r   rg   rg   v   s    D1H r   rg   c                   B    e Zd Z e ej
                  dd            Zy)ConcreteModelr(   r   r"   r)   Nr   r   r   r   r   r   r   r   r   r   rl   rl   ~   s    #-=V-=-=>P]`-abLr   rl   c                   D    e Zd Z e ej
                         ddgi      Zy)UniqueTogetherModelrH   )r`   rG   )r`   metaN)r   r   r   r   r   re   r   r   r   r   ro   ro      s,    #V 

Lr   ro   c                   @    e Zd Z e ej
                  d            Zy)Level1r   r"   )l1_titleN)r   r   r   r   r   r   l1_translationsr   r   r   rr   rr          &0@0@0@C0PQOr   rr   c                   @    e Zd Z e ej
                  d            Zy)Level2r   r"   )l2_titleN)r   r   r   r   r   r   l2_translationsr   r   r   rw   rw      ru   r   rw   c                   @    e Zd Z e ej
                  d            Zy)	ProxyBaser   r"   )
base_titleN)r   r   r   r   r   r   base_translationsr   r   r   r{   r{      s    (4DF4D4DPS4TUr   r{   c                   T    e Zd Z e ej
                  d            Z G d d      Zy)
ProxyModelr   r"   )proxy_titlec                       e Zd ZdZy)ProxyModel.MetaTN)r   r   r   proxyr   r   r   rI   r      s    r   rI   N)r   r   r   r   r   r   proxy_translationsrI   r   r   r   r   r      s&    )6Ff6F6FRU6VW r   r   c                   4    e Zd Z ej                  dd      Zy)DoubleModelr   r   r   Nr   r   r   r   r   r      r   r   r   c                   \    e Zd Z eedej                        Z ej                  d      Z	y)DoubleModelTranslationsr}   r   r   r"   N)
r   r   r   r   r   r   r#   r$   r   rs   r   r   r   r   r      ,    #"5F  v3/Hr   r   c                   \    e Zd Z eedej                        Z ej                  d      Z	y)DoubleModelMoreTranslationsmore_translationsr   r   r"   N)
r   r   r   r   r   r   r#   r$   r   rx   r   r   r   r   r      r   r   r   c                   4    e Zd Z ej                  dd      Zy)RegularModeluntranslated   )r   r   N)r   r   r   r   r   original_fieldr   r   r   r   r      s    %V%%nMNr   r   c                   4    e Zd Z ej                  dd      Zy)	CharModel-   T)r   primary_keyN)r   r   r   r   r   idr   r   r   r   r      s    			RT	:Br   r   c                   Z    e Zd Z eeej                        Z ej                  d      Z	y)CharModelTranslationr!   r   r"   N)
r   r   r   r   r   r   r#   r$   r   r%   r   r   r   r   r      s$    #IHFv3/Hr   r   c                   |    e Zd Z e ej
                  dej                              Z ej                  d      Z	y)ForeignKeyTranslationModelr   r   )translated_foreignr   r"   N)
r   r   r   r   r   
ForeignKeyr#   r   r   r   r   r   r   r   r      s6    #,6,,^v~~VL V-Fr   r   c                   d    e Zd Z e ej
                  d            Z ej                  d      Zy)$ManyToManyOnlyFieldsTranslationModelr   )translated_many_to_manyr   r"   N)	r   r   r   r   r   ManyToManyFieldr   r   r   r   r   r   r   r      s0    # 6 6 6~ FL V-Fr   r   c                       e Zd Z e ej
                  dd       ej                  d            Z ej
                  d      Zy)(ManyToManyAndOtherFieldsTranslationModelr(   r   r"   r   )r%   r   N)	r   r   r   r   r   r   r   r   r   r   r   r   r   r      sC    #!!!"4E 6 6 6~ FL V-Fr   r   c                   @    e Zd Z ej                  d      Z e       Zy)TranslationRelatedr   r"   N)r   r   r   r   r   r   r   translation_relationsr   r   r   r   r      s    V-F+-r   r   c                       e Zd Z eedej                        Z ej                  d      Z	 ej                  e      Zy)TranslationRelatedTranslationr   r   r   r"   N)r   r   r   r   r   r   r#   r$   r   titler   r   m2m_regularr   r   r   r   r      s=    #6>>F F,E(&((6Kr   r   c                   p    e Zd Z ej                  edej                        Z ej                  d      Z	y)TranslationRelatedRelationr   r   r   r"   N)
r   r   r   r   r   r   r#   translationr   namer   r   r   r   r      s5    #&##%,..K
 6s+Dr   r   c                   B    e Zd Z e ej
                  dd            Zy)IntegerPrimaryKeyModelr(   r   r"   r)   Nrm   r   r   r   r   r      s    #-=V-=-=>P]`-abLr   r   c                   J    e Zd Z ej                  dej
                  d      Zy)IntegerPrimaryKeyRelatedModelr   childrenr!   r    Nr   r   r   r   r   r#   parentr   r   r   r   r      s    V FNNFr   r   c                       e Zd Z ej                  dej                  d      Z e ej                  dd            Z
y)	UUIDPrimaryKeyModelTF)r   r   editabler(   r   r"   r)   N)r   r   r   r   	UUIDFielduuiduuid4r   r   r   r   r   r   r   r   r      s8    			dDJJ	OB#-=V-=-=>P]`-abLr   r   c                   J    e Zd Z ej                  dej
                  d      Zy)UUIDPrimaryKeyRelatedModelr   r   r   Nr   r   r   r   r   r      s    VjFr   r   )2r   	django.dbr   django.urlsr   parler.fieldsr   r   parler.modelsr   r   r	   parler.utils.contextr
   r   r   r'   r   r2   r<   rB   rM   rR   rW   r[   r^   rg   rl   ro   rr   rw   r{   r   r   r   r   Modelr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>r      s      A T T 0:# :03 0# $V%% $&' &'!6 '"% ( ( " Q( Q% cM c+ R RRV RV! V :# :03 00"7 0N6<< N
;! ;00 0
.!2 ..+< ../@ ..* .
7$9 7, ,c. c
FLL c+ c r   