def event_detail(request, event_id): form_subscriber = forms.SubscriberForm(request.POST or None) if request.method == 'POST' and form_subscriber.is_valid(): form_subscriber.save() name_event = get_object_or_404(Event, id=event_id) object_event = Event.objects.filter(is_active=True) return render( request, 'event_detail.html', { 'variable_event': object_event, 'name_event': name_event, 'form_subscriber': form_subscriber })
def project(request): form_subscriber = forms.SubscriberForm(request.POST or None) if request.method == 'POST' and form_subscriber.is_valid(): form_subscriber.save() object_project = Project.objects.filter(is_active=True) object_image = ProjectImage.objects.filter(project__name__isnull=False) return render( request, 'projects.html', { 'variable_project': object_project, 'variable_image': object_image, 'form_subscriber': form_subscriber })
def room_detail(request, room_id): form_subscriber = forms.SubscriberForm(request.POST or None) if request.method == 'POST' and form_subscriber.is_valid(): form_subscriber.save() name_room = get_object_or_404(Rooms, id=room_id) object_room = Rooms.objects.filter(is_active=True) return render( request, 'room_detail.html', { 'variable_room': object_room, 'name_room': name_room, 'form_subscriber': form_subscriber })
def room(request): form_subscriber = forms.SubscriberForm(request.POST or None) if request.method == 'POST' and form_subscriber.is_valid(): form_subscriber.save() object_room = Rooms.objects.filter(is_active=True) form_room = RoomForm(request.POST or None, request.FILES, initial={"object_room": object_room}) if request.method == 'POST' and form_room.is_valid(): form_room.save() #return HttpResponseRedirect(reverse('rooms', kwargs={})) return render( request, 'rooms.html', { 'variable_room': object_room, 'form_room': form_room, 'form_subscriber': form_subscriber })
def event(request): form_subscriber = forms.SubscriberForm(request.POST or None) if request.method == 'POST' and form_subscriber.is_valid(): form_subscriber.save() object_event = Event.objects.filter(is_active=True) form_event = EventForm(request.POST or None, request.FILES, initial={"object_event": object_event}) if request.method == 'POST' and form_event.is_valid(): form_event.save() return HttpResponseRedirect(reverse('event', kwargs={})) #return render(request, 'events.html', locals()) return render( request, 'events.html', { 'variable_event': object_event, 'form_event': form_event, 'form_subscriber': form_subscriber })
def social(request): form_subscriber = forms.SubscriberForm(request.POST or None) if request.method == 'POST' and form_subscriber.is_valid(): form_subscriber.save() return render(request, 'social.html', {'form_subscriber': form_subscriber})
def home(request): form_subscriber = forms.SubscriberForm(request.POST or None) if request.method == 'POST' and form_subscriber.is_valid(): form_subscriber.save() #return HttpResponseRedirect(reverse('home')) return render(request, 'home.html', {'form_subscriber': form_subscriber})