Commit 4cb03471104a0295cc3545cbe362a992abb3a10d
1 parent
33e0f095
Exists in
master
and in
13 other branches
Using command to update keywords
Showing
2 changed files
with
12 additions
and
4 deletions
Show diff stats
src/super_archives/management/commands/update_keywords.py
0 → 100644
... | ... | @@ -0,0 +1,12 @@ |
1 | +#!/usr/bin/env python | |
2 | + | |
3 | +from django.core.management.base import BaseCommand, CommandError | |
4 | +from super_archives.models import Thread | |
5 | + | |
6 | + | |
7 | +class Command(BaseCommand): | |
8 | + help = "Update keywords used in tag cloud and related thread" | |
9 | + | |
10 | + def handle(self, *args, **kwargs): | |
11 | + for thread in Thread.objects.iterator(): | |
12 | + thread.update_keywords() | ... | ... |
src/super_archives/models.py
... | ... | @@ -166,10 +166,6 @@ class Thread(models.Model, HitCounterModelMixin): |
166 | 166 | |
167 | 167 | return tuple() |
168 | 168 | |
169 | - def save(self, *args, **kwargs): | |
170 | - super(Thread, self).save(*args, **kwargs) | |
171 | - self.update_keywords() | |
172 | - | |
173 | 169 | def __unicode__(self): |
174 | 170 | return '%s - %s (%s)' % (self.id, |
175 | 171 | self.subject_token, | ... | ... |