o
    @]h                     @   s@   d dl mZ d dlmZmZmZ d dlmZ G dd deZdS )    )BaseCommand)CollegeProgramsSectionProgram)Coursec                   @   s   e Zd ZdZdd ZdS )CommandzCUpdate the Programs section for Roorkee College of Business Studiesc              
   O   st  z t jjdd}tjj|ddddd\}}|j   g d}tjj	|d	}g }d
}	d
}
|D ]J}|j
}|j}|dsL|dsL|dsL|dkr_||d| dd|	d |	d
7 }	q1|dsi|dr{||d| dd|
d |
d
7 }
q1d}|D ])}tjj||d |d |d |d d}|d
7 }| jd|j d|  d q| j| jd|j d | d! | jd" | j| jd# | jd$ |jj	dd% }|jj	dd% }| jd&|  | jd'|  | jd(|  W d S  t jy   | j| jd) Y d S  ty9 } z| j| jd*t|  W Y d }~d S d }~ww )+NzBusiness Studies)name__icontainszPrograms Offereda3  Comprehensive business and management education programs designed for modern industry needs. Our diverse range of undergraduate and postgraduate programs in business, commerce, and management are crafted to develop industry-ready professionals with strong analytical, leadership, and entrepreneurial skills.F)titledescriptionhas_doctoral_programs)collegedefaults)zB.ComBBAzBachelors in Hotel Managementz$Bachelors in Hospital Administrationz
BA EnglishzBA EconomicszBA Tourism & Managementz
MBA GlobalzMBA in Pharma ManagementzMBA Executivez3MBA (with IIM Certification) (Finance/HR/Marketing))	title__in   zB.zBA Bachelorr   z	/courses//UG)namelinktypeorderMBAzM.PGr   r   r   r   r   )programs_sectionr   r   program_typer   zCreated program: z ()zSuccessfully updated z with z
 programs!z3
==================================================zPROGRAMS SUMMARY:z2==================================================)r   zUndergraduate Programs: zPostgraduate Programs: zTotal Programs: z"Business Studies college not foundzError updating programs: )r   objectsgetr   get_or_createprogramsalldeleter   filterr	   slug
startswithappendr   createstdoutwriter   get_program_type_displaystyleSUCCESScountDoesNotExistERROR	Exceptionstr)selfargsoptionsr   r   createdbusiness_course_titlesbusiness_coursesprograms_dataorder_ugorder_pgcoursecourse_namecourse_slugcreated_countprogram_dataprogramug_programspg_programse rD   J/var/www/apihucms/colleges/management/commands/update_business_programs.pyhandle   s   




"

zCommand.handleN)__name__
__module____qualname__helprF   rD   rD   rD   rE   r      s    r   N)	django.core.management.baser   colleges.modelsr   r   r   courses.modelsr   r   rD   rD   rD   rE   <module>   s    