def sandom(request): c = dict(feedback_form=forms.FeedbackForm(), sliders=models.SliderItem.objects.all(), title='Санаторий на дому', tours=models.Tour.objects.filter(active_for_right=True), articles=models.Article.objects.filter(active_for_right=True)) return render(request, 'elittour/sandom.html', c)
def strashovka(request): c = dict(feedback_form=forms.FeedbackForm(), sliders=models.SliderItem.objects.all(), title='Туристическое страхование', tours=models.Tour.objects.filter(active_for_right=True), articles=models.Article.objects.filter(active_for_right=True)) return render(request, 'elittour/strashovka.html', c)
def kredit(request): c = dict(feedback_form=forms.FeedbackForm(), sliders=models.SliderItem.objects.all(), title='Продажа туров в кредит', tours=models.Tour.objects.filter(active_for_right=True), articles=models.Article.objects.filter(active_for_right=True)) return render(request, 'elittour/kredit.html', c)
def transfer(request): c = dict(feedback_form=forms.FeedbackForm(), sliders=models.SliderItem.objects.all(), title='Трансфер в аэропорт и на железнодорожный вокзал', tours=models.Tour.objects.filter(active_for_right=True), articles=models.Article.objects.filter(active_for_right=True)) return render(request, 'elittour/transfer.html', c)
def avia(request): c = dict(feedback_form=forms.FeedbackForm(), sliders=models.SliderItem.objects.all(), title='Регистрация на рейс', tours=models.Tour.objects.filter(active_for_right=True), articles=models.Article.objects.filter(active_for_right=True)) return render(request, 'elittour/avia.html', c)
def bilet(request): c = dict(feedback_form=forms.FeedbackForm(), sliders=models.SliderItem.objects.all(), title='Продажа авиа и железнодорожных билетов', tours=models.Tour.objects.filter(active_for_right=True), articles=models.Article.objects.filter(active_for_right=True)) return render(request, 'elittour/bilet.html', c)
def viza(request): c = dict(feedback_form=forms.FeedbackForm(), sliders=models.SliderItem.objects.all(), title='Оформление визы', tours=models.Tour.objects.filter(active_for_right=True), articles=models.Article.objects.filter(active_for_right=True)) return render(request, 'elittour/viza.html', c)
def zagranpasport(request): c = dict(feedback_form=forms.FeedbackForm(), sliders=models.SliderItem.objects.all(), title='Оформление загранпаспорта', tours=models.Tour.objects.filter(active_for_right=True), articles=models.Article.objects.filter(active_for_right=True)) return render(request, 'elittour/zagranpasport.html', c)
def create_person_request(request): """ Ajax """ c = {} form = forms.FeedbackForm(request.POST or None) if form.is_valid(): # print form.cleaned_data name = form.cleaned_data.get('name') email = form.cleaned_data.get('email') phone_number = form.cleaned_data.get('phone_number') message = form.cleaned_data.get('message') models.PersonRequest.objects.create( name=name, email=email, phone_number=phone_number, message=message, ) subject = u'ЗАЯВКА С САЙТА' message = u'телефон: %s \n Имя: %s \n Email: %s \n Сообщение: %s' % ( phone_number, name, email, message) send_mail(subject, message, '*****@*****.**', ['*****@*****.**', '*****@*****.**'], fail_silently=False) return HttpResponse('Ok') c['feedback_form'] = form return render(request, 'elittour/items/feedbackform.html', c)
def get_context_data(self, **kwargs): c = { u'feedback_form': forms.FeedbackForm(), u'sliders': models.SliderItem.objects.all(), u'title': self.title, u'tours': models.Tour.objects.filter( active_for_right=True).order_by('number'), u'articles': models.Article.objects.filter( active_for_right=True).order_by('number') } try: self.category = models.Category.objects.get( name=self.category_name) article = models.Article.objects.filter(category=self.category, show=True)[0] c[u'article'] = article print self.category finally: return c