Browse Source

new migration

newsletter
Esther Kleinhenz 6 years ago
parent
commit
4a753ff6c9
4 changed files with 41 additions and 4 deletions
  1. 18
    0
      application/migrations/0005_auto_20181019_1645.py
  2. 1
    2
      application/models.py
  3. 5
    2
      application/views.py
  4. 17
    0
      log.txt

+ 18
- 0
application/migrations/0005_auto_20181019_1645.py View File

@@ -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',
),
]

+ 1
- 2
application/models.py View File

@@ -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()



+ 5
- 2
application/views.py View File

@@ -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'

+ 17
- 0
log.txt View File

@@ -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)

Loading…
Cancel
Save