o
    j)^hmC                     @   s   d dl Z d dlmZ d dlmZ d dlmZ d dlZd dlm	Z	 d dl
mZ d dlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ d dlmZ G d	d
 d
eZdS )    N)BaseCommand)ContentFile)slugify)BytesIO)settings)CourseCourseEligibility	CourseFee	FeeDetail	HostelFeeSemesterSubjectCareerProspectAdmissionStepDirectAdmission	RecruiterWhyJoinCourseHighlightCourseImageTestimonial)Collegec                   @   s8   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d ZdS )CommandzLSeeds the database with courses for Roorkee College of Agricultural Sciencesc                    s   j  jd ztjjdd} j  jd|j  W n tjy6    j  j	d Y d S w t
jt
jtjddd  fd	d
}ddddddddddddddddddddddddddd d!d"dd#d$d%d!d&dg}|D ]~}t|d' }g d(}|t|d' t|  }	d)|	 }
||
d*| }tjj||d' |d+ |d, |d- |d. dd/\}}|r||_|  |rш j  jd0|j  n j  jd1|j   ||  ||  |  || qxd S )2Nz.Starting to seed Agricultural Sciences coursesz'roorkee-college-of-agriculture-sciences)slugzFound college: zJAgricultural Sciences college not found. Please ensure the college exists.zcourses/bannersT)exist_okc              
      s   z)t | }|jdkr| d}t|j|d}|W S  j jd|   W d S  t	yK } z j j
dt|  W Y d }~d S d }~ww )N   z.jpg)namezFailed to download image from zError downloading image: )requestsgetstatus_coder   contentstdoutwritestyleWARNING	ExceptionERRORstr)url
field_nameresponsefilenameimage_contenteself I/var/www/apihucms/courses/management/commands/seed_agriculture_courses.pysave_image_from_url"   s   


