diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-12-28 18:18:09 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-12-28 18:18:09 -0300 |
commit | 75594a027f7380c457c3e56a8fc5ccc5c9de99ba (patch) | |
tree | baee5c4b50be48d4841861b66a4be0198cc37855 | |
parent | 47f1142c71cd1d5c3963df7cd392efa25ade79a9 (diff) | |
download | askbot-75594a027f7380c457c3e56a8fc5ccc5c9de99ba.tar.gz askbot-75594a027f7380c457c3e56a8fc5ccc5c9de99ba.tar.bz2 askbot-75594a027f7380c457c3e56a8fc5ccc5c9de99ba.zip |
updated the documentation
-rw-r--r-- | askbot/doc/source/management-commands.rst | 39 | ||||
-rw-r--r-- | askbot/management/commands/dump_forum.py | 36 | ||||
-rw-r--r-- | askbot/management/commands/load_forum.py | 16 |
3 files changed, 26 insertions, 65 deletions
diff --git a/askbot/doc/source/management-commands.rst b/askbot/doc/source/management-commands.rst index a56aa47a..1f5c3fa1 100644 --- a/askbot/doc/source/management-commands.rst +++ b/askbot/doc/source/management-commands.rst @@ -46,9 +46,6 @@ The bulk of the management commands fall into this group and will probably be th | `merge_users <from_id> | Merges user accounts and all related data from one user | | <to_id>` | to another, the "from user" account is deleted. | +---------------------------------+-------------------------------------------------------------+ -| `dump_forum [--dump-name | Save forum contents into a file. `--dump-name` parameter is | -| some_name]` | optional | -+---------------------------------+-------------------------------------------------------------+ | `get_tag_stats [-u|-t] [-e]` | Print tag subscription statistics, per tag (option -t) | | | or per user (option -u), if option -e is given, empty | | | records will be shown too (longer versions of the options | @@ -56,16 +53,6 @@ The bulk of the management commands fall into this group and will probably be th | | --per-user-tag-subscription-counts for -u, and --print-empty| | | for -e). | +---------------------------------+-------------------------------------------------------------+ -| `load_forum <file_name>` | Load forum data from a file saved by the `dump_forum` | -| | command | -+---------------------------------+-------------------------------------------------------------+ -| `load_stackexchange <file.zip>` | Load SackExchange dump into Askbot. It is best to run this | -| | command on empty database. Also - before running, make sure | -| | that `askbot.importers.stackexchange` is in the list of | -| | installed apps within your settings.py file (it might also | -| | be necessary to run `syncdb` command to initiate the | -| | SE importer tables). | -+---------------------------------+-------------------------------------------------------------+ | `rename_tags --from <from_tags> | Rename, merge or split tags. User ID is the id of the user | | --to <to_tags> --user-id | who will be assigned as the performer of the retag action. | | <user_id>` | If more than is in the `--from` or the `--to` parameters | @@ -101,6 +88,32 @@ The bulk of the management commands fall into this group and will probably be th | | foreign key to that object is still present. | +---------------------------------+-------------------------------------------------------------+ +.. _data-import-commands: + +Data import commands +==================== + +These commands import or add data to the Askbot forum. + ++---------------------------------+-------------------------------------------------------------+ +| command | purpose | ++=================================+=============================================================+ +| `load_stackexchange <file.zip>` | Load SackExchange dump into Askbot. It is best to run this | +| | command on empty database. Also - before running, make sure | +| | that `askbot.importers.stackexchange` is in the list of | +| | installed apps within your settings.py file (it might also | +| | be necessary to run `syncdb` command to initiate the | +| | SE importer tables). | ++---------------------------------+-------------------------------------------------------------+ +| `askbot_add_xml_content | Add xml Askbot data dumped with the Django command | +| <file.xml>` | `dumpdata` | ++---------------------------------+-------------------------------------------------------------+ +| `askbot_add_osqa_content | Add xml OSQA data dumped with the Django command | +| <file.xml>` | `export_osqa` | ++---------------------------------+-------------------------------------------------------------+ +| `askbot_import_jive <file.xml> | Import xml Jive data | ++---------------------------------+-------------------------------------------------------------+ + .. _email-related-commands: Email-related commands diff --git a/askbot/management/commands/dump_forum.py b/askbot/management/commands/dump_forum.py deleted file mode 100644 index 0bead908..00000000 --- a/askbot/management/commands/dump_forum.py +++ /dev/null @@ -1,36 +0,0 @@ -import sys -import optparse -from django.core import management -from django.core.management.base import BaseCommand -from askbot.utils import console - -class Command(BaseCommand): - help = """Dumps askbot forum data into the file for the later use with "load_forum". -The extension ".json" will be added automatically.""" - - option_list = BaseCommand.option_list + ( - optparse.make_option('--dump-name', - type = 'str', - dest = 'dump_file' - ), - ) - def handle(self, *args, **options): - dump_file = console.open_new_file( - 'Please enter file name (no extension): ', - hint = options.get('dump_file', None), - extension = '.json' - ) - print ("Saving file %s ..." % dump_file.name).encode('utf-8') - stdout_orig = sys.stdout - try: - sys.stdout = dump_file - management.call_command( - 'dumpdata', - #exclude = ('contenttypes',), - indent = 4 - ) - sys.stdout = stdout_orig - print "Done." - except KeyboardInterrupt: - sys.stdout = stdout_orig - print "\nCanceled." diff --git a/askbot/management/commands/load_forum.py b/askbot/management/commands/load_forum.py deleted file mode 100644 index 65ac410f..00000000 --- a/askbot/management/commands/load_forum.py +++ /dev/null @@ -1,16 +0,0 @@ -from django.core import management -from django.db.models import signals -from django.contrib.contenttypes.models import ContentType -from django.core.management.base import BaseCommand -from askbot import models - -class Command(BaseCommand): - args = '<data file>' - help = 'Loads askbot forum data from the dump file obtained with command "dump_forum"' - def handle(self, *args, **options): - #need to remove badge data b/c they are aslo in the dump - models.BadgeData.objects.all().delete() - ContentType.objects.all().delete() - #turn off the post_save signal so than Activity can be copied - signals.post_save.receivers = [] - management.call_command('loaddata', args[0]) |