ó
£dYc           @   sÖ   d  d l  m Z d  d l m Z m Z d  d l m Z d  d l m Z e d e j	 ƒ Z
 d  d l m Z m Z d e j f d „  ƒ  YZ d	 e j f d
 „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   models(   t   loadert   Context(   t   settings(   t   FileSystemStoraget   location(   t   MaxValueValidatort   MinValueValidatort   TheoryExamFormc        	   B   sÏ   e  Z d d f Z e j d e ƒ Z e j d d ƒ Z e j	 d d ƒ Z
 e j ƒ  Z e j d d d	 e d
 e d d ƒ Z e j d e d d d d ƒ Z d „  Z d d d „  ƒ  YZ d „  Z d „  Z d „  Z RS(   u   applicationu   Exam Applicationu   resitu
   Resit Examt   defaultt
   max_lengthiÈ   iÊ   i    t   blankt   nullt	   help_textsG   Amount Registration costs (&pound;), leave blank for free registration.t   choicess   exam-applicationi   c         C   s   |  j  S(   N(   t   name(   t   self(    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyt   __unicode__   s    t   Metac           B   s   e  Z d  g Z RS(   R   (   t   __name__t
   __module__t   ordering(    (    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyR      s   c         C   s   t  j j d |  ƒ } | S(   Nt   exam(   t   TheoryExamApplicationt   objectst   filter(   R   t
   applicants(    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyt   get_applicants   s    c         C   s   t  j j d |  ƒ } | S(   Nt	   exam_form(   t
   ExamChoiceR   R   (   R   R   (    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyt   get_choices"   s    c         C   s   t  j j d |  ƒ } | S(   NR   (   t   ExamLocationR   R   (   R   t	   locations(    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyt   get_locations&   s    (   u   applicationu   Exam Application(   u   resitu
   Resit Exam(    (   R   R   t   TYPE_CHOICESR    t   BooleanFieldt   Falset   enabledt	   CharFieldR   t	   SlugFieldt   slugt	   TextFieldt   introductiont
   FloatFieldt   Truet   payment_amountt   typeR   R   R   R   R!   (    (    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyR   
   s   	$			R   c        	   B   s™   e  Z d d f Z e j d ƒ Z e j d d ƒ Z e j d d d e ƒ Z e j	 ƒ  Z
 e j d	 d
 d e d e d d ƒ Z d „  Z d d d „  ƒ  YZ RS(   u   physicsu   Physicsu   techu   TechR   R
   iÈ   i   R   R	   i    R   R   R   sG   Amount Registration costs (&pound;), leave blank for free registration.c         C   s   |  j  S(   N(   R   (   R   (    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyR   7   s    R   c           B   s   e  Z d  g Z RS(   t   order(   R   R   R   (    (    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyR   :   s   (   u   physicsu   Physics(   u   techu   Tech(    (   R   R   R"   R    t
   ForeignKeyR   R&   R   R.   t   IntegerFieldR/   R+   R,   R-   R   R   (    (    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyR   *   s   	$	R   c           B   sQ   e  Z e j d  ƒ Z e j d d ƒ Z e j ƒ  Z d „  Z	 d d d „  ƒ  YZ
 RS(   R   R
   iÈ   c         C   s   |  j  S(   N(   R   (   R   (    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyR   C   s    R   c           B   s   e  Z d  g Z RS(   R/   (   R   R   R   (    (    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyR   F   s   (    (   R   R   R    R0   R   R&   R   R1   R/   R   R   (    (    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyR   =   s
   	R   c        
   B   se  e  Z d0 d1 d2 d3 d4 d5 f Z d6 d7 d8 d9 f Z e j d ƒ Z e j d ƒ Z e j d e	 ƒ Z
 e j d e	 d e	 ƒ Z e j d e ƒ Z e j d d d e	 d e	 d e ƒ Z e j d e ƒ Z e j d e	 d e	 ƒ Z e j d d d e	 d e	 d e ƒ Z e j d d d e	 d e	 ƒ Z e j d d d e	 d e	 ƒ Z e j d d d e	 d e	 ƒ Z e j d d d e	 d e	 d d ƒ Z e j d d d e	 d e	 d d ƒ Z e j d d d e	 d e	 d d ƒ Z e j d d d e	 d e	 d d ƒ Z e j d d d e	 d e	 d d ƒ Z e j d d d e	 d e	 d d ƒ Z e j d d d e	 d e	 d d ƒ Z e j d d d e	 d e	 d d  ƒ Z  e j d d d e	 d e	 d d! ƒ Z! e j d d d e	 d e	 d d" ƒ Z" e j d# d e	 d e	 d$ d% d d& ƒZ# e j d d d e	 d e	 d d ƒ Z$ e j d d d e	 d e	 d d ƒ Z% e j d d d e	 d e	 d d  ƒ Z& e j d d d e	 d e	 d d! ƒ Z' e j d d d e	 d e	 d d" ƒ Z( e j d# d e	 d e	 d$ d' d d& ƒZ) e j* d( d e	 ƒZ+ e j d d d e	 d e	 ƒ Z, e j d) d e	 d e	 d* e j- ƒZ. e j d d d e	 d e	 ƒ Z/ d+ „  Z0 d, d: d- „  ƒ  YZ1 d. „  Z2 d/ „  Z3 RS(;   u   Mru   Mrsu   Missu   Msu   Doctoru	   Professoru   bacsu   BACSu   standing_orderu   Standing Orderu   chequeu   Chequeu   credit_cardu   Credit CardR   s   members.Membert   auto_now_addR   R   R	   R
   i   R   iÈ   t   verbose_names    Daytime Contact Telephone Numbers   Date of Births   Current Job Titles   Current Employer/Hospitals&   Start Date of UK or Ireland Employments	   Address 1s	   Address 2t   Townt   Countyt   Postcodes   members.Countryt   related_namet   th_work_countryt   Countryt   th_mailing_countryR   R   t	   on_deletec         C   s   d |  j  |  j f S(   Ns   %s - %s(   R   t   member(   R   (    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyR   ƒ   s    R   c           B   s   e  Z d  g Z RS(   s   -start_time(   R   R   R   (    (    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyR   †   s   c         C   s   |  j  j } g  } x. t d d ƒ D] } | j | ƒ | d } q" Wt j d ƒ } t i |  d 6| d 6ƒ } | j | ƒ } | S(   Ni    i   i   s$   theory-exam-application-details.htmlt   applicationt   years(   R   t
   start_yeart   ranget   appendR   t   get_templateR   t   render(   R   t   yearR>   t   it   tt   ct   rendered(    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyt   display‰   s    c         C   s1   d } x$ |  j  j ƒ  D] } | | j 7} q W| S(   Ni    (   t   exam_choicest   allR-   (   R   t   amountt   exam_choice(    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyt   get_payment_amount•   s    (   u   Mru   Mr(   u   Mrsu   Mrs(   u   Missu   Miss(   u   Msu   Ms(   u   Doctoru   Doctor(   u	   Professoru	   Professor(   u   bacsu   BACS(   u   standing_orderu   Standing Order(   u   chequeu   Cheque(   u   credit_cardu   Credit Card(    (4   R   R   t   TITLE_CHOICESt   PAYMENT_TYPE_CHOICESR    R0   R   R<   t   DateTimeFieldR,   t
   start_timet   completed_timeR#   R$   t   paidR&   t   payment_typet   completeR1   t   membership_numbert   titlet
   first_namet   surnamet
   EmailFieldt   email_addresst   contact_numbert   dobt	   job_titlet   current_employert   employment_start_datet   work_address_1t   work_address_2t	   work_townt   work_countyt   work_postcodet   work_countryt   mailing_address_1t   mailing_address_2t   mailing_townt   mailing_countyt   mailing_postcodet   mailing_countryt   ManyToManyFieldRJ   t   exam_choice_namet   SET_NULLR   t   location_nameR   R   RI   RN   (    (    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyR   I   s^   		$$$$$$$$$$$$'$$$$$'$		N(   t	   django.dbR    t   django.templateR   R   t   django.confR   t   django.core.files.storageR   t   PRIVATE_FILESt   fst   django.core.validatorsR   R   t   ModelR   R   R   R   (    (    (    s8   /var/www/svtgbi.org/svtgbi/modules/theory_exam/models.pyt   <module>   s    