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

# 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





class CustomUser(models.Model): 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() tags = TaggableManager()





+ 5
- 2
application/views.py View File

import sys import sys
import collections import collections
from taggit_templatetags2.views import TagCanvasListView from taggit_templatetags2.views import TagCanvasListView
from django.contrib.auth.models import User



import logging import logging
import mysite.settings import mysite.settings
def tag_list(request): def tag_list(request):
log = logging.getLogger('mysite') log = logging.getLogger('mysite')
u = CustomUser.objects.get(user=request.user) 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) log.info(tags)
arr = [] arr = []
for tag in tags: for tag in tags:
arr.append(str(tag)) arr.append(str(tag))
listing = list(arr) listing = list(arr)
""" """
return render(request, 'tag_list.html', {'arr':arr})
return render(request, 'tag_list.html', locals())


class TagSearch(TagCanvasListView): class TagSearch(TagCanvasListView):
template_name = 'blog_search_list_view.html' template_name = 'blog_search_list_view.html'

+ 17
- 0
log.txt View File

[18/Oct/2018 19:12:55] INFO [mysite:147] CustomUser object (25) [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:18:42] INFO [mysite:147] CustomUser object (25)
[19/Oct/2018 09:19:10] INFO [mysite:148] <QuerySet []> [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