z+Command.handle.<locals>.save_image_from_urlzB.Sc. Agriculture Hons.zComprehensive undergraduate program in agricultural sciences with honors, covering crop production, soil science, and sustainable farming practices.a  The B.Sc. Agriculture Honours program is designed to provide comprehensive knowledge and practical skills in agricultural sciences. Students will learn about crop production, soil management, plant breeding, agricultural economics, and sustainable farming practices. The program combines theoretical knowledge with extensive field work, laboratory sessions, and practical training at agricultural farms. Graduates will be equipped to address modern agricultural challenges and contribute to food security and sustainable development.z4 Years (8 Semesters)zAgricultural Sciences)titleshort_descriptionoverviewdurationcategoryz!M.Sc. Agriculture (with Agronomy)zAdvanced postgraduate program specializing in agronomy, focusing on crop science, soil management, and agricultural production systems.a  The M.Sc. Agriculture with Agronomy specialization is an advanced postgraduate program that focuses on the science and practice of crop production and soil management. Students will study advanced topics in crop physiology, soil fertility, weed management, precision agriculture, and sustainable farming systems. The program includes extensive research work, field experiments, and thesis preparation. Graduates will be prepared for leadership roles in agricultural research, extension services, and agribusiness management.z2 Years (4 Semesters)z Agricultural Sciences - Agronomyz%M.Sc. Agriculture (with Horticulture)zSpecialized postgraduate program in horticulture, covering fruit and vegetable production, ornamental plants, and horticultural technology.a/  The M.Sc. Agriculture with Horticulture specialization provides advanced knowledge in the cultivation of fruits, vegetables, flowers, and ornamental plants. Students will learn about plant breeding, post-harvest technology, greenhouse management, landscape design, and commercial horticulture. The program emphasizes practical training in modern horticultural techniques, biotechnology applications, and sustainable production methods. Graduates will be equipped for careers in horticultural research, commercial production, and agricultural entrepreneurship.z$Agricultural Sciences - Horticulturez(M.Sc. Agriculture (with Plant Pathology)zAdvanced program focusing on plant diseases, their diagnosis, management, and prevention in agricultural and horticultural crops.aK  The M.Sc. Agriculture with Plant Pathology specialization is designed to train students in the identification, diagnosis, and management of plant diseases. The program covers fungal, bacterial, viral, and nematode diseases affecting crops, as well as integrated pest management strategies. Students will gain expertise in disease surveillance, diagnostic techniques, biological control methods, and the development of disease-resistant varieties. The curriculum includes extensive laboratory work, field studies, and research projects focused on sustainable disease management practices.z'Agricultural Sciences - Plant PathologyzB.Sc. Food TechnologyzUndergraduate program in food science and technology, covering food processing, preservation, quality control, and food safety.ai  The B.Sc. Food Technology program provides comprehensive training in food science, processing, and technology. Students will learn about food chemistry, microbiology, nutrition, processing techniques, packaging, and quality assurance. The curriculum covers food preservation methods, product development, food safety regulations, and industrial food production. Practical training includes laboratory work, pilot plant operations, and internships in food industries. Graduates will be prepared for careers in food processing companies, quality control laboratories, research institutions, and food service industries.z3 Years (6 Semesters)Food TechnologyzB.Sc. Nutrition & DieteticszUndergraduate program focusing on human nutrition, dietetics, and nutritional health, preparing students for careers in healthcare and nutrition counseling.a  The B.Sc. Nutrition & Dietetics program is designed to provide comprehensive knowledge of human nutrition, food science, and dietetic practice. Students will study biochemistry, physiology, food composition, nutritional assessment, and therapeutic nutrition. The program covers topics such as community nutrition, sports nutrition, clinical dietetics, and nutrition education. Practical training includes clinical rotations, community health programs, and nutrition counseling sessions. Graduates will be qualified to work as nutritionists, dietitians, health educators, and nutrition consultants in hospitals, healthcare centers, sports facilities, and wellness programs.zNutrition & Dieteticsr2   )zagriculture,farming,cropszfood,technology,processingznutrition,health,dietzplants,science,researchzsoil,farming,organiczlaboratory,science,researchz&https://source.unsplash.com/1200x600/?banner_r3   r4   r5   r6   )r   defaultszCreated course: zUpdated course: )r    r!   r"   SUCCESSr   objectsr   r   DoesNotExistr%   osmakedirspathjoinr   
MEDIA_ROOTr   hashlenr   update_or_createbanner_imagesaver2   _create_course_eligibility_create_course_fees_create_hostel_fees_create_course_highlights)r.   argsoptionsagriculture_colleger1   courses_datacourse_datar   banner_themestheme
banner_urlrE   coursecreatedr/   r-   r0   handle   s    /


zCommand.handlec                 C   s   d|j v rd}d}d}n*d|j v r0d|j v rd}d}d	}nd
|j v r)d}d}d}nd}d}d}nd}d}d}tjj||||dd dS )z*Create eligibility criteria for the courseM.Sc.z_Bachelor's degree in Agriculture, Life Sciences, or related field from a recognized university.z8Minimum 60% aggregate in graduation (55% for SC/ST/OBC).zOUniversity entrance test or national level examination with personal interview.zB.Sc.Agriculturez]10+2 (Senior Secondary) with Physics, Chemistry, Biology/Mathematics from a recognized board.z?Minimum 50% aggregate in 10+2 with PCM/PCB (45% for SC/ST/OBC).z,ICAR AIEEA (UG) or University entrance test.r7   z]10+2 (Senior Secondary) with Physics, Chemistry, Mathematics/Biology from a recognized board.z%JEE Main or University entrance test.zQ10+2 (Senior Secondary) with Physics, Chemistry, Biology from a recognized board.z;Minimum 50% aggregate in 10+2 with PCB (45% for SC/ST/OBC).z!NEET or University entrance test.z010+2 (Senior Secondary) from a recognized board.z2Minimum 50% aggregate in 10+2 (45% for SC/ST/OBC).z.Merit-based admission or entrance examination.)academic_qualificationminimum_marksentrance_examrS   r9   N)r2   r   r;   rD   )r.   rS   rO   academic_qualrY   rZ   r/   r/   r0   rG      s4   




