ó
$ï\c           @   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 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   ExamFormc        	   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 ƒ  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   exam-applicationu   Exam Applicationu   re-validationu   Re-Validationt   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(    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyt   __unicode__   s    t   Metac           B   s   e  Z d  g Z RS(   R   (   t   __name__t
   __module__t   ordering(    (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR      s   c         C   s   t  j j d |  ƒ } | S(   Nt	   exam_form(   t   ModalityCategoryt   objectst   filter(   R   t
   categories(    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyt   get_modality_categories   s    c         C   s   t  j j d |  ƒ } | S(   Nt   exam(   t   ExamApplicationR   R   (   R   t
   applicants(    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyt   get_applicants#   s    c         C   sD   |  j  } g  } x. t d d ƒ D] } | j | ƒ | d } q W| S(   Ni    i   i   (   t
   start_yeart   ranget   append(   R   t   yeart   yearst   i(    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyt	   get_years'   s    	(   u   exam-applicationu   Exam Application(   u   re-validationu   Re-Validation(    (   R   R   t   TYPE_CHOICESR    t   BooleanFieldt   Falset   enabledt	   CharFieldR   t	   SlugFieldt   slugt	   TextFieldt   introductiont   IntegerFieldR    t
   FloatFieldt   Truet   payment_amountt   typeR   R   R   R   R&   (    (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR   
   s   	$			R   c           B   sœ   e  Z e j d  ƒ Z e j d d ƒ Z e j d d ƒ Z e j ƒ  Z	 e j ƒ  Z
 e j d e ƒ Z d „  Z d d
 d „  ƒ  YZ d „  Z d „  Z d	 „  Z RS(   R   R
   iÈ   R	   c         C   s   |  j  S(   N(   t   title(   R   (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR   9   s    R   c           B   s   e  Z d  g Z RS(   t   order(   R   R   R   (    (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR   <   s   c         C   s   t  j j d |  ƒ } | S(   Nt   category(   t   ModalityItemR   R   (   R   t   items(    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyt	   get_items?   s    c         C   s   t  j j d |  d d ƒ } | S(   NR7   R4   t
   compulsory(   R8   R   R   (   R   R9   (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyt   get_compulsory_itemsC   s    c         C   s   t  j j d |  d d ƒ } | S(   NR7   R4   t   optional(   R8   R   R   (   R   R9   (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyt   get_optional_itemsG   s    (    (   R   R   R    t
   ForeignKeyR   R+   R5   t   subtitleR0   R6   t   minimum_scansR(   R)   t   upload_disabledR   R   R:   R<   R>   (    (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR   0   s   			R8   c           B   s¥   e  Z d d f Z e j d d ƒ Z e j d ƒ Z e j d d d e ƒ Z e j	 ƒ  Z
 e j	 d e d	 e ƒ Z e j	 d e d	 e ƒ Z d
 „  Z d d d „  ƒ  YZ RS(   u
   compulsoryu   Compulsory Elementu   optionalu   Optional ElementR
   iÈ   R   R   R   R   c         C   s   |  j  S(   N(   R   (   R   (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR   Y   s    R   c           B   s   e  Z d  g Z RS(   R6   (   R   R   R   (    (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR   \   s   (   u
   compulsoryu   Compulsory Element(   u   optionalu   Optional Element(    (   R   R   R'   R    R+   R   R?   R7   R4   R0   R6   R2   t   minimumt   maximumR   R   (    (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR8   K   s   		R   c           B   sê	  e  Z dd de df dg dh di f Z dj dk dl dm dn do dp dq dr ds f
 Z dt du dv dw 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' d 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) 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, d0 ƒ Z e j d) d+ d% e
 d& e
 d, d1 ƒ Z e j d) d+ d% e
 d& e
 d, d2 ƒ Z e j d) d+ d% e
 d& e
 d, d3 ƒ Z  e j d) d+ d% e
 d& e
 d, d4 ƒ Z! e j d) d+ d% e
 d& e
 d, d5 ƒ Z" e j d) d+ d% e
 d& e
 d, d6 ƒ Z# e j d7 d% e
 d& e
 d8 d9 d, d: ƒZ$ e j% d% e
 d& e
 d, d; ƒ Z& e j d) d+ d% e
 d& e
 d, d2 ƒ Z' e j d) d+ d% e
 d& e
 d, d3 ƒ Z( e j d) d+ d% e
 d& e
 d, d4 ƒ Z) e j d) d+ d% e
 d& e
 d, d5 ƒ Z* e j d) d+ d% e
 d& e
 d, d6 ƒ Z+ e j d7 d% e
 d& e
 d8 d< d, d: ƒZ, e j d% e
 d& e
 d, d= ƒ Z- e j d% e
 d& e
 d, d> ƒ Z. e j d% e
 d& e
 d, d? ƒ Z/ e j d) d+ d% e
 d& e
 d, d@ ƒ Z0 e j d) d+ d% e
 d& e
 d, dA ƒ Z1 e j d) d+ d% e
 d& e
 d, dB ƒ Z2 e j d% e
 d& e
 d, dC ƒ Z3 e j4 dD e5 dE dF d% e
 d& e
 ƒ Z6 e j d) d+ d% e
 d& e
 d, d@ ƒ Z7 e j d) d+ d% e
 d& e
 d, dA ƒ Z8 e j d% e
 d& e
 d, dC ƒ Z9 e j d' e d, dG ƒ Z: e j4 dD e5 dE dF d% e
 d& e
 ƒ Z; e j d% e
 d& e
 ƒ Z< e j d% e
 d& e
 ƒ Z= e j d% e
 d& e
 ƒ Z> e j d% e
 d& e
 ƒ Z? e j d% e
 d& e
 ƒ Z@ e j d% e
 d& e
 ƒ ZA e j d% e
 d& e
 ƒ ZB e j d% e
 d& e
 ƒ ZC e j d% e
 d& e
 ƒ ZD e j d% e
 d& e
 ƒ ZE e j d% e
 d& e
 ƒ ZF e j d% e
 d& e
 ƒ ZG e j d% e
 d& e
 ƒ ZH e j d% e
 d& e
 ƒ ZI e j d% e
 d& e
 ƒ ZJ e j d% e
 d& e
 ƒ ZK e j d% e
 d& e
 ƒ ZL e j d% e
 d& e
 ƒ ZM e j4 dD e5 dE dF d% e
 d& e
 d, dH ƒ ZN e j d' e d, dI ƒ ZO e j d) d+ d% e
 d& e
 d, dJ d( e ƒ ZP e j d) d+ d% e
 d& e
 d, dK ƒ ZQ e j d) d+ d% e
 d& e
 d, dL ƒ ZR e j d) d+ d% e
 d& e
 d, dM ƒ ZS e j% d% e
 d& e
 d, dN ƒ ZT e j4 dD e5 dE dF d% e
 d& e
 ƒ ZU e j d' e d, dO ƒ ZV e j d' e d, dP ƒ ZW e j d' e d, dQ ƒ ZX e j d' e d, dR ƒ ZY e j d' e d, dS ƒ ZZ e j d' e d, dT ƒ Z[ e j d' e d, dU ƒ Z\ e j d' e d, dV ƒ Z] e j d' e d, dW ƒ Z^ e j d' e d, dX ƒ Z_ e j d' e d, dY ƒ Z` e j d' e d, dZ ƒ Za d[ „  Zb d\ dx d] „  ƒ  YZc d^ „  Zd d_ „  Ze d` „  Zf da „  Zg db „  Zh dc „  Zi RS(y   u   Mru   Mrsu   Missu   Msu   Doctoru	   Professori    u   Not Startedi   u   Applicant Detailsi   u   Academic Detailsi   u   Theory Exams / CPDi   u$   Core Modalities and Required Numbersi   u   Number of Years Experiencei   u   Nominated Internal Examineri   u
   Referencesi   u   Declarationi	   u   Paymentu   bacsu   BACSu   standing_orderu   Standing Orderu   chequeu   Chequeu   credit_cardu   Credit CardR   s   members.Membert   auto_now_addR   R   R	   R   R
   i   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   work_countryt   Countrysc   Please detail all locations and dates of any other sites where you have worked during your trainingt   mailing_countrys    Core Modality 1 - Carotid duplexs,   Core Modality 2 - Peripheral Arterial duplexs*   Core Modality 3 - Peripheral Venous duplexs   Name of Universitys   Title of Degrees   Class of Degrees   Year Degree Awardedt   storaget	   upload_tot   exam_applicationss-   Please tick if you are a Non-Degree Applicants    Exam result letters/certificatess7   I confirm that I have the required 3 years' experience.t   Titles
   First Namet   Surnamet   EmailsM   If you are unable to nominate a suitable internal examiner please explain whys"   I am an ordinary member of the SVTsZ   I am currently employed in the UK or Ireland to perform vascular diagnostic investigationssn   I have been employed in the UK or Ireland to perform vascular diagnostic investigations for at least 6 months.sí   I have carried out at least 25 scans from each of core modalities 1-3 in the 3 months prior to applying to sit the practical exam and have ensured that local protocols and all of these anonymised reports are attached to this application.s+   A copy of my degree certificate is includeds4   I have passed both theory exams in the last 5 years.s/   Copies of my exam results letters are included.sÐ   I have performed at least 600 scans in each of the 3 core duplex modalities (including a minimum number of compulsory elements) and 200 ABPIs and will ensure supporting evidence is available to the examiners.s‚   I have at least 3 years full-time diagnostic vascular scanning experience (or part-time equivalent) in each of the core modalitiess1   I have nominated a suitable AVS internal assessors2   I have provided the names of at least two refereess^   I understand if I fail the exam I will not be able to apply to retake it for at least 6months.c         C   s   d |  j  |  j f S(   Ns   %s - %s(   R   t   member(   R   (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR   è   s    R   c           B   s   e  Z d  g Z RS(   s   -start_time(   R   R   R   (    (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR   ë   s   c         C   s3   y t  j j d |  d | ƒ } Wn t } n X| S(   Nt   exam_applicationt   modality_item(   t   ExamApplicationModalityItemR   t   getR)   (   R   RV   t   item(    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyt   get_app_itemî   s
    
c         C   s3   y t  j j d |  d | ƒ } Wn t } n X| S(   NRU   t   modality_category(   t   ExamApplicationModalityCategoryR   RX   R)   (   R   R[   R7   (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyt   get_app_categoryõ   s
    
c         C   s   t  j j d |  ƒ } | S(   NRU   (   RW   R   R   (   R   R9   (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyt   get_modality_itemsü   s    c         C   s   t  j j d |  ƒ } | S(   NRU   (   R\   R   R   (   R   R   (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR      s    c         C   s   t  j j d |  ƒ } | S(   NRU   (   t   ExamApplicationReferenceR   R   (   R   t
   references(    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyt   get_references  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   exam-application-details.htmlt   applicationR$   (   R   R    R!   R"   R   t   get_templateR   t   render(   R   R#   R$   R%   t   tt   ct   rendered(    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyt   display  s    (   u   Mru   Mr(   u   Mrsu   Mrs(   u   Missu   Miss(   u   Msu   Ms(   u   Doctoru   Doctor(   u	   Professoru	   Professor(   i    u   Not Started(   i   u   Applicant Details(   i   u   Academic Details(   i   u   Theory Exams / CPD(   i   u$   Core Modalities and Required Numbers(   i   u   Number of Years Experience(   i   u   Nominated Internal Examiner(   i   u
   References(   i   u   Declaration(   i	   u   Payment(   u   bacsu   BACS(   u   standing_orderu   Standing Order(   u   chequeu   Cheque(   u   credit_cardu   Credit Card(    (j   R   R   t   TITLE_CHOICESt   STATUS_CHOICESt   PAYMENT_TYPE_CHOICESR    R?   R   RT   t   DateTimeFieldR2   t
   start_timet   completed_timeR0   t   statusR(   R)   t   paidR+   t   payment_typet   completeR5   t
   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_postcodeRK   R.   t   other_sites_workedt   mailing_address_1t   mailing_address_2t   mailing_townt   mailing_countyt   mailing_postcodeRM   t   modality_1_scanst   modality_2_scanst   modality_3_scanst   university_namet   degree_titlet   degree_classt   year_awardedt	   FileFieldt   fst   degree_certificatet   pg_university_namet   pg_degree_titlet   pg_year_awardedt   non_degree_applicantt   non_degree_evidencet   phi_y1t   phi_y2t   phi_y3t   phi_y4t   phi_y5t   phi_y6t   vt_y1t   vt_y2t   vt_y3t   vt_y4t   vt_y5t   vt_y6t   cpd_y1t   cpd_y2t   cpd_y3t   cpd_y4t   cpd_y5t   cpd_y6t   exam_results_lettert   three_years_experiencet   examiner_titlet   examiner_first_namet   examiner_surnamet   examiner_emailt   examiner_unable_reasont   reference_uploadt   ordinary_membert   currently_employedt   six_month_employedt   scans_completedt   copy_degree_certificatet   theory_exams_passedt   exam_results_letterst   duplex_scans_completedt   vascular_scanning_experiencet   suitable_avs_assessort   referees_providedt   understand_retakeR   R   RZ   R]   R^   R   Ra   Rh   (    (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR   `   sÚ   			$$$$$$$$$$$$'$$$$$'$$$$$$$**$$$$						R\   c        	   B   sƒ   e  Z e j d  ƒ Z e j d ƒ Z e j d e d e ƒ Z e j	 d e d e ƒ Z
 e j d e d d d e d e ƒ Z d „  Z RS(   R   R   R   R   RN   RO   RP   c         C   s   d |  j  |  j f S(   Ns   %s %s(   RU   R[   (   R   (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR     s    (   R   R   R    R?   RU   R[   R0   R2   t   total_scanst	   DateFieldt   training_beganRŽ   R   t
   scans_fileR   (    (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR\     s   $RW   c           B   sA   e  Z e j d  ƒ Z e j d ƒ Z e j d e ƒ Z d „  Z	 RS(   R   R8   R	   c         C   s   d |  j  |  j f S(   Ns   %s %s(   RU   RV   (   R   (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR   %  s    (
   R   R   R    R?   RU   RV   R(   R)   Rr   R   (    (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyRW     s   R_   c           B   s  e  Z e j d  ƒ Z e j d d ƒ Z e j ƒ  Z e j d d ƒ Z	 e j d d ƒ Z
 e j d d d e d e ƒ Z e j d d ƒ Z e j d d d e d e ƒ Z e j d d ƒ Z e j d ƒ Z e j d d ƒ Z e j d d ƒ Z e j d d ƒ Z d „  Z RS(   R   R
   iÈ   R   R   s   members.Countryi   c         C   s   d |  j  |  j f S(   Ns   %s %s(   RU   R   (   R   (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR   9  s    (   R   R   R    R?   RU   R+   R4   R0   R6   R   t	   address_1R2   t	   address_2t   townt   countyt   postcodet   countryRu   t   emailt	   telephonet   job_roleR   (    (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyR_   (  s   N(   t	   django.dbR    t   django.templateR   R   t   django.confR   t   django.core.files.storageR   t   PRIVATE_FILESR   t   django.core.validatorsR   R   t   ModelR   R   R8   R   R\   RW   R_   (    (    (    s=   /var/www/svtgbi.org/svtgbi/modules/exam_application/models.pyt   <module>   s   &´	