o
    ;òÛio  ã                   @   s:   d dl mZ d dlmZ d dlmZ G dd„ dejƒZdS )é    )Úsettings)Úmodels)Útimezonec                   @   sÂ   e Zd Zejejejd�Zejdejdd�Z	ejdejdd�Z
e ¡ 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�Zejdd�Zejdd�Zdefdd„Zdd„ ZdS )ÚPaymentVerification)Ú	on_deletezbanking.AccountZpayment_verifications_as_payer)r   Úrelated_nameZ$payment_verifications_as_beneficiaryTÚ )ÚblankÚdefaulté
   )Ú
max_lengthr	   r
   é   )r   )Úauto_now_addF)r
   Úreturnc                 C   s   t  ¡ | jt jdd� kS )Nr   )Úminutes)r   ÚnowÚ
created_atÚ	timedelta©Úself© r   ú\C:\Users\Uzivatel\Documents\attachments\prilohy\bp_ib\banking\models\payment_verification.pyÚ
is_expired"   s   zPaymentVerification.is_expiredc                 C   s   d| j › d| j› d| j› d�S )NzPaymentVerification(user=z	, amount=z, used=ú))Úuser_idÚamountÚis_usedr   r   r   r   Ú__str__&   s   zPaymentVerification.__str__N)Ú__name__Ú
__module__Ú__qualname__r   Ú
ForeignKeyr   ÚAUTH_USER_MODELÚCASCADEÚuserZpayer_accountZbeneficiary_accountÚ
FloatFieldr   Ú	TextFieldZinformationÚ	CharFieldZvariable_symbolZspecific_symbolZconstant_symbolÚcodeÚDateTimeFieldr   ÚBooleanFieldr   Úboolr   r   r   r   r   r   r      s,    ýýr   N)Údjango.confr   Ú	django.dbr   Údjango.utilsr   ÚModelr   r   r   r   r   Ú<module>   s   