3
Ѧ^]                 @   s   d Z ddlZddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ G dd	 d	ejZG d
d deZG dd deZG dd deZG dd deZG dd deZG dd deZdS )z
App Models

    N)settings)models)ugettext)ListCharField)	HTMLFieldc               @   s:   e Zd ZdZejdddZejdddZG dd dZd	S )
TimeStampModelzTime stamp model zCreated DateT)auto_now_addzUpdated Date)auto_nowc               @   s   e Zd ZdZdS )zTimeStampModel.MetaTN)__name__
__module____qualname__abstract r   r   7/home/hotel/hotelbackend/hotelapplication/app/models.pyMeta   s   r   N)	r
   r   r   __doc__r   DateTimeFieldcreate_datemodify_dater   r   r   r   r   r      s   r   c               @   s   e Zd ZdZdZdZdZdZeedfeedfeedfeed	ffZ	e
jd
dZe
jd
dZee
jd
dddddZe
jddddZe Ze
jddZe
jd
dddZe
je	ddZe
jdddZdd ZG dd dZdS )EmailMessagez
    Email Model

                ZPendingzIn-ProgressZSentError   )
max_lengthTi  )blankr   null   )r   r   r   r   )default)choicesr    )r   r   c             C   s
   d| j  S )Nz%s)to_email)selfr   r   r   __str__:   s    zEmailMessage.__str__c               @   s   e Zd ZdZdZdZdZdS )zEmailMessage.Metaz Email Messages Class Meta r   ZEmailMessageszEmail MessagesN)r
   r   r   r   verbose_nameverbose_name_pluraldb_tabler   r   r   r   r   =   s   r   N)r
   r   r   r   PENDINGZ
INPROGRESSZSENTERROR_ZSTATUS_TYPEr   	CharField
from_email
EmailFieldr"   r   ccsubjectr   html_messagePositiveSmallIntegerFieldZtriesZerror_detailSmallIntegerFieldZsent_statusr   Z	sent_dater$   r   r   r   r   r   r      s,   



r   c               @   sZ   e Zd ZdZejddZejddZejddddZ	ej
d	dZd
d ZG dd dZdS )
AppVersionz 
    models for AppVersion

    
   )r   r   )r       T)r   r   r   Fc             C   s
   d| j  S )Nz%s)app_version)r#   r   r   r   r$   P   s    zAppVersion.__str__c               @   s   e Zd ZdZdZdZdZdS )zAppVersion.Metaz User Class Meta r3   zApp VersionN)r
   r   r   r   r%   r&   r'   r   r   r   r   r   S   s   r   N)r
   r   r   r   r   r+   r6   IntegerFieldZapp_version_codecommentBooleanField	is_activer$   r   r   r   r   r   r3   E   s   r3   c               @   s   e Zd ZdZdZdZedfedffZeje	j
ejddZejdd	d
ZejddZejeedZejdeddZejd	eddZdd ZG dd dZdS )
UserDevicez$
    model for App User Device

    r   r   ZANDROIDZIOSZuser_device)	on_deleterelated_namer   T)r   r   i  )r   )r    r!   Fz8Designates whether the App User Device is active or not )r    	help_textz8Designates whether theUser Device token is valid or not c             C   s   d| j j S )Nz%s)useremail)r#   r   r   r   r$   x   s    zUserDevice.__str__c               @   s   e Zd ZdZdZdZdZdS )zUserDevice.Metaz User Device Class Meta r;   N)r
   r   r   r   r%   r&   r'   r   r   r   r   r   {   s   r   N)r
   r   r   r   ZDEVICE_ANDROIDZ	DEVICE_OSZDEVICE_TYPESr   
ForeignKeyr   AUTH_USER_MODELCASCADEr?   r+   Zdevice_tokenZ	device_idr2   Zdevice_typer9   r*   r:   Zis_device_token_validr$   r   r   r   r   r   r;   Z   s"   

r;   c               @   sL   e Zd ZdZejddZejddZejddZ	dd Z
G dd	 d	eZd
S )Countryz
    Country Model

    r   )r   T)r    c             C   s
   d| j  S )Nz%s)name)r#   r   r   r   r$      s    zCountry.__str__c               @   s   e Zd ZdZdZdZdZdS )zCountry.Metaz
        inner class

        rD   Z	CountriescountryN)r
   r   r   r   r%   r&   r'   r   r   r   r   r      s   r   N)r
   r   r   r   r   r+   country_coderE   r9   r:   r$   objectr   r   r   r   r   rD      s   rD   c               @   s^   e Zd ZdZejedejdZej	ddZ
ej	ddZejddZdd	 ZG d
d deZdS )Statez
    State Model

    Zstate_country)r=   r<   r   )r   T)r    c             C   s
   d| j  S )Nz%s)rE   )r#   r   r   r   r$      s    zState.__str__c               @   s   e Zd ZdZdZdZdZdS )z
State.Metaz
        inner class

        rI   ZStatesN)r
   r   r   r   r%   r&   r'   r   r   r   r   r      s   r   N)r
   r   r   r   r   rA   rD   rC   rF   r+   Z
state_coderE   r9   r:   r$   rH   r   r   r   r   r   rI      s   rI   c               @   sR   e Zd ZdZejedejdZej	ddZ
ejddZdd	 ZG d
d deZdS )Cityz
    Country Model

    Z
city_state)r=   r<   r   )r   T)r    c             C   s
   d| j  S )Nz%s)rE   )r#   r   r   r   r$      s    zCity.__str__c               @   s   e Zd ZdZdZdZdZdS )z	City.Metaz
        inner class

        rJ   ZcitiesN)r
   r   r   r   r%   r&   r'   r   r   r   r   r      s   r   N)r
   r   r   r   r   rA   rI   rC   stater+   rE   r9   r:   r$   rH   r   r   r   r   r   rJ      s   rJ   )r   	itertoolsdjango.confr   	django.dbr   django.utils.translationr   r*   Zdjango_mysql.modelsr   Ztinymce.modelsr   Modelr   r   r3   r;   rD   rI   rJ   r   r   r   r   <module>   s   	)(