

def handle_noargs(self, **options):
    if ('orm' in options):
        orm = options['orm']
        try:
            Category = orm[FP_NODE_MODEL]
        except KeyError:
            CommandError("could not find model 'Category'. Aborting command.")
        try:
            FancyPage = orm[FP_PAGE_MODEL]
        except KeyError:
            CommandError("could not find model 'FancyPage'. Aborting command.")
    else:
        Category = get_node_model()
        FancyPage = get_page_model()
    for category in Category.objects.filter(page=None):
        FancyPage.objects.create(node=category)

dataset/ETHPy150Open tangentlabs/django-fancypages/fancypages/management/commands/fp_create_pages_for_nodes.py Command.handle_noargs/original