# Path: core/faker.py
# MODELS_MAP = { Model.__name__.lower(): Model for Model in MODELS }


from typing import List
from django.core.management.base import BaseCommand
from core.faker import MODELS_MAP




class Command(BaseCommand):
    """
    Get list of ids of a model from the database

    Usage:
        python manage.py list_ids.py --help
    """

    help = "Get list of ids of a model from the database."

    def add_arguments(self, parser) -> None:
        parser.add_argument('models',
                            nargs='+',
                            choices=tuple(MODELS_MAP),
                            help="Which model to generate")
        parser.add_argument('-l', '--limit',
                            type=int,
                            default=None,
                            help="Limit of ids to display")
        parser.add_argument('-o', '--offset',
                            type=int,
                            default=None,
                            help="Offset of ids to display")

    def handle_model(self, model: str, offset: int=None, limit: int=None) -> str:

# Path: core/faker.py
# MODELS_MAP = { Model.__name__.lower(): Model for Model in MODELS }


# Path: core/management/commands/list_ids.py
from typing import List
from django.core.management.base import BaseCommand
from core.faker import MODELS_MAP





class Command(BaseCommand):
    """
    Get list of ids of a model from the database

    Usage:
        python manage.py list_ids.py --help
    """

    help = "Get list of ids of a model from the database."

    def add_arguments(self, parser) -> None:
        parser.add_argument('models',
                            nargs='+',
                            choices=tuple(MODELS_MAP),
                            help="Which model to generate")
        parser.add_argument('-l', '--limit',
                            type=int,
                            default=None,
                            help="Limit of ids to display")
        parser.add_argument('-o', '--offset',
                            type=int,
                            default=None,
                            help="Offset of ids to display")

    def handle_model(self, model: str, offset: int=None, limit: int=None) -> str:

        Model = MODELS_MAP[model]