o
    y8]h,`                     @   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 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Testimonialc                   @   s0   e Zd ZdZdd Zdd Zdd Zdd	 Zd
S )CommandzBSeeds the database with courses for Roorkee College of Engineeringc                    sT   j  jd 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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d0d1d2d)ddd3d4d5dddd6d7d8dddd9d:d;dddd<d=d>dddd?d@dAdBdddCdDdEdBdddFdGdHdBdddIdJdKdBddg}|D ]z}t
|dL }g dM}|t|dL t|  }dN| }	||	dO| }
tjj||dL |dP |dQ |dR |dS ddT\}}|
r|
|_|  |r j  jdU|j  n j  jdV|j   ||  ||  || qd S )WNz$Starting to seed Engineering coursesz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_engineering_courses.pysave_image_from_url   s   


z+Command.handle.<locals>.save_image_from_urlz!B.Tech. Hons. (Civil Engineering)zComprehensive program in Civil Engineering covering structural design, construction management, and infrastructure development.a  The B.Tech. Honours in Civil Engineering is designed to provide students with a strong foundation in civil engineering principles, structural analysis, construction technology, and project management. Students will learn about design of buildings, bridges, roads, water supply systems, and environmental engineering. The program emphasizes both theoretical knowledge and practical skills through laboratory work, field visits, and industry projects.z4 Years (8 Semesters)zCivil Engineering)titleshort_descriptionoverviewdurationcategoryz7B.Tech. Hons. (Electronics & Communication Engineering)zeAdvanced program in ECE focusing on electronics design, communication systems, and signal processing.a  The B.Tech. Honours in Electronics & Communication Engineering provides comprehensive training in electronic circuits, digital systems, communication networks, and signal processing. Students will gain expertise in areas such as VLSI design, embedded systems, wireless communication, and optical communication. The program includes extensive laboratory work and industry-oriented projects to ensure practical skills development.z'Electronics & Communication Engineeringz4B.Tech. Hons. (Electrical & Electronics Engineering)z]Comprehensive program covering power systems, control systems, and electrical machine design.a  The B.Tech. Honours in Electrical & Electronics Engineering focuses on power generation, transmission, distribution, electrical machines, control systems, and power electronics. Students will learn about renewable energy systems, smart grids, electric vehicles, and industrial automation. The curriculum combines theoretical foundations with hands-on experience in well-equipped laboratories and real-world projects.z$Electrical & Electronics Engineeringz&B.Tech. Hons. (Mechanical Engineering)z\Advanced mechanical engineering program covering design, manufacturing, and thermal systems.a  The B.Tech. Honours in Mechanical Engineering provides comprehensive education in mechanical design, manufacturing processes, thermodynamics, fluid mechanics, and materials science. Students will gain expertise in CAD/CAM, robotics, automotive engineering, and industrial automation. The program emphasizes problem-solving skills and innovation through practical projects and industry collaborations.zMechanical Engineeringz$B.Tech. Hons. LE (Civil Engineering)zXLateral entry program for diploma holders in Civil Engineering with advanced curriculum.ay  The B.Tech. Honours Lateral Entry program in Civil Engineering is designed for diploma holders who want to pursue advanced studies in civil engineering. This accelerated program allows direct admission to the second year while maintaining honours curriculum standards. Students will focus on advanced topics in structural engineering, transportation, and environmental systems.z3 Years (6 Semesters)z:B.Tech. Hons. LE (Electronics & Communication Engineering)z[Lateral entry program for ECE diploma holders with focus on advanced communication systems.a.  This lateral entry honours program provides diploma holders with an opportunity to specialize in advanced electronics and communication engineering. Students will focus on cutting-edge topics such as 5G communication, IoT systems, embedded design, and VLSI technology through an accelerated curriculum.z7B.Tech. Hons. LE (Electrical & Electronics Engineering)zSLateral entry program focusing on advanced power systems and industrial automation.zThe lateral entry honours program in EEE is designed for diploma holders who want to advance their careers in electrical engineering. The curriculum focuses on modern power systems, renewable energy, smart grids, and industrial automation technologies.z)B.Tech. Hons. LE (Mechanical Engineering)zNLateral entry program covering advanced manufacturing and design technologies.a  This lateral entry programme provides diploma holders with advanced knowledge in mechanical engineering. Students will focus on modern manufacturing techniques, automation, robotics, and sustainable engineering practices through hands-on projects and industry exposure.zM.Tech. (Civil Engineering)zOAdvanced postgraduate program in Civil Engineering with specialization options.aG  The M.Tech. in Civil Engineering is a research-oriented program that provides advanced knowledge in structural engineering, geotechnical engineering, transportation engineering, or environmental engineering. Students will engage in cutting-edge research projects and develop expertise in specialized areas of civil engineering.z2 Years (4 Semesters)z1M.Tech. (Electronics & Communication Engineering)zJResearch-focused program in advanced ECE topics and emerging technologies.a  The M.Tech. in ECE program focuses on advanced research in areas such as VLSI design, signal processing, communication systems, and embedded systems. Students will work on cutting-edge projects and contribute to technological innovation in the electronics and communication field.z.M.Tech. (Electrical & Electronics Engineering)zVAdvanced program focusing on power systems, control engineering, and renewable energy.a  The M.Tech. in EEE program provides advanced knowledge in power systems analysis, control engineering, power electronics, and renewable energy systems. Students will conduct research in areas such as smart grids, electric vehicles, and sustainable energy technologies.z M.Tech. (Mechanical Engineering)zOResearch-oriented program in advanced mechanical engineering and manufacturing.a  The M.Tech. in Mechanical Engineering program focuses on advanced topics in design engineering, manufacturing technology, thermal engineering, and materials science. Students will engage in research projects related to Industry 4.0, sustainable manufacturing, and advanced materials.zDiploma (Civil Engineering)zJTechnical diploma program providing practical skills in civil engineering.a4  The Diploma in Civil Engineering is a hands-on program that prepares students for careers as civil engineering technicians. Students will learn practical skills in surveying, construction technology, building materials, and project execution. The program emphasizes practical training and industry readiness.z/Diploma (Electronics & Electronics Engineering)zOTechnical diploma focusing on electronics systems and electrical installations.a  The Diploma in EEE program provides practical training in electrical systems, electronics circuits, and power distribution. Students will gain hands-on experience in electrical installations, maintenance, and troubleshooting of electrical and electronic systems.z Diploma (Mechanical Engineering)zLPractical diploma program in mechanical systems and manufacturing processes.zThe Diploma in Mechanical Engineering provides practical skills in mechanical systems, manufacturing processes, and maintenance engineering. Students will gain hands-on experience with machine tools, manufacturing processes, and mechanical system design.z1Diploma (Electronics & Communication Engineering)zOTechnical program focusing on electronics and communication system maintenance.zThe Diploma in ECE program provides practical training in electronics circuits, communication systems, and digital electronics. Students will learn to install, maintain, and troubleshoot electronic and communication equipment used in various industries.zPh.D. (Civil Engineering)z?Doctoral research program in advanced civil engineering topics.aO  The Ph.D. in Civil Engineering is a research-intensive program for students interested in pursuing careers in academia or advanced research. Students will conduct original research in areas such as structural engineering, environmental engineering, transportation, or geotechnical engineering under the guidance of experienced faculty.z	3-5 Yearsz,Ph.D. (Electrical & Electronics Engineering)z=Doctoral program in advanced electrical engineering research.zThe Ph.D. in EEE program focuses on advanced research in power systems, control engineering, power electronics, and renewable energy. Students will contribute to cutting-edge research and develop innovative solutions for electrical engineering challenges.zPh.D. (Mechanical Engineering)zHResearch doctorate in advanced mechanical engineering and manufacturing.a/  The Ph.D. in Mechanical Engineering program enables students to conduct advanced research in areas such as advanced manufacturing, materials science, thermal systems, and mechanical design. Students will work on innovative projects that contribute to the advancement of mechanical engineering knowledge.z/Ph.D. (Electronics & Communication Engineering)zDDoctoral research program in advanced ECE and emerging technologies.a  The Ph.D. in ECE program focuses on cutting-edge research in areas such as wireless communication, VLSI design, signal processing, and emerging technologies. Students will contribute to technological innovation and advance the frontiers of electronics and communication engineering.r0   )zcivil,engineering,constructionzelectronics,circuit,technologyzelectrical,power,energyzmechanical,engineering,machineszengineering,blueprintzindustrial,manufacturingz&https://source.unsplash.com/1200x600/?banner_r1   r2   r3   r4   )slugdefaultszCreated course: zUpdated course: )r   r   r    SUCCESSosmakedirspathjoinr   
MEDIA_ROOTr   hashlenr   objectsupdate_or_createbanner_imagesaver0   _create_course_eligibility_create_course_fees_create_course_highlights)r,   argsoptionsr/   courses_datacourse_datar6   banner_themestheme
banner_urlrB   coursecreatedr-   r+   r.   handle   s.  



  

zCommand.handlec                 C   s   d|j v rd}d}d}n*d|j v rd}d}d}nd	|j v r$d
}d}d}nd|j v r0d}d}d}nd}d}d}tjj||||dd dS )z*Create eligibility criteria for the courseLEzRDiploma in Engineering/Technology in relevant field from a recognized institution.z5Minimum 60% aggregate in Diploma (55% for SC/ST/OBC).z5Lateral Entry Entrance Test or merit-based admission.Ph.Dz_Master's degree (M.Tech/M.E./M.Sc.) in relevant engineering field from a recognized university.z]Minimum 60% aggregate in qualifying degree (55% for SC/ST/OBC). GATE qualification preferred.zOUniversity Research Entrance Test, Interview, and Research Proposal evaluation.M.TechzMBachelor's degree in relevant engineering field from a recognized university.z?Minimum 60% aggregate in qualifying degree (55% for SC/ST/OBC).z?GATE score or University Entrance Test with personal interview.Diplomaz,10th standard (SSC) from a recognized board.z;Minimum 50% aggregate in 10th standard (45% for SC/ST/OBC).z9Merit-based admission or state polytechnic entrance test.zY10+2 (Senior Secondary) with Physics, Chemistry, and Mathematics from a recognized board.z?Minimum 60% aggregate in PCM at 10+2 level (55% for SC/ST/OBC).zLJEE Main/State Engineering Entrance Test or university entrance examination.)academic_qualificationminimum_marksentrance_examrN   r7   N)r0   r   r@   rA   )r,   rN   rJ   academic_qualrV   rW   r-   r-   r.   rD      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 courserR   u   ₹60,000 per yearz$2,500 per yearrS   u   ₹2,00,000 per yearz$7,000 per yearzB.Techu   ₹1,85,000 per yearz$6,200 per yearu   ₹85,000 per yearz$3,200 per year)domesticinternationalrX   N)r0   r	   r@   rA   )r,   rN   rJ   domestic_feeinternational_feer-   r-   r.   rE     s"   



zCommand._create_course_feesc                 C   sV  g }d|j v rddddddddd	d
ddddddg}njd|j v r:ddddddddddddddddg}nNd|j v rVddddd d!d"dd#d$d%dd&d'd(dg}n2d)|j v rrd*d+d,dd-d.d/dd0d1d2dd3d4d5dg}nd6d7d8dd9d:ddd;d<d(dd=d>d?dg}|D ]}tjj||d@ |dA |dB dCdD q| j| jdE dFS )GzCreate course highlightsCivilzInfrastructure FocuszVComprehensive training in building design, transportation systems, and urban planning.building)r0   descriptioniconzIndustry ProjectszKReal-world construction and infrastructure projects with industry partners.zproject-diagramzAdvanced LabszCState-of-the-art structural, materials, and surveying laboratories.flaskzSustainable DesignzGFocus on green building practices and sustainable construction methods.leafzElectronics & CommunicationzVLSI Design TrainingzBHands-on experience with chip design and semiconductor technology.	microchipz5G Technologyz=Latest communication technologies and wireless system design.wifizIndustry Labsz?Well-equipped labs with latest test equipment and design tools.toolszResearch OpportunitieszAAccess to cutting-edge research in communication and electronics.search
ElectricalzPower Systems FocuszKComprehensive training in power generation, transmission, and distribution.boltzRenewable EnergyzBSpecialization in solar, wind, and other renewable energy systems.zsolar-panelzSmart Grid Technologyz;Modern grid systems and electrical automation technologies.znetwork-wiredzIndustrial TrainingzFHands-on experience with industrial electrical systems and automation.industry
MechanicalzAdvanced ManufacturingzKTraining in CNC machining, 3D printing, and modern manufacturing processes.cogszRobotics & AutomationzDHands-on experience with industrial robotics and automation systems.robotzCAD/CAM TrainingzGProficiency in latest computer-aided design and manufacturing software.zdrafting-compasszAutomotive FocuszFSpecialization tracks in automotive engineering and electric vehicles.carzComprehensive CurriculumzBComplete coverage of engineering fundamentals and advanced topics.bookzPractical Learningz>Extensive laboratory work and project-based learning approach.zIndustry ReadyzBCurriculum designed with industry requirements and current trends.zResearch FocuszFOpportunities for research and innovation in engineering applications.
microscoper0   r`   ra   )r`   ra   )rN   r0   r7   z,Successfully seeded all Engineering courses!N)r0   r   r@   rA   r   r   r    r8   )r,   rN   rJ   highlights_datahighlight_datar-   r-   r.   rF   %  sN   























	z!Command._create_course_highlightsN)__name__
__module____qualname__helprP   rD   rE   rF   r-   r-   r-   r.   r      s     \ r   )r9   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   r   r-   r-   r-   r.   <module>   s    D