@@ -0,0 +1,18 @@ | |||
# Generated by Django 2.1 on 2018-10-19 14:45 | |||
from django.db import migrations | |||
class Migration(migrations.Migration): | |||
dependencies = [ | |||
('application', '0004_auto_20180831_1019'), | |||
] | |||
operations = [ | |||
migrations.RenameField( | |||
model_name='customuser', | |||
old_name='mytags', | |||
new_name='tags', | |||
), | |||
] |
@@ -5,8 +5,7 @@ from taggit.managers import TaggableManager | |||
class CustomUser(models.Model): | |||
user = models.OneToOneField( | |||
'auth.User', null=True, on_delete=models.CASCADE) | |||
user = models.OneToOneField(User, null=True, on_delete=models.CASCADE) | |||
tags = TaggableManager() | |||
@@ -12,6 +12,8 @@ from django.db.models import Q | |||
import sys | |||
import collections | |||
from taggit_templatetags2.views import TagCanvasListView | |||
from django.contrib.auth.models import User | |||
import logging | |||
import mysite.settings | |||
@@ -144,7 +146,8 @@ def student_page(request): | |||
def tag_list(request): | |||
log = logging.getLogger('mysite') | |||
u = CustomUser.objects.get(user=request.user) | |||
tags= Tag.objects.filter(name=u) | |||
log.info(u) | |||
tags = Tag.objects.filter(customuser__user = u) | |||
log.info(tags) | |||
arr = [] | |||
for tag in tags: | |||
@@ -155,7 +158,7 @@ def tag_list(request): | |||
arr.append(str(tag)) | |||
listing = list(arr) | |||
""" | |||
return render(request, 'tag_list.html', {'arr':arr}) | |||
return render(request, 'tag_list.html', locals()) | |||
class TagSearch(TagCanvasListView): | |||
template_name = 'blog_search_list_view.html' |
@@ -38,3 +38,20 @@ | |||
[18/Oct/2018 19:12:55] INFO [mysite:147] CustomUser object (25) | |||
[19/Oct/2018 09:18:42] INFO [mysite:147] CustomUser object (25) | |||
[19/Oct/2018 09:19:10] INFO [mysite:148] <QuerySet []> | |||
[19/Oct/2018 10:24:35] INFO [mysite:148] <QuerySet []> | |||
[19/Oct/2018 16:52:08] INFO [mysite:148] <QuerySet []> | |||
[19/Oct/2018 17:33:50] INFO [mysite:149] CustomUser object (25) | |||
[19/Oct/2018 17:38:33] INFO [mysite:149] CustomUser object (25) | |||
[19/Oct/2018 17:39:08] INFO [mysite:149] CustomUser object (25) | |||
[19/Oct/2018 17:41:43] INFO [mysite:149] CustomUser object (25) | |||
[19/Oct/2018 17:42:00] INFO [mysite:149] CustomUser object (25) | |||
[19/Oct/2018 17:44:10] INFO [mysite:149] CustomUser object (25) | |||
[19/Oct/2018 17:47:28] INFO [mysite:149] CustomUser object (25) | |||
[19/Oct/2018 17:48:28] INFO [mysite:149] CustomUser object (25) | |||
[19/Oct/2018 17:56:41] INFO [mysite:149] CustomUser object (25) | |||
[19/Oct/2018 18:06:57] INFO [mysite:149] CustomUser object (25) | |||
[19/Oct/2018 18:07:17] INFO [mysite:149] CustomUser object (25) | |||
[19/Oct/2018 18:07:31] INFO [mysite:149] CustomUser object (25) | |||
[19/Oct/2018 18:12:56] INFO [mysite:149] CustomUser object (25) | |||
[19/Oct/2018 18:15:29] INFO [mysite:149] CustomUser object (25) | |||
[20/Oct/2018 17:20:58] INFO [mysite:149] CustomUser object (25) |