o
    ]h                     @   s   d dl mZ d dlmZmZmZ d dlmZ d dlZ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
g	Z	G dd deZ
dS )     )BaseCommand)CollegeFacultySectionFaculty)settingsNzDr Harihara Sudanz Professor & Principal (Pharmacy)zAllied Sciences zHari.jpg)nameposition
departmentqualificationsimage_filenamezProf. Sonia SharmazProfessor & Principal (Nursing)z	Sonia.jpgzDr. Sandeep Darbariz$Associate Professor & HOD (Pharmacy)zSandeep.jpgzMs. Mansi MouryazAssistant Professorz
Manshi.jpgzMr. Vishal Baliyanz
Vishal.jpgzMs. Vinita Pandeyz
Vinita.jpgzMs. Kajal Kandariz	Kajal.jpgzMs. Rajat Sainiz	Rajat.jpgzMs. Sofia Ansariz
Sofiya.jpgc                   @   s   e Zd ZdZdd ZdS )CommandzAAutomate Our Faculty data for Roorkee College of Allied Sciences.c              
   O   s  d}z	t jj|d}W n t jy$   | j| jd| d Y d S w tjj	|dddd\}}|s?| j| j
d	 n
| j| jd
 tD ]~}tjtjd|d }tj|sl| j| jd|  qKt|dP}	tjj	||d |d |d |d |d dd\}
}|r|
j|d |	 |
  | j| jd|d   n| j| j
d|d   W d    n1 sw   Y  qK| j| jd d S )Nz"roorkee-college-of-allied-sciences)slugzCollege with slug "z" not found.zOur Facultyz"Meet our esteemed faculty members.)titledescription)collegedefaultsz6FacultySection already exists. Adding faculty members.zFacultySection created.	rawimagesr   zImage not found: rbr   r	   r
   r   )r	   r
   r   image)faculty_sectionr   r   zAdded faculty: zFaculty already exists: z!Faculty data automation complete.)r   objectsgetDoesNotExiststdoutwritestyleERRORr   get_or_createWARNINGSUCCESSFACULTY_DATAospathjoinr   BASE_DIRexistsopenr   r   save)selfargsoptionscollege_slugr   r   createdfaculty_data
image_pathimg_filefaculty_obj r2   I/var/www/apihucms/colleges/management/commands/automate_allied_faculty.pyhandleK   sP   


 zCommand.handleN)__name__
__module____qualname__helpr4   r2   r2   r2   r3   r   H   s    r   )django.core.management.baser   colleges.modelsr   r   r   django.confr   r"   r!   r   r2   r2   r2   r3   <module>   sx    B