z"Command._create_course_eligibilityc                 C   s^   d|j v r
d}d}nd|j v rd}d}nd|j v rd}d	}nd
}d}tjj|||dd dS )z#Create fee structure for the courserV   u   ₹1,80,000 per yearz$6,000 per yearzB.Sc. Agricultureu   ₹1,50,000 per yearz$5,500 per yearr7   u   ₹1,40,000 per yearz$5,000 per yearu   ₹1,20,000 per yearz$4,500 per year)domesticinternationalr[   N)r2   r	   r;   rD   )r.   rS   rO   domestic_feeinternational_feer/   r/   r0   rH      s"   



zCommand._create_course_feesc                 C   s   t jj|dddddd dS )z*Create hostel fee structure for the courseu	   ₹80,000u	   ₹20,000u	   ₹15,000zHostel fees include accommodation, meals, laundry, and basic amenities. AC rooms are available with additional charges. Security deposit is refundable at the time of leaving the hostel.)fee_per_yearac_room_additionalsecurity_depositnotesr[   N)r   r;   rD   )r.   rS   r/   r/   r0   rI      s   
zCommand._create_hostel_feesc                 C   s  g }d|j v rddddddddd	d
ddddddg}nNd|j v r:ddddddddddddddddg}n2d|j v rVddddd d!d"dd#d$d%dd&d'd(dg}nd)d*d+dd,d-d.dd/d0d1dd2d3d4dg}|D ]}tjj||d5 |d6 |d7 d8d9 qn| j| jd: d;S )<zCreate course highlightsrW   zPractical Farm TrainingzJExtensive hands-on experience in agricultural farms and research stations.seedling)r2   descriptioniconzResearch OpportunitieszLOpportunities to participate in cutting-edge agricultural research projects.
microscopezIndustry PartnershipszHStrong connections with agricultural industries and government agencies.	handshakezModern TechnologyzBTraining in precision agriculture and modern farming technologies.cogsr7   zPilot Plant TrainingzEHands-on experience in food processing pilot plants and laboratories.industryzQuality AssurancezDComprehensive training in food quality control and safety standards.zcheck-circlezIndustry ExposurezIInternships and training programs with leading food processing companies.buildingzProduct DevelopmentzDPractical experience in new food product development and innovation.	lightbulb	NutritionzClinical Trainingz:Practical training in hospitals and healthcare facilities.hospitalzCommunity ProgramszAInvolvement in community nutrition and health promotion programs.userszNutritional Assessmentz?Training in modern nutritional assessment techniques and tools.z
chart-linezDiet Planningz@Expertise in therapeutic diet planning and nutrition counseling.z	apple-altzExpert FacultyzELearn from experienced faculty with industry and research background.zuser-graduatezModern Facilitiesz6State-of-the-art laboratories and research facilities.flaskzResearch Focusz@Strong emphasis on research and innovation in specialized areas.searchzCareer Supportz7Comprehensive career guidance and placement assistance.	briefcaser2   rf   rg   )rf   rg   )rS   r2   r9   z6Successfully seeded all Agricultural Sciences courses!N)r2   r   r;   rD   r    r!   r"   r:   )r.   rS   rO   highlights_datahighlight_datar/   r/   r0   rJ      sB   


















	z!Command._create_course_highlightsN)	__name__
__module____qualname__helprU   rG   rH   rI   rJ   r/   r/   r/   r0   r      s    |!r   )r=   django.core.management.baser   django.core.files.baser   django.utils.textr   r   ior   django.confr   courses.modelsr   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   colleges.modelsr   r   r/   r/   r/   r0   <module>   s    D