o
    hdgm	                     @   s.   d dl mZ ddlmZ G dd dejZdS )    )forms   )Donationc                       s*   e Zd ZG dd dZ fddZ  ZS )DonationFormc                
   @   s   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ej
dd
dddddejddddejdddddejddiddZddddZdddZdS )zDonationForm.Meta)	full_nameemailamountcustom_amountproof_of_paymentmessageis_anonymouszform-controlzEnter your full name)classplaceholder)attrszEnter your emailzform-selectamountSelect)r   idzEnter custom amountcustomAmount0z0.01)r   r   r   minstepzimage/*,.pdf)r   accept4zLeave a message (optional))r   rowsr   r   zform-check-inputzMake this donation anonymouszProof of Payment (Image or PDF)z!Custom Amount (if Other selected))r   r
   r	   zMaximum file size: 5MBz$Enter amount in Zambian Kwacha (ZMW))r
   r	   N)__name__
__module____qualname__r   modelfieldsr   	TextInput
EmailInputSelectNumberInput	FileInputTextareaCheckboxInputwidgetslabels
help_texts r(   r(   !/var/www/html/gwz/donate/forms.pyMeta   sT    "
r*   c                    s`   t   }|d}|d}|dkr|stdd| jv r.| jd }|jdkr.td|S )Nr   r	   otherz!Please specify the custom amount.r
   i  P zFile size must be less than 5MB)supercleangetr   ValidationErrorfilessize)selfcleaned_datar   r	   file	__class__r(   r)   r-   3   s   







zDonationForm.clean)r   r   r   r*   r-   __classcell__r(   r(   r5   r)   r      s    .r   N)djangor   modelsr   	ModelFormr   r(   r(   r(   r)   <module>   s    