removed testing code
This commit is contained in:
parent
4436bd2058
commit
c9e97da9e9
3 changed files with 42 additions and 42 deletions
|
|
@ -8,7 +8,7 @@ from django.contrib.auth.decorators import login_required
|
|||
from django.db import IntegrityError
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render, redirect
|
||||
from blog.factories import TopicFactory
|
||||
#from blog.factories import TopicFactory
|
||||
from blog.models import Topic, Tag, Blogpost
|
||||
from django.template import Template, Context
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
|
|
@ -144,21 +144,21 @@ def addpost(request) -> HttpResponse:
|
|||
return render(request, 'blog/addpost.html', context)
|
||||
|
||||
|
||||
@login_required
|
||||
def createmocks(request, objtype, n) -> HttpResponse:
|
||||
topics = TopicFactory.create_batch(n)
|
||||
|
||||
for topic in topics:
|
||||
topic.save()
|
||||
|
||||
while len(topics) > 1:
|
||||
child = random.choice(topics)
|
||||
topics.remove(child)
|
||||
child.rootTopic = random.choice(topics)
|
||||
child.save()
|
||||
|
||||
print('Created ' + str(n) + ' mock topics.')
|
||||
return redirect("index")
|
||||
# @login_required
|
||||
# def createmocks(request, objtype, n) -> HttpResponse:
|
||||
# topics = TopicFactory.create_batch(n)
|
||||
#
|
||||
# for topic in topics:
|
||||
# topic.save()
|
||||
#
|
||||
# while len(topics) > 1:
|
||||
# child = random.choice(topics)
|
||||
# topics.remove(child)
|
||||
# child.rootTopic = random.choice(topics)
|
||||
# child.save()
|
||||
#
|
||||
# print('Created ' + str(n) + ' mock topics.')
|
||||
# return redirect("index")
|
||||
|
||||
|
||||
@login_required
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue