
    piE                     d    d dl mZmZ d dlmZ d dlmZ d dlmZm	Z	 ddl
mZmZ d Zd Zd	 Zd
 Zy)    )renderredirect)messages)Post)CategoryProduct   )EnquiryGalleryImagec                    | j                   dk(  r/t        j                  j                  | j                  j                  dd      | j                  j                  d      | j                  j                  dd      | j                  j                  d      | j                  j                  dd      | j                  j                  d	      | j                  j                  d
d      | j                  j                  dd      | j                  j                  d      	      }t        j                  | d       t        d      S 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 }|||d}t#        | d|      S )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:index)statusauthorcategory   T)	is_activeparent__isnull)r   is_top_ratedbrand)latest_postsfeatured_categoriestop_rated_productszhome/index.html)methodr
   objectscreater   getr   successr   r   filterStatus	PUBLISHEDselect_relatedr   r   ACTIVEr   )requestenquiryr!   r"   r#   contexts         #/var/www/alwasay/apps/home/views.pyhomer2      s   ~~//((,,""7B/!,,**?;!,,**?B?,,""7+!,,**?FC )).9LL$$Y5%ll../BBG\\%%j1 ) 

 	"QR%%<<&&{{$$ ' nXz*2A/L #**11DQU1V //~~$$ 0  nZ)"1. %20G
 ',g66    c                     t        | d      S )Nzhome/about.htmlr   r.   s    r1   aboutr7   -   s    ',--r3   c                     t        | d      S )Nzhome/services.htmlr5   r6   s    r1   servicesr9   1   s    '/00r3   c                 \    t         j                  j                         }t        | dd|i      S )Nzhome/gallery.htmlimages)r   r%   allr   )r.   r;   s     r1   galleryr=   5   s+    !!%%'F'.60BCCr3   N)django.shortcutsr   r   django.contribr   apps.blog.modelsr   apps.products.modelsr   r   modelsr
   r   r2   r7   r9   r=    r3   r1   <module>rD      s*    - # ! 2 )"7J.1Dr3   