from django.core.management.base import BaseCommand
from courses.models import (
    Course, Semester, Subject, CareerProspect, AdmissionStep, 
    DirectAdmission, Recruiter, WhyJoin, Testimonial
)
import random

class Command(BaseCommand):
    help = 'Create comprehensive content for Agriculture Sciences courses'

    def handle(self, *args, **options):
        self.stdout.write(self.style.SUCCESS('Starting to create Agriculture Sciences course content'))
        
        # Get all Agriculture Sciences courses
        agriculture_course_titles = [
            'B.Sc. Agriculture Hons.',
            'M.Sc. Agriculture (with Agronomy)',
            'M.Sc. Agriculture (with Horticulture)',
            'M.Sc. Agriculture (with Plant Pathology)',
            'B.Sc. Food Technology',
            'B.Sc. Nutrition & Dietetics'
        ]
        
        courses = Course.objects.filter(title__in=agriculture_course_titles)
        
        for course in courses:
            self.stdout.write(f'Processing {course.title}...')
            
            # Create semesters and subjects
            self._create_semesters_and_subjects(course)
            
            # Create career prospects
            self._create_career_prospects(course)
            
            # Create admission steps
            self._create_admission_steps(course)
            
            # Create direct admission info
            self._create_direct_admission(course)
            
            # Create recruiters
            self._create_recruiters(course)
            
            # Create why join points
            self._create_why_join(course)
            
            # Create testimonials
            self._create_testimonials(course)
            
            self.stdout.write(self.style.SUCCESS(f'Completed content for {course.title}'))
        
        self.stdout.write(self.style.SUCCESS('Successfully created content for all Agriculture Sciences courses!'))
    
    def _create_semesters_and_subjects(self, course):
        """Create semester structure and subjects for the course"""
        
        # Define semester count based on course duration
        if 'M.Sc.' in course.title:
            semester_count = 4
        elif 'B.Sc. Agriculture' in course.title:
            semester_count = 8
        else:  # Other B.Sc. courses
            semester_count = 6
        
        # Create semesters
        for sem_num in range(1, semester_count + 1):
            semester, created = Semester.objects.get_or_create(
                course=course,
                number=sem_num,
                defaults={'name': f'Semester {sem_num}'}
            )
            
            # Create subjects for each semester
            subjects = self._get_subjects_for_semester(course, sem_num)
            for subject_data in subjects:
                Subject.objects.get_or_create(
                    semester=semester,
                    name=subject_data['name'],
                    defaults={
                        'code': subject_data['code'],
                        'credits': subject_data['credits'],
                        'description': subject_data['description']
                    }
                )
    
    def _get_subjects_for_semester(self, course, semester_num):
        """Get subjects for a specific semester based on course type"""
        
        if course.title == 'B.Sc. Agriculture Hons.':
            subjects_by_semester = {
                1: [
                    {'name': 'Introduction to Agriculture', 'code': 'AGR101', 'credits': 3, 'description': 'Basic concepts and principles of agriculture'},
                    {'name': 'Agricultural Botany', 'code': 'AGR102', 'credits': 4, 'description': 'Plant morphology, anatomy, and physiology'},
                    {'name': 'Agricultural Chemistry', 'code': 'AGR103', 'credits': 4, 'description': 'Chemical principles applied to agriculture'},
                    {'name': 'Mathematics and Statistics', 'code': 'AGR104', 'credits': 3, 'description': 'Mathematical and statistical methods'},
                    {'name': 'English and Communication', 'code': 'AGR105', 'credits': 2, 'description': 'Communication skills for agriculture'}
                ],
                2: [
                    {'name': 'Soil Science', 'code': 'AGR201', 'credits': 4, 'description': 'Soil formation, properties, and management'},
                    {'name': 'Agricultural Meteorology', 'code': 'AGR202', 'credits': 3, 'description': 'Weather and climate in agriculture'},
                    {'name': 'Plant Breeding', 'code': 'AGR203', 'credits': 4, 'description': 'Principles and methods of plant breeding'},
                    {'name': 'Agricultural Microbiology', 'code': 'AGR204', 'credits': 3, 'description': 'Microorganisms in agriculture'},
                    {'name': 'Agricultural Economics', 'code': 'AGR205', 'credits': 3, 'description': 'Economic principles in agriculture'}
                ],
                3: [
                    {'name': 'Crop Production', 'code': 'AGR301', 'credits': 4, 'description': 'Principles and practices of crop production'},
                    {'name': 'Horticulture', 'code': 'AGR302', 'credits': 4, 'description': 'Fruit and vegetable production'},
                    {'name': 'Plant Pathology', 'code': 'AGR303', 'credits': 3, 'description': 'Plant diseases and their management'},
                    {'name': 'Entomology', 'code': 'AGR304', 'credits': 3, 'description': 'Insect pests and their control'},
                    {'name': 'Agricultural Engineering', 'code': 'AGR305', 'credits': 3, 'description': 'Farm machinery and structures'}
                ],
                4: [
                    {'name': 'Agronomy', 'code': 'AGR401', 'credits': 4, 'description': 'Field crop production and management'},
                    {'name': 'Animal Husbandry', 'code': 'AGR402', 'credits': 4, 'description': 'Livestock production and management'},
                    {'name': 'Food Technology', 'code': 'AGR403', 'credits': 3, 'description': 'Food processing and preservation'},
                    {'name': 'Agricultural Marketing', 'code': 'AGR404', 'credits': 3, 'description': 'Marketing of agricultural products'},
                    {'name': 'Farm Management', 'code': 'AGR405', 'credits': 3, 'description': 'Farm planning and management'}
                ]
            }
            # Add more semesters for 8-semester program
            for i in range(5, 9):
                subjects_by_semester[i] = [
                    {'name': f'Advanced Crop Science {i}', 'code': f'AGR{i}01', 'credits': 4, 'description': 'Advanced concepts in crop science'},
                    {'name': f'Specialized Agriculture {i}', 'code': f'AGR{i}02', 'credits': 4, 'description': 'Specialized agricultural practices'},
                    {'name': f'Research Methods {i}', 'code': f'AGR{i}03', 'credits': 3, 'description': 'Agricultural research methodology'},
                    {'name': f'Field Work {i}', 'code': f'AGR{i}04', 'credits': 3, 'description': 'Practical field experience'},
                    {'name': f'Project Work {i}' if i < 8 else 'Final Project', 'code': f'AGR{i}05', 'credits': 4, 'description': 'Research project work'}
                ]
                
        elif course.title == 'B.Sc. Food Technology':
            subjects_by_semester = {
                1: [
                    {'name': 'Food Chemistry', 'code': 'FT101', 'credits': 4, 'description': 'Chemical composition and properties of food'},
                    {'name': 'Food Microbiology', 'code': 'FT102', 'credits': 4, 'description': 'Microorganisms in food systems'},
                    {'name': 'Mathematics for Food Technology', 'code': 'FT103', 'credits': 3, 'description': 'Mathematical applications in food science'},
                    {'name': 'Physics for Food Technology', 'code': 'FT104', 'credits': 3, 'description': 'Physical principles in food processing'},
                    {'name': 'Communication Skills', 'code': 'FT105', 'credits': 2, 'description': 'Technical communication skills'}
                ],
                2: [
                    {'name': 'Food Processing', 'code': 'FT201', 'credits': 4, 'description': 'Principles and methods of food processing'},
                    {'name': 'Food Preservation', 'code': 'FT202', 'credits': 4, 'description': 'Food preservation techniques'},
                    {'name': 'Nutrition and Dietetics', 'code': 'FT203', 'credits': 3, 'description': 'Nutritional aspects of food'},
                    {'name': 'Food Packaging', 'code': 'FT204', 'credits': 3, 'description': 'Food packaging materials and methods'},
                    {'name': 'Statistics for Food Science', 'code': 'FT205', 'credits': 3, 'description': 'Statistical analysis in food science'}
                ]
            }
            # Add more semesters for 6-semester program
            for i in range(3, 7):
                subjects_by_semester[i] = [
                    {'name': f'Advanced Food Technology {i}', 'code': f'FT{i}01', 'credits': 4, 'description': 'Advanced food technology concepts'},
                    {'name': f'Food Quality Control {i}', 'code': f'FT{i}02', 'credits': 4, 'description': 'Quality control in food industry'},
                    {'name': f'Food Safety {i}', 'code': f'FT{i}03', 'credits': 3, 'description': 'Food safety and regulations'},
                    {'name': f'Industry Training {i}', 'code': f'FT{i}04', 'credits': 3, 'description': 'Industrial training and exposure'},
                    {'name': f'Project Work {i}' if i < 6 else 'Final Project', 'code': f'FT{i}05', 'credits': 4, 'description': 'Research and development project'}
                ]
                
        elif course.title == 'B.Sc. Nutrition & Dietetics':
            subjects_by_semester = {
                1: [
                    {'name': 'Human Physiology', 'code': 'ND101', 'credits': 4, 'description': 'Human body systems and functions'},
                    {'name': 'Biochemistry', 'code': 'ND102', 'credits': 4, 'description': 'Chemical processes in living organisms'},
                    {'name': 'Food Science', 'code': 'ND103', 'credits': 3, 'description': 'Scientific study of food'},
                    {'name': 'Mathematics and Statistics', 'code': 'ND104', 'credits': 3, 'description': 'Mathematical and statistical methods'},
                    {'name': 'Communication Skills', 'code': 'ND105', 'credits': 2, 'description': 'Effective communication skills'}
                ],
                2: [
                    {'name': 'Nutrition Science', 'code': 'ND201', 'credits': 4, 'description': 'Principles of human nutrition'},
                    {'name': 'Dietetics', 'code': 'ND202', 'credits': 4, 'description': 'Diet planning and therapeutic nutrition'},
                    {'name': 'Food Composition', 'code': 'ND203', 'credits': 3, 'description': 'Nutritional composition of foods'},
                    {'name': 'Community Nutrition', 'code': 'ND204', 'credits': 3, 'description': 'Nutrition in community settings'},
                    {'name': 'Research Methodology', 'code': 'ND205', 'credits': 3, 'description': 'Research methods in nutrition'}
                ]
            }
            # Add more semesters for 6-semester program
            for i in range(3, 7):
                subjects_by_semester[i] = [
                    {'name': f'Clinical Nutrition {i}', 'code': f'ND{i}01', 'credits': 4, 'description': 'Clinical aspects of nutrition'},
                    {'name': f'Therapeutic Dietetics {i}', 'code': f'ND{i}02', 'credits': 4, 'description': 'Therapeutic diet planning'},
                    {'name': f'Nutrition Counseling {i}', 'code': f'ND{i}03', 'credits': 3, 'description': 'Counseling techniques in nutrition'},
                    {'name': f'Clinical Training {i}', 'code': f'ND{i}04', 'credits': 3, 'description': 'Practical clinical experience'},
                    {'name': f'Project Work {i}' if i < 6 else 'Final Project', 'code': f'ND{i}05', 'credits': 4, 'description': 'Research project in nutrition'}
                ]
                
        elif 'M.Sc.' in course.title:
            # Generic M.Sc. subjects with specialization focus
            subjects_by_semester = {
                1: [
                    {'name': 'Advanced Research Methods', 'code': 'MSC101', 'credits': 4, 'description': 'Advanced research methodology'},
                    {'name': 'Statistical Analysis', 'code': 'MSC102', 'credits': 4, 'description': 'Advanced statistical methods'},
                    {'name': 'Specialization Core 1', 'code': 'MSC103', 'credits': 4, 'description': 'Core concepts in specialization area'},
                    {'name': 'Literature Review', 'code': 'MSC104', 'credits': 3, 'description': 'Comprehensive literature review'},
                    {'name': 'Seminar 1', 'code': 'MSC105', 'credits': 2, 'description': 'Seminar presentations and discussions'}
                ],
                2: [
                    {'name': 'Specialization Core 2', 'code': 'MSC201', 'credits': 4, 'description': 'Advanced specialization concepts'},
                    {'name': 'Laboratory Techniques', 'code': 'MSC202', 'credits': 4, 'description': 'Advanced laboratory methods'},
                    {'name': 'Field Studies', 'code': 'MSC203', 'credits': 4, 'description': 'Field research and data collection'},
                    {'name': 'Elective Course', 'code': 'MSC204', 'credits': 3, 'description': 'Specialized elective subject'},
                    {'name': 'Seminar 2', 'code': 'MSC205', 'credits': 2, 'description': 'Research progress presentations'}
                ],
                3: [
                    {'name': 'Advanced Specialization', 'code': 'MSC301', 'credits': 4, 'description': 'Expert-level specialization knowledge'},
                    {'name': 'Research Project 1', 'code': 'MSC302', 'credits': 6, 'description': 'Independent research project'},
                    {'name': 'Data Analysis', 'code': 'MSC303', 'credits': 3, 'description': 'Advanced data analysis techniques'},
                    {'name': 'Scientific Writing', 'code': 'MSC304', 'credits': 2, 'description': 'Scientific writing and publication'},
                    {'name': 'Comprehensive Examination', 'code': 'MSC305', 'credits': 2, 'description': 'Comprehensive examination'}
                ],
                4: [
                    {'name': 'Thesis Research', 'code': 'MSC401', 'credits': 10, 'description': 'Master\'s thesis research'},
                    {'name': 'Thesis Writing', 'code': 'MSC402', 'credits': 4, 'description': 'Thesis preparation and writing'},
                    {'name': 'Thesis Defense', 'code': 'MSC403', 'credits': 3, 'description': 'Thesis defense and presentation'}
                ]
            }
        else:
            # Generic subjects for other courses
            subjects_by_semester = {
                1: [
                    {'name': 'Foundation Course 1', 'code': 'GEN101', 'credits': 4, 'description': 'Basic concepts and principles'},
                    {'name': 'Foundation Course 2', 'code': 'GEN102', 'credits': 4, 'description': 'Core subject fundamentals'},
                    {'name': 'Communication Skills', 'code': 'GEN103', 'credits': 3, 'description': 'Effective communication'},
                    {'name': 'Mathematics/Statistics', 'code': 'GEN104', 'credits': 3, 'description': 'Quantitative methods'},
                    {'name': 'Introduction to Computers', 'code': 'GEN105', 'credits': 3, 'description': 'Basic computer skills'}
                ]
            }
            # Add more semesters if needed
            for i in range(2, semester_num + 1):
                subjects_by_semester[i] = [
                    {'name': f'Advanced Course {i}A', 'code': f'GEN{i}01', 'credits': 4, 'description': 'Advanced specialized knowledge'},
                    {'name': f'Advanced Course {i}B', 'code': f'GEN{i}02', 'credits': 4, 'description': 'Applied advanced concepts'},
                    {'name': f'Practical Course {i}', 'code': f'GEN{i}03', 'credits': 3, 'description': 'Hands-on practical experience'},
                    {'name': f'Elective {i}', 'code': f'GEN{i}04', 'credits': 3, 'description': 'Specialized elective'},
                    {'name': f'Project Work {i}', 'code': f'GEN{i}05', 'credits': 3, 'description': 'Applied project work'}
                ]
        
        return subjects_by_semester.get(semester_num, [])
    
    def _create_career_prospects(self, course):
        """Create career prospects for the course"""
        
        career_prospects_data = {
            'B.Sc. Agriculture Hons.': [
                {'title': 'Agricultural Officer', 'description': 'Government and private sector agricultural advisory roles', 'salary_range': '₹4-12 LPA'},
                {'title': 'Farm Manager', 'description': 'Managing large-scale farming operations and agribusiness', 'salary_range': '₹5-15 LPA'},
                {'title': 'Agricultural Researcher', 'description': 'Research in agricultural institutes and universities', 'salary_range': '₹6-18 LPA'},
                {'title': 'Agribusiness Manager', 'description': 'Managing agricultural supply chain and marketing', 'salary_range': '₹8-20 LPA'},
                {'title': 'Agricultural Consultant', 'description': 'Providing expert advice to farmers and organizations', 'salary_range': '₹6-16 LPA'},
                {'title': 'Extension Officer', 'description': 'Agricultural extension and farmer education', 'salary_range': '₹4-10 LPA'}
            ],
            'B.Sc. Food Technology': [
                {'title': 'Food Technologist', 'description': 'Product development and quality control in food industry', 'salary_range': '₹4-12 LPA'},
                {'title': 'Quality Control Manager', 'description': 'Ensuring food safety and quality standards', 'salary_range': '₹6-16 LPA'},
                {'title': 'Food Safety Officer', 'description': 'Regulatory compliance and food safety management', 'salary_range': '₹5-14 LPA'},
                {'title': 'R&D Specialist', 'description': 'Research and development in food companies', 'salary_range': '₹7-18 LPA'},
                {'title': 'Production Manager', 'description': 'Managing food processing operations', 'salary_range': '₹8-20 LPA'},
                {'title': 'Food Consultant', 'description': 'Technical consulting for food businesses', 'salary_range': '₹6-15 LPA'}
            ],
            'B.Sc. Nutrition & Dietetics': [
                {'title': 'Clinical Dietitian', 'description': 'Nutrition therapy in hospitals and clinics', 'salary_range': '₹3-10 LPA'},
                {'title': 'Sports Nutritionist', 'description': 'Nutrition planning for athletes and sports teams', 'salary_range': '₹4-12 LPA'},
                {'title': 'Community Nutritionist', 'description': 'Public health nutrition programs', 'salary_range': '₹3-9 LPA'},
                {'title': 'Nutrition Consultant', 'description': 'Private practice nutrition counseling', 'salary_range': '₹5-15 LPA'},
                {'title': 'Food Service Manager', 'description': 'Managing institutional food services', 'salary_range': '₹4-12 LPA'},
                {'title': 'Wellness Coach', 'description': 'Health and wellness coaching services', 'salary_range': '₹4-10 LPA'}
            ]
        }
        
        # Use default prospects if course not in specific data or for M.Sc. courses
        if course.title in career_prospects_data:
            prospects = career_prospects_data[course.title]
        elif 'M.Sc.' in course.title:
            if 'Agronomy' in course.title:
                prospects = [
                    {'title': 'Senior Agronomist', 'description': 'Advanced crop management and research', 'salary_range': '₹8-25 LPA'},
                    {'title': 'Research Scientist', 'description': 'Agricultural research in institutes and companies', 'salary_range': '₹10-30 LPA'},
                    {'title': 'Agricultural Consultant', 'description': 'Expert consulting in crop production', 'salary_range': '₹12-35 LPA'},
                    {'title': 'Professor/Lecturer', 'description': 'Teaching in agricultural colleges', 'salary_range': '₹8-25 LPA'},
                    {'title': 'Product Manager', 'description': 'Agricultural product development and marketing', 'salary_range': '₹15-40 LPA'}
                ]
            elif 'Horticulture' in course.title:
                prospects = [
                    {'title': 'Horticulture Specialist', 'description': 'Expert in fruit and vegetable production', 'salary_range': '₹8-22 LPA'},
                    {'title': 'Landscape Designer', 'description': 'Garden and landscape planning', 'salary_range': '₹6-18 LPA'},
                    {'title': 'Greenhouse Manager', 'description': 'Managing protected cultivation systems', 'salary_range': '₹10-25 LPA'},
                    {'title': 'Post-Harvest Specialist', 'description': 'Post-harvest technology and management', 'salary_range': '₹8-20 LPA'},
                    {'title': 'Agricultural Entrepreneur', 'description': 'Starting horticultural enterprises', 'salary_range': 'Variable'}
                ]
            else:  # Plant Pathology
                prospects = [
                    {'title': 'Plant Pathologist', 'description': 'Disease diagnosis and management expert', 'salary_range': '₹8-24 LPA'},
                    {'title': 'Research Scientist', 'description': 'Plant disease research and development', 'salary_range': '₹10-28 LPA'},
                    {'title': 'Regulatory Affairs Specialist', 'description': 'Pesticide and disease management regulations', 'salary_range': '₹12-30 LPA'},
                    {'title': 'Technical Manager', 'description': 'Technical support in agrochemical companies', 'salary_range': '₹15-35 LPA'},
                    {'title': 'University Professor', 'description': 'Teaching and research in universities', 'salary_range': '₹10-30 LPA'}
                ]
        else:
            prospects = [
                {'title': 'Industry Professional', 'description': 'Specialized roles in relevant industry', 'salary_range': '₹4-15 LPA'},
                {'title': 'Manager', 'description': 'Management positions in organizations', 'salary_range': '₹6-20 LPA'},
                {'title': 'Consultant', 'description': 'Expert consulting services', 'salary_range': '₹8-25 LPA'},
                {'title': 'Entrepreneur', 'description': 'Starting own ventures', 'salary_range': 'Variable'},
                {'title': 'Senior Specialist', 'description': 'Expert roles in specialization', 'salary_range': '₹10-30 LPA'}
            ]
        
        for prospect_data in prospects:
            CareerProspect.objects.get_or_create(
                course=course,
                title=prospect_data['title'],
                defaults={
                    'description': prospect_data['description'],
                    'salary_range': prospect_data['salary_range']
                }
            )
    
    def _create_admission_steps(self, course):
        """Create admission steps for the course"""
        
        steps = [
            {'step': 1, 'title': 'Check Eligibility', 'description': 'Verify academic qualifications and eligibility criteria'},
            {'step': 2, 'title': 'Online Application', 'description': 'Fill and submit the online application form'},
            {'step': 3, 'title': 'Document Submission', 'description': 'Upload required documents and certificates'},
            {'step': 4, 'title': 'Application Fee', 'description': 'Pay the application processing fee'},
            {'step': 5, 'title': 'Entrance Test', 'description': 'Appear for entrance examination or interview'},
            {'step': 6, 'title': 'Merit List', 'description': 'Check merit list and admission status'},
            {'step': 7, 'title': 'Admission Confirmation', 'description': 'Confirm admission by paying fees'},
            {'step': 8, 'title': 'Document Verification', 'description': 'Physical verification of original documents'},
            {'step': 9, 'title': 'Orientation', 'description': 'Attend orientation and induction program'}
        ]
        
        for step_data in steps:
            AdmissionStep.objects.get_or_create(
                course=course,
                order=step_data['step'],
                defaults={
                    'title': step_data['title'],
                    'description': step_data['description']
                }
            )
    
    def _create_direct_admission(self, course):
        """Create direct admission information"""
        
        DirectAdmission.objects.get_or_create(
            course=course,
            defaults={
                'is_available': True,
                'description': 'Direct admission process based on academic performance and eligibility criteria. Contact admissions office for direct admission guidance.'
            }
        )
    
    def _create_recruiters(self, course):
        """Create recruiters for the course"""
        
        # Agriculture and food industry recruiters
        agriculture_recruiters = [
            'ITC Limited', 'Nestle India', 'Hindustan Unilever', 'Britannia Industries', 'Parle Products',
            'Amul (GCMMF)', 'Mother Dairy', 'PepsiCo India', 'Coca-Cola India', 'Dabur India',
            'Mahindra Agribusiness', 'UPL Limited', 'Bayer CropScience', 'Syngenta India', 'BASF India',
            'Tata Chemicals', 'Coromandel International', 'Godrej Agrovet', 'Rallis India', 'Dhanuka Agritech',
            'IFFCO', 'Krishak Bharati Cooperative', 'National Seeds Corporation', 'State Farm Corporation',
            'Agricultural Development Bank', 'Zydus Wellness', 'Marico Limited', 'Emami Agrotech'
        ]
        
        # Select random recruiters
        selected_recruiters = random.sample(agriculture_recruiters, min(15, len(agriculture_recruiters)))
        
        for recruiter_name in selected_recruiters:
            Recruiter.objects.get_or_create(
                course=course,
                name=recruiter_name,
                defaults={}
            )
    
    def _create_why_join(self, course):
        """Create why join points for the course"""
        
        common_points = [
            {'title': 'Expert Faculty', 'description': 'Learn from experienced faculty with industry and research background'},
            {'title': 'Modern Laboratories', 'description': 'State-of-the-art laboratories and research facilities'},
            {'title': 'Field Training', 'description': 'Extensive hands-on experience in farms and research stations'},
            {'title': 'Industry Partnerships', 'description': 'Strong connections with agricultural and food industries'},
            {'title': 'Research Opportunities', 'description': 'Opportunities to participate in cutting-edge research projects'},
            {'title': 'Career Support', 'description': 'Dedicated placement cell with excellent industry connections'},
            {'title': 'Practical Learning', 'description': 'Emphasis on practical training and real-world applications'},
            {'title': 'Innovation Focus', 'description': 'Encouraging innovation and entrepreneurship in agriculture'}
        ]
        
        for point_data in common_points:
            WhyJoin.objects.get_or_create(
                course=course,
                title=point_data['title'],
                defaults={
                    'description': point_data['description']
                }
            )
    
    def _create_testimonials(self, course):
        """Create testimonials for the course"""
        
        testimonials = [
            {
                'name': 'Ravi Sharma',
                'position': 'Agricultural Officer',
                'company': 'Department of Agriculture',
                'content': f'The {course.title} program provided me with comprehensive knowledge and practical skills. The field training and research opportunities helped me build a strong foundation in agriculture.'
            },
            {
                'name': 'Priya Patel',
                'position': 'Food Technologist',
                'company': 'ITC Limited',
                'content': f'Excellent faculty and modern facilities. The {course.title} program prepared me well for the challenges in the food industry. Highly recommend this program.'
            },
            {
                'name': 'Amit Kumar',
                'position': 'Research Scientist',
                'company': 'ICAR Research Institute',
                'content': f'The research-oriented approach of the {course.title} program helped me develop critical thinking and problem-solving skills. The practical training was invaluable.'
            },
            {
                'name': 'Sneha Singh',
                'position': 'Nutritionist',
                'company': 'Apollo Hospitals',
                'content': f'The {course.title} program provided excellent theoretical knowledge combined with practical experience. The clinical training prepared me for my career in healthcare.'
            }
        ]
        
        for testimonial_data in testimonials:
            Testimonial.objects.get_or_create(
                course=course,
                name=testimonial_data['name'],
                defaults={
                    'position': testimonial_data['position'],
                    'company': testimonial_data['company'],
                    'content': testimonial_data['content']
                }
            )
