
    soj                     v    d dl T d dlmZ d dlmZ d dlmZ  G d de          Ze                                 dS )    )*)	BaseModel)User)PredictionStatusc                      e Zd ZU dZ edd          Z eej                  Z	 ed          Z
 ed	          Z ed	          Z ed	          Z ed          Z ed	          Z ed          Z ed          Z ed	          Z eedd
dd          Z ed          Zg Zee         ed<   dZeed<   dZ  G d d          Z!defdZ"defdZ#defdZ$defdZ%defdZ&dS )
Predictionz
    Prediction class
       F)
max_lengthnull)defaulti  )r
   T)r   predictionsCASCADE)r   backref	on_delete	on_updateoptionsshould_saveNc                       e Zd ZdZdS )Prediction.Meta
predictionN)__name__
__module____qualname__db_table     /app/src/model/Prediction.pyMetar   #   s        r   r   returnc                 B    t          | j                  t           j        u S )z%If the prediction is open for betting)r   statusSENTselfs    r   is_openzPrediction.is_open&   s    ,,0@0EEEr   c                 B    t          | j                  t           j        u S )z'If the prediction is closed for betting)r   r!   BETS_CLOSEDr#   s    r   	is_closedzPrediction.is_closed*   s    ,,0@0LLLr   c                 B    t          | j                  t           j        u S )z"If the prediction has a result set)r   r!   
RESULT_SETr#   s    r   is_result_setzPrediction.is_result_set.   s    ,,0@0KKKr   c                 Z    t          | j                  t           j        t           j        fv S )zIf the prediction is editable)r   r!   NEWr"   r#   s    r   is_new_or_sentzPrediction.is_new_or_sent2   s$    ,,1A1EGWG\0]]]r   c                 *    t          | j                  S )zGet the prediction status)r   r!   r#   s    r   
get_statuszPrediction.get_status6   s    ,,,r   )'r   r   r   __doc__	CharFieldtypeSmallIntegerFieldr   r-   r!   questionDateTimeField	send_dateend_datecut_off_dateBooleanFieldrefund_wagerBigIntegerFieldmax_refund_wagerallow_multiple_choicescan_withdraw_betresult_set_dateForeignKeyFieldr   creator	is_publicr   liststr__annotations__r   boolprediction_optionsr   r%   r(   r+   r.   r0   r   r   r   r   r      s          9///D'7';<<<FyC(((H4(((I}$'''H =d+++L<...L&D111)\$777#|D111#m...Oo4)y  G U+++IGT#YK                F F F F FM4 M M M MLt L L L L^ ^ ^ ^ ^-, - - - - - -r   r   N)	peeweesrc.model.BaseModelr   src.model.Userr    src.model.enums.PredictionStatusr   r   create_tabler   r   r   <module>rN      s        ) ) ) ) ) )       = = = = = =0- 0- 0- 0- 0- 0- 0- 0-f        r   