Package zinnia :: Package management :: Package commands :: Module wp2zinnia :: Class Command
[hide private]

Class Command

source code


Command object for importing a WordPress blog into Zinnia via a WordPress eXtended RSS (WXR) file.

Instance Methods [hide private]
 
__init__(self)
Init the Command and add custom styles
source code
 
write_out(self, message, verbosity_level=1)
Convenient method for outputing
source code
 
handle_label(self, wxr_file, **options)
Perform the command's actions for ``label``, which will be the string as given on the command line.
source code
 
import_authors(self, tree)
Retrieve all the authors used in posts and convert it to new or existing user, and return the convertion
source code
 
migrate_author(self, author_name)
Handle actions for migrating the users
source code
 
import_categories(self, category_nodes)
Import all the categories from 'wp:category' nodes, because categories in 'item' nodes are not necessarily all the categories and returning it in a dict for database optimizations.
source code
 
import_tags(self, tag_nodes)
Import all the tags form 'wp:tag' nodes, because tags in 'item' nodes are not necessarily all the tags, then use only the nicename, because it's like a slug and the true tag name may be not valid for url usage.
source code
 
get_entry_tags(self, categories)
Return a list of entry's tags, by using the nicename for url compatibility
source code
 
get_entry_categories(self, category_nodes)
Return a list of entry's categories based of imported categories
source code
 
import_entry(self, title, content, item_node)
Importing an entry but some data are missing like the image, related entries, start_publication and end_publication.
source code
 
import_entries(self, items)
Loops over items and find entry to import, an entry need to have 'post_type' set to 'post' and have content.
source code
 
import_comments(self, entry, comment_nodes)
Loops over comments nodes and import then in django.contrib.comments
source code

Inherited from django.core.management.base.LabelCommand: handle

Inherited from django.core.management.base.BaseCommand: create_parser, execute, get_version, print_help, run_from_argv, usage, validate

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  help = 'Import a Wordpress blog into Zinnia.'
  label = 'WXR file'
  args = 'wordpress.xml'
  option_list = (<Option at 0x8ed1aec: -v/--verbosity>, <Option ...
  SITE = <Site: example.com>
  REVERSE_STATUS = {'auto-draft': 0, 'draft': 0, 'future': 2, 'i...

Inherited from django.core.management.base.BaseCommand: can_import_settings, output_transaction, requires_model_validation

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Init the Command and add custom styles

Overrides: object.__init__

handle_label(self, wxr_file, **options)

source code 

Perform the command's actions for ``label``, which will be the string as given on the command line.

Overrides: django.core.management.base.LabelCommand.handle_label
(inherited documentation)

import_entry(self, title, content, item_node)

source code 

Importing an entry but some data are missing like the image, related entries, start_publication and end_publication. start_publication and creation_date will use the same value, wich is always in Wordpress $post->post_date


Class Variable Details [hide private]

option_list

Value:
(<Option at 0x8ed1aec: -v/--verbosity>,
 <Option at 0x8ed1dcc: --settings>,
 <Option at 0x8ed1dec: --pythonpath>,
 <Option at 0x8ed1e4c: --traceback>,
 <Option at 0x98be16c: --noautoexcerpt>,
 <Option at 0x982d96c: --author>)

REVERSE_STATUS

Value:
{'auto-draft': 0,
 'draft': 0,
 'future': 2,
 'inherit': 0,
 'pending': 0,
 'private': 2,
 'publish': 2,
 'trash': 1}