Processes the converted data into the yacms database correctly.

        Attributes:
            yacms_user: the user to put this data in against
            date_format: the format the dates are in for posts and comments

def handle(self, *args, **options):
        """
        Processes the converted data into the yacms database correctly.

        Attributes:
            yacms_user: the user to put this data in against
            date_format: the format the dates are in for posts and comments
        """

        yacms_user = options.get("yacms_user")
        site = Site.objects.get_current()
        verbosity = int(options.get("verbosity", 1))
        prompt = options.get("interactive")

        # Validate the yacms user.
        if yacms_user is None:
            raise CommandError("No yacms user has been specified")
        try:
            yacms_user = User.objects.get(username=yacms_user)
        except User.DoesNotExist:
            raise CommandError("Invalid yacms user: %s" % yacms_user)

        # Run the subclassed ``handle_import`` and save posts, tags,
        # categories, and comments to the DB.
        self.handle_import(options)
        for post_data in self.posts:
            categories = post_data.pop("categories")
            tags = post_data.pop("tags")
            comments = post_data.pop("comments")
            old_url = post_data.pop("old_url")
            post_data = self.trunc(BlogPost, prompt, **post_data)
            initial = {
                "title": post_data.pop("title"),
                "user": yacms_user,
            }
            if post_data["publish_date"] is None:
                post_data["status"] = CONTENT_STATUS_DRAFT
            post, created = BlogPost.objects.get_or_create(**initial)
            for k, v in post_data.items():
                setattr(post, k, v)
            post.save()
            if created and verbosity >= 1:
                print("Imported post: %s" % post)
            for name in categories:
                cat = self.trunc(BlogCategory, prompt, title=name)
                if not cat["title"]:
                    continue
                cat, created = BlogCategory.objects.get_or_create(**cat)
                if created and verbosity >= 1:
                    print("Imported category: %s" % cat)
                post.categories.add(cat)
            for comment in comments:
                comment = self.trunc(ThreadedComment, prompt, **comment)
                comment["site"] = site
                post.comments.create(**comment)
                if verbosity >= 1:
                    print("Imported comment by: %s" % comment["user_name"])
            self.add_meta(post, tags, prompt, verbosity, old_url)

        # Create any pages imported (Wordpress can include pages)
        in_menus = []
        footer = [menu[0] for menu in settings.PAGE_MENU_TEMPLATES
                  if menu[-1] == "pages/menus/footer.html"]
        if options["in_navigation"]:
            in_menus = [menu[0] for menu in settings.PAGE_MENU_TEMPLATES]
            if footer and not options["in_footer"]:
                in_menus.remove(footer[0])
        elif footer and options["in_footer"]:
            in_menus = footer
        parents = []
        for page in self.pages:
            tags = page.pop("tags")
            old_url = page.pop("old_url")
            old_id = page.pop("old_id")
            old_parent_id = page.pop("old_parent_id")
            page = self.trunc(RichTextPage, prompt, **page)
            page["status"] = CONTENT_STATUS_PUBLISHED
            page["in_menus"] = in_menus
            page, created = RichTextPage.objects.get_or_create(**page)
            if created and verbosity >= 1:
                print("Imported page: %s" % page)
            self.add_meta(page, tags, prompt, verbosity, old_url)
            parents.append({
                'old_id': old_id,
                'old_parent_id': old_parent_id,
                'page': page,
            })

        for obj in parents:
            if obj['old_parent_id']:
                for parent in parents:
                    if parent['old_id'] == obj['old_parent_id']:
                        obj['page'].parent = parent['page']
                        obj['page'].save()
                        break