I am currently working on OSQA, and I am having really trouble when I try to import some questions and answers from another q&a site.
Searching before posting, I found this link on meta.osqa about importing data, and some typical errors, but it is no longer valid. http://meta.osqa.net/questions/4080/how-can-i-import-data-from-another-question-and-answer-script
On the other hand, my code is:
from django.core.management.base import NoArgsCommand
from forum.models import *
from forum.actions import *
class Command(NoArgsCommand):
def handle_noargs(self, **options):
#retrieve the "asker" from the database
# "15" for Alumno Paco
user = User.objects.get(id=15)
#prepare question data
qdata = dict(
title = "Como funciona el TabViewController",
text = "No entiendo como funciona el TabViewController, alguna ayuda?",
tags = "iOS iPhone Xcode",
)
#save the question, everything will be handled internally,
#like creating the tags if they don't exist, etc
AskAction(user=user).save(data=qdata)
The command creates the question properly on my OSQA site, except that the question's body (text) is empty.
The curiosity is that when adding a question manually, directly from the site registered as a user, it is successfully created.
Reading about, I discover that is a Markdown's issue, but the solutions I have found are no longer suitable because they talk about editing a mdx_urlizer.py file that it does not exist on the current version of OSQA.
Thanks in advance!
Kikerox