diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-09-04 18:34:26 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-09-04 18:34:26 -0400 |
commit | b202271b41aa1ecaa0bde24dca51bffb23deb56e (patch) | |
tree | d586d3541741d572a23c27f716139a01a9190a4a | |
parent | 147958042b9a3eb229ebe3d8e3b9d6c488ce036f (diff) | |
download | askbot-b202271b41aa1ecaa0bde24dca51bffb23deb56e.tar.gz askbot-b202271b41aa1ecaa0bde24dca51bffb23deb56e.tar.bz2 askbot-b202271b41aa1ecaa0bde24dca51bffb23deb56e.zip |
fixed the rename_tags_id management command
-rw-r--r-- | askbot/management/commands/rename_tags_id.py | 12 | ||||
-rw-r--r-- | askbot/management/commands/sample_command.py | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/askbot/management/commands/rename_tags_id.py b/askbot/management/commands/rename_tags_id.py index 90dc2916..d6ad419a 100644 --- a/askbot/management/commands/rename_tags_id.py +++ b/askbot/management/commands/rename_tags_id.py @@ -27,8 +27,8 @@ def get_similar_tags_from_strings(tag_strings, tag_name): """returns a list of tags, similar to tag_name from a set of questions""" grab_pattern = r'\b([%(ch)s]*%(nm)s[%(ch)s]*)\b' % \ - {'ch': const.TAG_CHARS, 'nm': from_tag.name} - grab_re = re.compile(grab_pattern, RE.IGNORECASE) + {'ch': const.TAG_CHARS, 'nm': tag_name} + grab_re = re.compile(grab_pattern, re.IGNORECASE) similar_tags = set() for tag_string in tag_strings: @@ -103,9 +103,9 @@ rename_tags, but using tag id's to_tags = get_tags_by_ids(to_tag_ids) admin = get_admin(options['user_id']) - questions = models.Question.objects.all() + questions = models.Thread.objects.all() for from_tag in from_tags: - questions = questions.filter(tags = from_tag) + questions = questions.filter(tags=from_tag) #print some feedback here and give a chance to bail out question_count = questions.count() @@ -159,8 +159,8 @@ or repost a bug, if that does not help""" #may need to run assertions on that there are #print 'Searching for similar tags...', - #leftover_questions = models.Question.objects.filter( - # icontains = from_tag.name + #leftover_questions = models.Thread.objects.filter( + # icontains=from_tag.name # ) #if leftover_questions.count() > 0: # tag_strings = leftover_questions.values_list('tagnames', flat=True) diff --git a/askbot/management/commands/sample_command.py b/askbot/management/commands/sample_command.py index bcdcb58e..40debe63 100644 --- a/askbot/management/commands/sample_command.py +++ b/askbot/management/commands/sample_command.py @@ -1,7 +1,7 @@ from django.core.management.base import NoArgsCommand -from askbot.models import Comment +from askbot.models import Post class Command(NoArgsCommand): def handle_noargs(self, **options): - objs = Comment.objects.all() - print objs
\ No newline at end of file + objs = Post.objects.all() + print objs |