This commit is contained in:
DerTyp187
2021-11-23 18:59:31 +01:00
parent c6ae46342e
commit 073c79bad5
17 changed files with 5 additions and 174 deletions

View File

@@ -1,11 +1,8 @@
from django.http.response import HttpResponse, HttpResponseForbidden
from django.http.response import HttpResponse
from django.shortcuts import render, redirect
from .models import Category, Topic, Rating
from analytics.models import View
def index(req):
view = View(ip=get_ip(req), custom_title="index")
view.save()
categorys_obj = Category.objects.all()
return render(req, "main/index.html", {'categorys': categorys_obj})
@@ -40,10 +37,6 @@ def topic(req, category, topic):
'notHelpful_count': notHelpful_count,
'read_more': topic_obj.read_more,
}
view = View(ip=get_ip(req), topic=topic_obj)
view.save()
return render(req, "main/topic.html", context)
return redirect("main-index")
@@ -57,9 +50,6 @@ def category(req, category):
if category_obj:
topics_obj = Topic.objects.filter(category=category_obj)
view = View(ip=get_ip(req), category=category_obj)
view.save()
context = {
'category_obj': category_obj,
'topics': topics_obj,
@@ -83,8 +73,6 @@ def search(req, value): # https://django-taggit.readthedocs.io/en/latest/getting
def sitemap(req):
topics = Topic.objects.all()
categories = Category.objects.all()
#REPLACE ALL BLANKS WITH %20
context = {
'topics': topics,