o
    f	                     @   s   d dl mZmZmZmZ d dlmZmZmZm	Z	m
Z
 d dlmZ dd Zdd ZG dd	 d	eZG d
d deZG dd deZdd ZG dd deZG dd deZeee ee ee	e eee ee
 dS )    )TabularInlineStackedInlinesite
ModelAdmin)Meeting
CourseSiteSecureCourseFileMeetingFileURL)MarkdownxModelAdminc                 C      |j dd d S )NThideupdate
modeladminrequestqueryset r    /var/www/djphys/courses/admin.pyhide_meeting_action
      r   c                 C   r   )NFr   r   r   r   r   r   show_meeting_action   r   r   c                   @   s    e Zd ZeZdd Zdd ZdS )	FileAdminc                 C   s   t d |j|_|  d S )NzFileAdmin save_model here)printuseruploaded_bysave)selfr   objformchanger   r   r   
save_model   s   zFileAdmin.save_modelc                 C   s@   |j tkr|jdd}|D ]
}|j|_|  qd S |  d S )NF)commit)modelr   r   r   r   )r   r   r!   formsetr"   	instancesinstancer   r   r   save_formset   s   

zFileAdmin.save_formsetN)__name__
__module____qualname__r   r%   r#   r)   r   r   r   r   r      s    r   c                   @      e Zd ZeZdZdZdS )MeetingFileInline   )r   N)r*   r+   r,   r	   r%   extraexcluder   r   r   r   r.   #       r.   c                   @   r-   )	URLInliner/   )date_postedrelease_untilN)r*   r+   r,   r
   r%   r0   r1   r   r   r   r   r3   *   r2   r3   c                 C   s   |d }dS )z[
    Shift down the entries in the schedule on the indicated
    day and subsequently.
    r   Nr   )r   r   r   firstr   r   r   
shift_down0   s   r7   c                   @   s:   e Zd ZdddifdddiffZegZddgZeegZ	dS )MeetingAdminNfields))r   course_recordsession_type)datetopic)homeworkreadingexamzAdvanced options)urlsnotesr<   r:   )
r*   r+   r,   	fieldsetsr.   inlineslist_filterr   r   actionsr   r   r   r   r8   8   s    r8   c                   @   s   e Zd ZeZdZdZegZdS )MeetingInliner   )rB   N)	r*   r+   r,   r   r%   r0   r1   r.   rD   r   r   r   r   rG   J   s
    
rG   N)django.contrib.adminr   r   r   r   courses.modelsr   r   r   r	   r
   markdownx.adminr   r   r   r   r.   r3   r7   r8   rG   registerr   r   r   r   <module>   s     
