|
After importing data from a StackExchange site, I am seeing python errors when trying to edit some nodes. Specifically, post.active_revision is None in the __init__ method of RevisionForm in qanda.py. I looked in the database and found that there is no row in forum_noderevision with node_id equal to that of the row in forum_node. Should there be? I have not updated my osqa code since last fall and am in no state to do this right now, so perhaps this is a problem that has already been solved. |
|
There's a few solutions to fix your database, the best one is probably to enter the django shell:
And then try something like this:
Obviously backup your database before doing this. Alternatively, you can save that code into a .py file and import it through the django shell. You da man Hernâni! The code above worked perfectly. Thanks
(21 Mar '11, 10:12)
gperrow
|
|
@gperrow, I believe this problem was addressed in an OSQA update some time ago. You can definitely now edit revisions of questions that were imported from SE. It works in the beta2 release that is currently available. OK, but since I have already done the import, is there any way to fix the existing database?
(14 Mar '11, 11:36)
gperrow
I don't know of any silver bullet that will align your db schema with the current codebase and fill in the gaps in your existing data. DZone's team could probably help with this, but we should take that offline if you'd like to discuss it.
(14 Mar '11, 14:27)
rickross ♦♦
|
Yeah, we suck for not responding immediately on the weekend.