o
    @h                     @   sl   d dl mZ ddlmZmZmZ G dd dejZG dd dejZG dd	 d	ej	Z
G d
d dej	ZdS )    )forms   )RegistrationPaymentProofEventc                   @   s,   e Zd ZejdddejdddddZdS )	VerifyCodeForm   zRegistration Codeform-controlz$Enter your 5-digit registration codeclassplaceholderattrs)
max_length
min_lengthlabelwidgetN)__name__
__module____qualname__r   	CharField	TextInputregistration_code r   r   1/var/www/html/smartRegister/registration/forms.pyr      s    
r   c                   @   s4   e Zd ZejejjddddejddiddZ	d	S )
EventSelectionFormT)	is_activezSelect an eventr   r   zform-selectr   )querysetempty_labelr   r   N)
r   r   r   r   ModelChoiceFieldr   objectsfilterSelecteventr   r   r   r   r      s    
r   c                   @   s   e Zd ZG dd dZdS )RegistrationFormc                   @   sN   e Zd ZeZg dZejddddejddddejdddddZ	dS )	zRegistrationForm.Meta)	full_nameemailorganisationr	   zEnter your full namer
   r   zEnter your email addressz'Enter your organisation or company nameN)
r   r   r   r   modelfieldsr   r   
EmailInputwidgetsr   r   r   r   Meta   s     
r,   N)r   r   r   r,   r   r   r   r   r$      s    r$   c                   @   s"   e Zd ZG dd dZdd ZdS )PaymentProofFormc                   @   s,   e Zd ZeZdgZdejddddiZdS )zPaymentProofForm.Metafiler	   zimage/*,.pdf)r   acceptr   N)	r   r   r   r   r(   r)   r   	FileInputr+   r   r   r   r   r,   /   s    r,   c                 C   sD   | j d}|r |jdkrtdg d}|j|vr td|S )Nr.   i  P zFile size cannot exceed 5MB.)z
image/jpegz	image/pngz	image/gifzapplication/pdfz.Only JPEG, PNG, GIF, or PDF files are allowed.)cleaned_datagetsizer   ValidationErrorcontent_type)selfr.   allowed_typesr   r   r   
clean_file9   s   



zPaymentProofForm.clean_fileN)r   r   r   r,   r8   r   r   r   r   r-   .   s    
r-   N)djangor   modelsr   r   r   Formr   r   	ModelFormr$   r-   r   r   r   r   <module>   s    	