# Path: borme/models.py
# def get_borme_urls_from_slug(slug):
#     try:
#         entity = Person.objects.get(slug=slug)
#     except Person.DoesNotExist:
#         try:
#             entity = Company.objects.get(slug=slug)
#         except Company.DoesNotExist:
#             return []
# 
#     return [b["url"] for b in entity.in_bormes]


from django.core.management.base import BaseCommand
from borme.models import get_borme_urls_from_slug


class Command(BaseCommand):
    help = 'Show the sources where the information about some entity was retrieved'

    def add_arguments(self, parser):
        parser.add_argument("slug", type=str, help="person or company slug")

    def handle(self, *args, **options):


# Path: borme/models.py
# def get_borme_urls_from_slug(slug):
#     try:
#         entity = Person.objects.get(slug=slug)
#     except Person.DoesNotExist:
#         try:
#             entity = Company.objects.get(slug=slug)
#         except Company.DoesNotExist:
#             return []
# 
#     return [b["url"] for b in entity.in_bormes]


# Path: borme/management/commands/bormesources.py
from django.core.management.base import BaseCommand
from borme.models import get_borme_urls_from_slug



class Command(BaseCommand):
    help = 'Show the sources where the information about some entity was retrieved'

    def add_arguments(self, parser):
        parser.add_argument("slug", type=str, help="person or company slug")

    def handle(self, *args, **options):


        urls = get_borme_urls_from_slug(options["slug"])