3
]                 @   s>   d dl mZ d dlmZ dd ZG dd dejZdd Zd	S )
    )models)Personc              C   s@   dd l } | j j }dd l}|jtt|ddj }|dd S )Nr   zutf-8)encoding      i)datetimenowbase64	b64encodebytesstrdecode)r   r	   r
   the_id r   /var/www/djphys/igor/models.py	Make_Hash   s
    
r   c               @   sP   e Zd ZejeZejddZej	de
dZejddddZdd Zd	d
 ZdS )DownloadT)auto_now
   )
max_lengthdefaultF)r   nullblankc             C   s   dj | j| jS )Nz{0}, {1})formatsentperson)selfr   r   r   __str__   s    zDownload.__str__c             C   st   | j j}ddlm} d}|| j7 }|d7 }|d7 }|d7 }|d7 }|d7 }y|d	|d
|gdd W n   Y nX d S )Nr   )	send_mailzOEnter the following key on the download form and click the appropriate button

z=

After you have downloaded and unpacked Igor Pro, launch it zBand enter the following code to unlock the newly installed copy:

zSerial Number: 74767
z@Activation Key for version 8: LAPG-KDSZ-GZLS-DDKN-MUKJ-YAAX-MNU
u   


Don't use the following unless you installed the older version
   [Activation Key for older version 7: EAWY-WRZM-SRMF-HHTC-CLXS-HAHX-J]
zIgor Pro Download Codezsaeta@g.hmc.eduF)fail_silently)r   emaildjango.core.mailr   key)r   addressr   bodyr   r   r   send   s    
zDownload.sendN)__name__
__module____qualname__r   
ForeignKeyr   r   DateTimeFieldr   	CharFieldr   r#   Z	retrievedr   r&   r   r   r   r   r      s   
r   c               C   s   t djt  d S )NzTesting Make_Hash(): {0})printr   r   r   r   r   r   test*   s    r.   N)	django.dbr   people.modelsr   r   Modelr   r.   r   r   r   r   <module>   s   