##// END OF EJS Templates
First add the truncator (if there is none in the text itself), then closing tags
First add the truncator (if there is none in the text itself), then closing tags

File last commit:

r1404:fabf89e8 default
r1788:e1bfd1eb default
Show More
cleantags.py
19 lines | 540 B | text/x-python | PythonLexer
neko259
Store UUID for posts and get thread diff by UUIDs instead of update time or...
r1118 from django.core.management import BaseCommand
from django.db import transaction
from django.db.models import Count
from boards.models import Tag
__author__ = 'neko259'
class Command(BaseCommand):
help = 'Removed tags that have no threads'
@transaction.atomic
def handle(self, *args, **options):
neko259
Fixed 'cleantags' command
r1404 empty = Tag.objects.annotate(num_threads=Count('thread_tags'))\
neko259
Store UUID for posts and get thread diff by UUIDs instead of update time or...
r1118 .filter(num_threads=0).order_by('-required', 'name')
print('Removing {} empty tags'.format(empty.count()))
empty.delete()