# create_user_menus.py
from core.models import Category, UserMenu

def create_user_menus(data):
    for item in data['techClasses']:
        category, _ = Category.objects.get_or_create(name=item['name'])
        for tech in item['technologies']:
            UserMenu.objects.get_or_create(
                title=tech['title'],
                defaults={
                    'description': tech['text'],
                    'category': category,
                    'icon' : tech['icon'],
                    'url' : tech['url'],
                    'url_text' : 'Lauch'
                }
            )


