summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2010-03-27 11:40:17 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2010-03-27 11:40:17 -0400
commitc6f0f78483cf6ac0fd1e607db02f765c6efddc27 (patch)
tree1ed394461f5de742122c2a43424284edd7be1e29
parent9413c12d2126d4f86f2340e458226e72c0d4ecec (diff)
downloadaskbot-c6f0f78483cf6ac0fd1e607db02f765c6efddc27.tar.gz
askbot-c6f0f78483cf6ac0fd1e607db02f765c6efddc27.tar.bz2
askbot-c6f0f78483cf6ac0fd1e607db02f765c6efddc27.zip
dos2unix
-rwxr-xr-xcron/multi_award_badges4
-rwxr-xr-xcron/multi_award_badges_virtualenv4
-rwxr-xr-xcron/once_award_badges6
-rwxr-xr-xcron/once_award_badges_virtualenv4
-rw-r--r--cron/send_email_alerts4
-rw-r--r--cron/send_email_alerts_virtualenv4
-rwxr-xr-xforum/authentication/forms.py2
-rw-r--r--forum/context.py2
-rwxr-xr-xforum/skins/__init__.py12
-rwxr-xr-xforum/skins/default/media/js/com.cnprog.utils.js4
-rwxr-xr-xforum/skins/default/templates/base.html2
-rwxr-xr-xforum/skins/default/templates/base_content.html2
-rwxr-xr-xforum/skins/default/templates/footer.html4
-rwxr-xr-xforum/urls.py4
-rwxr-xr-xforum/views/commands.py2
-rwxr-xr-xforum/views/meta.py2
-rwxr-xr-xforum_modules/sphinxfulltext/settings.py2
-rw-r--r--locale/en/LC_MESSAGES/django.mobin26871 -> 26871 bytes
-rw-r--r--locale/en/LC_MESSAGES/django.po8
-rw-r--r--stackexchange/management/commands/load_stackexchange.py82
20 files changed, 75 insertions, 79 deletions
diff --git a/cron/multi_award_badges b/cron/multi_award_badges
index b34abd09..3d768772 100755
--- a/cron/multi_award_badges
+++ b/cron/multi_award_badges
@@ -1,5 +1,5 @@
#!/bin/sh
-PYTHONPATH=/path/to/dir_above_osqa_site
+PYTHONPATH=/path/to/dir_above_askbot_site
export PYTHONPATH
-PROJECT_ROOT=$PYTHONPATH/osqa_site
+PROJECT_ROOT=$PYTHONPATH/askbot_site
python manage.py multi_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1
diff --git a/cron/multi_award_badges_virtualenv b/cron/multi_award_badges_virtualenv
index df58155a..4230fb22 100755
--- a/cron/multi_award_badges_virtualenv
+++ b/cron/multi_award_badges_virtualenv
@@ -1,7 +1,7 @@
#!/bin/sh
-WORKON_HOME=~/envs/osqa
-PROJECT_ROOT=~/webapps/osqa_server/projects/osqa/
+WORKON_HOME=~/envs/askbot
+PROJECT_ROOT=~/webapps/askbot_server/projects/askbot/
# activate virtual environment
. $WORKON_HOME/bin/activate
diff --git a/cron/once_award_badges b/cron/once_award_badges
index 43ee2249..069656ca 100755
--- a/cron/once_award_badges
+++ b/cron/once_award_badges
@@ -1,12 +1,12 @@
#!/bin/sh
-PYTHONPATH=/path/to/dir_above_osqa_site
+PYTHONPATH=/path/to/dir_above_askbot_site
export PYTHONPATH
-PROJECT_ROOT=$PYTHONPATH/osqa_site
+PROJECT_ROOT=$PYTHONPATH/askbot_site
python manage.py once_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1
#!/bin/sh
-PYTHONPATH=/usr/local/sites/osqa_production
+PYTHONPATH=/usr/local/sites/askbot_production
export PYTHONPATH
PROJECT_ROOT=$PYTHONPATH/robofaqs
python $PROJECT_ROOT/manage.py once_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1
diff --git a/cron/once_award_badges_virtualenv b/cron/once_award_badges_virtualenv
index 12414969..0011981c 100755
--- a/cron/once_award_badges_virtualenv
+++ b/cron/once_award_badges_virtualenv
@@ -1,7 +1,7 @@
#!/bin/sh
-WORKON_HOME=~/envs/osqa
-PROJECT_ROOT=~/webapps/osqa_server/projects/osqa/
+WORKON_HOME=~/envs/askbot
+PROJECT_ROOT=~/webapps/askbot_server/projects/askbot/
# activate virtual environment
. $WORKON_HOME/bin/activate
diff --git a/cron/send_email_alerts b/cron/send_email_alerts
index cae09606..7581a88c 100644
--- a/cron/send_email_alerts
+++ b/cron/send_email_alerts
@@ -1,5 +1,5 @@
#!/bin/sh
-PYTHONPATH=/path/to/dir_above_osqa_site
+PYTHONPATH=/path/to/dir_above_askbot_site
export PYTHONPATH
-PROJECT_ROOT=$PYTHONPATH/osqa_site
+PROJECT_ROOT=$PYTHONPATH/askbot_site
/path/to/python $PROJECT_ROOT/manage.py send_email_alerts
diff --git a/cron/send_email_alerts_virtualenv b/cron/send_email_alerts_virtualenv
index 6c9e154d..2f1b64d0 100644
--- a/cron/send_email_alerts_virtualenv
+++ b/cron/send_email_alerts_virtualenv
@@ -1,7 +1,7 @@
#!/bin/sh
-WORKON_HOME=~/envs/osqa
-PROJECT_ROOT=~/webapps/osqa_server/projects/osqa/
+WORKON_HOME=~/envs/askbot
+PROJECT_ROOT=~/webapps/askbot_server/projects/askbot/
# activate virtual environment
. $WORKON_HOME/bin/activate
diff --git a/forum/authentication/forms.py b/forum/authentication/forms.py
index 7fa06b01..24e76c08 100755
--- a/forum/authentication/forms.py
+++ b/forum/authentication/forms.py
@@ -39,7 +39,7 @@ class TemporaryLoginRequestForm(forms.Form):
class SimpleEmailSubscribeForm(forms.Form):
SIMPLE_SUBSCRIBE_CHOICES = (
('y',_('okay, let\'s try!')),
- ('n',_('no OSQA community email please, thanks'))
+ ('n',_('no community email please, thanks'))
)
subscribe = forms.ChoiceField(widget=forms.widgets.RadioSelect(), \
error_messages={'required':_('please choose one of the options above')},
diff --git a/forum/context.py b/forum/context.py
index 905d24dd..d8f1d838 100644
--- a/forum/context.py
+++ b/forum/context.py
@@ -15,7 +15,7 @@ def application_settings(context):
'GOOGLE_ANALYTICS_KEY':settings.GOOGLE_ANALYTICS_KEY,
'WIKI_ON':settings.WIKI_ON,
'RESOURCE_REVISION':settings.RESOURCE_REVISION,
- 'OSQA_SKIN':settings.OSQA_DEFAULT_SKIN,
+ 'ASKBOT_SKIN':settings.ASKBOT_DEFAULT_SKIN,
}
return {'settings':my_settings}
diff --git a/forum/skins/__init__.py b/forum/skins/__init__.py
index be6bd4f3..10b6a340 100755
--- a/forum/skins/__init__.py
+++ b/forum/skins/__init__.py
@@ -5,9 +5,9 @@ from django.http import HttpResponse
import os.path
import logging
-#module for skinning osqa
+#module for skinning askbot
#at this point skin can be changed only in settings file
-#via OSQA_DEFAULT_SKIN variable
+#via ASKBOT_DEFAULT_SKIN variable
#note - Django template loaders use method django.utils._os.safe_join
#to work on unicode file paths
@@ -15,7 +15,7 @@ import logging
def load_template_source(name, dirs=None):
try:
- tname = os.path.join(settings.OSQA_DEFAULT_SKIN,'templates',name)
+ tname = os.path.join(settings.ASKBOT_DEFAULT_SKIN,'templates',name)
return filesystem.load_template_source(tname,dirs)
except:
tname = os.path.join('default','templates',name)
@@ -26,7 +26,7 @@ def find_media_source(url):
"""returns url prefixed with the skin name
of the first skin that contains the file
directories are searched in this order:
- settings.OSQA_DEFAULT_SKIN, then 'default', then 'commmon'
+ settings.ASKBOT_DEFAULT_SKIN, then 'default', then 'commmon'
if file is not found - returns None
and logs an error message
"""
@@ -37,9 +37,9 @@ def find_media_source(url):
f = os.path.isfile
skins = n(j(d(d(__file__)),'skins'))
try:
- media = os.path.join(skins, settings.OSQA_DEFAULT_SKIN, url)
+ media = os.path.join(skins, settings.ASKBOT_DEFAULT_SKIN, url)
assert(f(media))
- use_skin = settings.OSQA_DEFAULT_SKIN
+ use_skin = settings.ASKBOT_DEFAULT_SKIN
except:
try:
media = j(skins, 'default', url)
diff --git a/forum/skins/default/media/js/com.cnprog.utils.js b/forum/skins/default/media/js/com.cnprog.utils.js
index 3f7720c1..3b816ed7 100755
--- a/forum/skins/default/media/js/com.cnprog.utils.js
+++ b/forum/skins/default/media/js/com.cnprog.utils.js
@@ -1,6 +1,6 @@
-//var $, scriptUrl, osqaSkin
+//var $, scriptUrl, askbotSkin
var mediaUrl = function(resource){
- return scriptUrl + 'm/' + osqaSkin + '/' + resource;
+ return scriptUrl + 'm/' + askbotSkin + '/' + resource;
};
var showMessage = function(object, msg) {
diff --git a/forum/skins/default/templates/base.html b/forum/skins/default/templates/base.html
index cd7aba23..6a06e7cd 100755
--- a/forum/skins/default/templates/base.html
+++ b/forum/skins/default/templates/base.html
@@ -21,7 +21,7 @@
/* <![CDATA[ */
var i18nLang = '{{settings.LANGUAGE_CODE}}';
var scriptUrl = '/{{settings.FORUM_SCRIPT_ALIAS}}'
- var osqaSkin = '{{settings.OSQA_SKIN}}';
+ var askbotSkin = '{{settings.ASKBOT_SKIN}}';
/* ]] */
</script>
<script type='text/javascript' src='{% media "/media/js/com.cnprog.i18n.js" %}'></script>
diff --git a/forum/skins/default/templates/base_content.html b/forum/skins/default/templates/base_content.html
index d1cf673b..c98e1f67 100755
--- a/forum/skins/default/templates/base_content.html
+++ b/forum/skins/default/templates/base_content.html
@@ -19,7 +19,7 @@
<script type="text/javascript">
var i18nLang = '{{ settings.LANGUAGE_CODE }}';
var scriptUrl = '/{{settings.FORUM_SCRIPT_ALIAS}}'
- var osqaSkin = '{{settings.OSQA_SKIN}}';
+ var askbotSkin = '{{settings.ASKBOT_SKIN}}';
</script>
<script type='text/javascript' src='{% media "/media/js/com.cnprog.i18n.js" %}'></script>
<script type='text/javascript' src='{% media "/media/js/jquery.i18n.js" %}'></script>
diff --git a/forum/skins/default/templates/footer.html b/forum/skins/default/templates/footer.html
index 66ea2bc5..cb46c2cc 100755
--- a/forum/skins/default/templates/footer.html
+++ b/forum/skins/default/templates/footer.html
@@ -21,8 +21,8 @@
{% endspaceless %}
</div>
<p>
- <a href="http://osqa.net" target="_blank">
- powered by OSQA
+ <a href="http://askbot.net" target="_blank">
+ powered by ASKBOT
</a>
</p>
</div>
diff --git a/forum/urls.py b/forum/urls.py
index 3e99af41..a76906cb 100755
--- a/forum/urls.py
+++ b/forum/urls.py
@@ -23,7 +23,7 @@ urlpatterns = patterns('',
#(r'^favicon\.gif$', 'django.views.generic.simple.redirect_to', {'url': '/media/images/favicon.gif'}),
url(r'^m/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': os.path.join(APP_PATH,'skins').replace('\\','/')},
- name='osqa_media',
+ name='askbot_media',
),
url(r'^%s(?P<path>.*)$' % _('upfiles/'), 'django.views.static.serve',
{'document_root': os.path.join(APP_PATH,'upfiles').replace('\\','/')},
@@ -81,7 +81,7 @@ urlpatterns = patterns('',
url(r'^%s(?P<id>\d+)//*' % _('badges/'), app.meta.badge, name='badge'),
url(r'^%s%s$' % (_('messages/'), _('markread/')),app.commands.read_message, name='read_message'),
# (r'^admin/doc/' % _('admin/doc'), include('django.contrib.admindocs.urls')),
- url(r'^%s(.*)' % _('nimda/'), admin.site.root, name='osqa_admin'),
+ url(r'^%s(.*)' % _('nimda/'), admin.site.root, name='askbot_admin'),
url(r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}, name='feeds'),
url(r'^%s$' % _('upload/'), app.writers.upload, name='upload'),
url(r'^%s$' % _('search/'), app.readers.search, name='search'),
diff --git a/forum/views/commands.py b/forum/views/commands.py
index ca6569e2..b312242d 100755
--- a/forum/views/commands.py
+++ b/forum/views/commands.py
@@ -317,7 +317,7 @@ def reopen(request, id):#re-open question
'question' : question,
}, context_instance=RequestContext(request))
-#osqa-user communication system
+#askbot-user communication system
def read_message(request):#marks message a read
if request.method == "POST":
if request.POST['formdata'] == 'required':
diff --git a/forum/views/meta.py b/forum/views/meta.py
index 6417e8f5..40f3d394 100755
--- a/forum/views/meta.py
+++ b/forum/views/meta.py
@@ -51,7 +51,7 @@ def logout(request):#refactor/change behavior?
#I guess rationale was to tell the user that s/he may be still logged in
#through their external login sytem and we'd want to remind them about it
#however it might be a little annoying
-#why not just show a message: you are logged out of osqa, but
+#why not just show a message: you are logged out of askbot, but
#if you really want to log out -> go to your openid provider
return render_to_response('logout.html', {
'next' : get_next_url(request),
diff --git a/forum_modules/sphinxfulltext/settings.py b/forum_modules/sphinxfulltext/settings.py
index 7c2da124..564404c6 100755
--- a/forum_modules/sphinxfulltext/settings.py
+++ b/forum_modules/sphinxfulltext/settings.py
@@ -1,5 +1,5 @@
SPHINX_API_VERSION = 0x113 #refer to djangosphinx documentation
-SPHINX_SEARCH_INDICES=('osqa',) #a tuple of index names remember about a comma after the
+SPHINX_SEARCH_INDICES=('askbot',) #a tuple of index names remember about a comma after the
#last item, especially if you have just one :)
SPHINX_SERVER='localhost'
SPHINX_PORT=3312
diff --git a/locale/en/LC_MESSAGES/django.mo b/locale/en/LC_MESSAGES/django.mo
index cc6d50e7..4eaf9b83 100644
--- a/locale/en/LC_MESSAGES/django.mo
+++ b/locale/en/LC_MESSAGES/django.mo
Binary files differ
diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po
index 3f1c187f..3d1e14a3 100644
--- a/locale/en/LC_MESSAGES/django.po
+++ b/locale/en/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-03-27 11:18-0400\n"
+"POT-Creation-Date: 2010-03-27 11:33-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -580,7 +580,7 @@ msgstr ""
msgid "okay, let's try!"
msgstr ""
-#: forum/forms.py:347
+#: forum/forms.py:347 forum/authentication/forms.py:42
msgid "no community email please, thanks"
msgstr "no askbot email please, thanks"
@@ -766,10 +766,6 @@ msgstr ""
msgid "Sorry, but this email is not on our database."
msgstr ""
-#: forum/authentication/forms.py:42
-msgid "no OSQA community email please, thanks"
-msgstr ""
-
#: forum/management/commands/send_email_alerts.py:236
msgid "email update message subject"
msgstr "news from Q&A forum"
diff --git a/stackexchange/management/commands/load_stackexchange.py b/stackexchange/management/commands/load_stackexchange.py
index afe4b9ea..9cfc7192 100644
--- a/stackexchange/management/commands/load_stackexchange.py
+++ b/stackexchange/management/commands/load_stackexchange.py
@@ -7,7 +7,7 @@ import sys
import stackexchange.parse_models as se_parser
from xml.etree import ElementTree as et
from django.db import models
-import forum.models as osqa
+import forum.models as askbot
import stackexchange.models as se
from forum.forms import EditUserEmailFeedsForm
from forum.utils.html import sanitize_html
@@ -28,21 +28,21 @@ xml_read_order = (
'ModeratorMessages','Messages','Comments2Votes',
)
-#association tables SE item id --> OSQA item id
+#association tables SE item id --> ASKBOT item id
#table associations are implied
#todo: there is an issue that these may be inconsistent with the database
-USER = {}#SE User.id --> django(OSQA) User.id
+USER = {}#SE User.id --> django(ASKBOT) User.id
QUESTION = {}
ANSWER = {}
NAMESAKE_COUNT = {}# number of times user name was used - for X.get_screen_name
class X(object):#
"""class with methods for handling some details
- of SE --> OSQA mapping
+ of SE --> ASKBOT mapping
"""
badge_type_map = {'1':'gold','2':'silver','3':'bronze'}
- osqa_supported_id_providers = (
+ askbot_supported_id_providers = (
'google','yahoo','aol','myopenid',
'flickr','technorati',
'wordpress','blogger','livejournal',
@@ -51,8 +51,8 @@ class X(object):#
'twitter' #oauth is not on this list, b/c it has no own url
)
- #map SE VoteType -> osqa.User vote method
- #created methods with the same call structure in osqa.User
+ #map SE VoteType -> askbot.User vote method
+ #created methods with the same call structure in askbot.User
#User.<vote_method>(post, timestamp=None, cancel=False)
vote_actions = {
'UpMod':'upvote',
@@ -70,8 +70,8 @@ class X(object):#
)
#badges whose names don't match exactly, but
- #present in both SE and OSQA
- badge_exceptions = {# SE --> OSQA
+ #present in both SE and ASKBOT
+ badge_exceptions = {# SE --> ASKBOT
'Citizen Patrol':'Citizen patrol',#single #todo: why sentence case?
'Strunk &amp; White':'Strunk & White',#single
'Civic Duty':'Civic duty',
@@ -112,7 +112,7 @@ class X(object):#
@classmethod
def get_message_text(cls, se_m):
"""try to intelligently translate
- SE message to OSQA so that it makese sense in
+ SE message to ASKBOT so that it makese sense in
our context
"""
#todo: properly translate messages
@@ -137,9 +137,9 @@ class X(object):#
#or use database to store these associations
post_type = se_post.post_type.name
if post_type == 'Question':
- return osqa.Question.objects.get(id=QUESTION[se_post.id].id)
+ return askbot.Question.objects.get(id=QUESTION[se_post.id].id)
elif post_type == 'Answer':
- return osqa.Answer.objects.get(id=ANSWER[se_post.id].id)
+ return askbot.Answer.objects.get(id=ANSWER[se_post.id].id)
else:
raise Exception('unknown post type %s' % post_type)
@@ -152,7 +152,7 @@ class X(object):#
@classmethod
def get_user(cls, se_user):
#todo: same as get_post
- return osqa.User.objects.get(id=USER[se_user.id].id)
+ return askbot.User.objects.get(id=USER[se_user.id].id)
@classmethod
def get_post_revision_group_types(cls, rev_group):
@@ -191,7 +191,7 @@ class X(object):#
name = re.subn(r'\s+',' ',name)[0]#remove repeating spaces
try:
- u = osqa.User.objects.get(username = name)
+ u = askbot.User.objects.get(username = name)
try:
if u.location:
name += ', %s' % u.location
@@ -200,9 +200,9 @@ class X(object):#
name += ' %d' % NAMESAKE_COUNT[name]
else:
NAMESAKE_COUNT[name] = 1
- except osqa.User.DoesNotExist:
+ except askbot.User.DoesNotExist:
pass
- except osqa.User.DoesNotExist:
+ except askbot.User.DoesNotExist:
NAMESAKE_COUNT[name] = 1
return name
@@ -230,7 +230,7 @@ class X(object):#
base_url = bits[2] #assume this is base url
url_bits = base_url.split('.')
provider_name = url_bits[-2].lower()
- if provider_name not in cls.osqa_supported_id_providers:
+ if provider_name not in cls.askbot_supported_id_providers:
raise Exception('could not determine login provider for %s' % openid_url)
return provider_name
@@ -265,7 +265,7 @@ class X(object):#
return cls.badge_exceptions.get(name, name)
class Command(BaseCommand):
- help = 'Loads StackExchange data from unzipped directory of XML files into the OSQA database'
+ help = 'Loads StackExchange data from unzipped directory of XML files into the ASKBOT database'
args = 'se_dump_dir'
def handle(self, *arg, **kwarg):
@@ -287,9 +287,9 @@ class Command(BaseCommand):
#when we upgrade to django 1.2 and definitely by 1.4 when
#the current message system will be replaced with the
#django messages framework
- self.save_osqa_message_id_list()
+ self.save_askbot_message_id_list()
- #transfer data into OSQA tables
+ #transfer data into ASKBOT tables
print 'Transferring users...',
sys.stdout.flush()
self.transfer_users()
@@ -323,20 +323,20 @@ class Command(BaseCommand):
self.transfer_tag_preferences()
self.transfer_meta_pages()
- def save_osqa_message_id_list(self):
+ def save_askbot_message_id_list(self):
id_list = list(DjangoMessage.objects.all().values('id'))
- self._osqa_message_id_list = id_list
+ self._askbot_message_id_list = id_list
def cleanup_messages(self):
"""deletes messages generated by the load process
"""
- id_list = self._osqa_message_id_list
+ id_list = self._askbot_message_id_list
mset = DjangoMessage.objects.all().exclude(id__in=id_list)
mset.delete()
def transfer_messages(self):
"""transfers some messages from
- SE to OSQA
+ SE to ASKBOT
"""
for m in se.Message.objects.all():
if m.is_read:
@@ -374,7 +374,7 @@ class Command(BaseCommand):
post_type = rev_group[0].post.post_type.name
if post_type == 'Question':
- q = osqa.Question.objects.create_new(
+ q = askbot.Question.objects.create_new(
title = title,
author = author,
added_at = added_at,
@@ -385,7 +385,7 @@ class Command(BaseCommand):
QUESTION[rev_group[0].post.id] = q
elif post_type == 'Answer':
q = X.get_post(rev_group[0].post.parent)
- a = osqa.Answer.objects.create_new(
+ a = askbot.Answer.objects.create_new(
question = q,
author = author,
added_at = added_at,
@@ -455,10 +455,10 @@ class Command(BaseCommand):
def mark_activity(self,p,u,t):
"""p,u,t - post, user, timestamp
"""
- if isinstance(p, osqa.Question):
+ if isinstance(p, askbot.Question):
p.last_activity_by = u
p.last_activity_at = t
- elif isinstance(p, osqa.Answer):
+ elif isinstance(p, askbot.Answer):
p.question.last_activity_by = u
p.question.last_activity_at = t
p.question.save()
@@ -597,11 +597,11 @@ class Command(BaseCommand):
continue
se_post = se_c.post
if se_post.post_type.name == 'Question':
- osqa_post = QUESTION[se_post.id]
+ askbot_post = QUESTION[se_post.id]
elif se_post.post_type.name == 'Answer':
- osqa_post = ANSWER[se_post.id]
+ askbot_post = ANSWER[se_post.id]
- osqa_post.add_comment(
+ askbot_post.add_comment(
comment = se_c.text,
added_at = se_c.creation_date,
user = USER[se_c.user.id]
@@ -612,12 +612,12 @@ class Command(BaseCommand):
for se_b in se.Badge.objects.all():
name = X.get_badge_name(se_b.name)
try:
- osqa.Badge.objects.get(name=name)
+ askbot.Badge.objects.get(name=name)
except:
self._missing_badges[name] = 0
if len(se_b.description) > 300:
print 'Warning truncated description for badge %d' % se_b.id
- osqa.Badge.objects.create(
+ askbot.Badge.objects.create(
name = name,
slug = slugify(name),
description = se_b.description,
@@ -627,19 +627,19 @@ class Command(BaseCommand):
def _award_badges(self):
#note: SE does not keep information on
- #content-related badges like osqa does
+ #content-related badges like askbot does
for se_a in se.User2Badge.objects.all():
if se_a.user.id == -1:
continue #skip community user
u = USER[se_a.user.id]
badge_name = X.get_badge_name(se_a.badge.name)
- b = osqa.Badge.objects.get(name=badge_name)
+ b = askbot.Badge.objects.get(name=badge_name)
if b.multiple == False:
if b.award_badge.count() > 0:
continue
#todo: fake content object here b/c SE does not support this
- #todo: but osqa requires related content object
- osqa.Award.objects.create(
+ #todo: but askbot requires related content object
+ askbot.Award.objects.create(
user=u,
badge=b,
awarded_at=se_a.date,
@@ -651,7 +651,7 @@ class Command(BaseCommand):
def _cleanup_badges(self):
d = self._missing_badges
unused = [name for name in d.keys() if d[name] == 0]
- osqa.Badge.objects.filter(name__in=unused).delete()
+ askbot.Badge.objects.filter(name__in=unused).delete()
installed = [name for name in d.keys() if d[name] > 0]
print 'Warning - following unsupported badges were installed:'
print ', '.join(installed)
@@ -682,7 +682,7 @@ class Command(BaseCommand):
u = X.get_user(v.user)
p = X.get_post(v.post)
m = X.vote_actions[vote_type]
- vote_method = getattr(osqa.User, m)
+ vote_method = getattr(askbot.User, m)
vote_method(u, p, timestamp = v.creation_date)
if v.deletion_date:
vote_method(u, p, timestamp = v.deletion_date, cancel=True)
@@ -727,7 +727,7 @@ class Command(BaseCommand):
for se_u in se.User.objects.all():
if se_u.id < 1:#skip the Community user
continue
- u = osqa.User()
+ u = askbot.User()
u_type = se_u.user_type.name
if u_type == 'Administrator':
u.is_superuser = True
@@ -741,7 +741,7 @@ class Command(BaseCommand):
#probably they'll just have to "recover" their account by email
if u_type != 'Unregistered':
assert(se_u.open_id)#everybody must have open_id
- u_auth = osqa.AuthKeyUserAssociation()
+ u_auth = askbot.AuthKeyUserAssociation()
u_auth.key = se_u.open_id
u_auth.provider = X.get_openid_provider_name(se_u.open_id)
u_auth.added_at = se_u.creation_date