Ë
    ’ÁXj|
  ã                   ó    — d dl Z d dlmZmZ d dlmZ d dlmZ d dlm	Z	m
Z
mZ ddlmZmZ ddlmZ  e j"                  e«      Zd	„ Zd
„ Zd„ Zd„ Zy)é    N)ÚrenderÚredirect)Úmessages)ÚPost)ÚBrandÚCategoryÚProducté   )ÚEnquiryÚGalleryImage)ÚEnquiryFormc                 ó   — | j                   dk(  �r=t        | j                  «      }|j                  «       �r 	 t        j
                  j                  |j                  j                  dd«      |j                  d   |j                  j                  dd«      |j                  d   |j                  j                  dd«      |j                  d	   |j                  j                  d
d«      |j                  j                  dd«      |j                  d   ¬«	       t        j                  | d«       t        d«      S t        j                  | d«       n
t        «       }t         j
                  j#                  t         j$                  j&                  ¬«      j)                  dd«      d d }t*        j
                  j#                  dd¬«      }t,        j
                  j#                  t,        j$                  j.                  d¬«      j)                  dd«      d d }t0        j
                  j#                  d¬«      }|||||dœ}t3        | d|«      S # t        $ r/ t        j                  d«       t        j                  | d«       Y �Œ$w xY w)NÚPOSTÚtitleÚ Úcustomer_nameÚbusiness_nameÚemailÚphone_countryz+971Úphone_numberÚcountryÚAEÚvin_chasis_numberÚcomments)	r   r   r   r   r   r   r   r   r   z-Your enquiry has been submitted successfully!z
home:indexz!Failed to save enquiry submissionzESomething went wrong while submitting your enquiry. Please try again.z.Please correct the errors below and try again.)ÚstatusÚauthorÚcategoryé   T)Ú	is_activeÚparent__isnull)r   Úis_top_ratedÚbrand)r   )ÚformÚlatest_postsÚfeatured_categoriesÚtop_rated_productsÚactive_brandszhome/index.html)Úmethodr   r   Úis_validr   ÚobjectsÚcreateÚcleaned_dataÚgetr   Úsuccessr   Ú	ExceptionÚloggerÚ	exceptionÚerrorr   ÚfilterÚStatusÚ	PUBLISHEDÚselect_relatedr   r	   ÚACTIVEr   r   )Úrequestr#   r$   r%   r&   r'   Úcontexts          ú#/var/www/alwasay/apps/home/views.pyÚhomer;      s.  € Ø‡~�~˜ÓÜ˜7Ÿ<™<Ó(ˆØ�=‰=�?ð.Ü—‘×&Ñ&Ø×+Ñ+×/Ñ/°¸Ó<Ø"&×"3Ñ"3°OÑ"DØ"&×"3Ñ"3×"7Ñ"7¸ÈÓ"LØ×+Ñ+¨GÑ4Ø"&×"3Ñ"3×"7Ñ"7¸ÈÓ"PØ!%×!2Ñ!2°>Ñ!BØ ×-Ñ-×1Ñ1°)¸TÓBØ&*×&7Ñ&7×&;Ñ&;Ð<OÐQSÓ&TØ!×.Ñ.¨zÑ:ð 'ô 
ô$ × Ñ  Ð*YÔZÜ Ó-Ð-ä�N‰N˜7Ð$TÕUä‹}ˆä—<‘<×&Ñ&Ü�{‰{×$Ñ$ð 'ó ç�n�X˜zÓ*¨2¨Að/€Lô #×*Ñ*×1Ñ1¸DÐQUÐ1ÓVÐä Ÿ™×/Ñ/Ü�~‰~×$Ñ$Øð 0ó ÷ �n�Z Ó)¨"¨1ð.Ðô
 —M‘M×(Ñ(°4Ð(Ó8€Mð Ø$Ø2Ø0Ø&ñ€Gô �'Ð,¨gÓ6Ð6øôE ò Ü× Ñ Ð!DÔEÜ—‘ØØ[÷ðús   ¸CI É4I=É<I=c                 ó   — t        | d«      S )Nzhome/about.html©r   ©r8   s    r:   Úaboutr?   B   s   € Ü�'Ð,Ó-Ð-ó    c                 ó   — t        | d«      S )Nzhome/services.htmlr=   r>   s    r:   ÚservicesrB   F   s   € Ü�'Ð/Ó0Ð0r@   c                 ó\   — t         j                  j                  «       }t        | dd|i«      S )Nzhome/gallery.htmlÚimages)r   r*   Úallr   )r8   rD   s     r:   ÚgalleryrF   J   s+   € Ü×!Ñ!×%Ñ%Ó'€FÜ�'Ð.°¸6Ð0BÓCÐCr@   )ÚloggingÚdjango.shortcutsr   r   Údjango.contribr   Úapps.blog.modelsr   Úapps.products.modelsr   r   r	   Úmodelsr   r   Úformsr   Ú	getLoggerÚ__name__r0   r;   r?   rB   rF   © r@   r:   ú<module>rQ      sE   ðÛ ç -Ý #Ý !ß 9Ñ 9ß )Ý à	ˆ×	Ñ	˜8Ó	$€ò27òj.ò1óDr@   