U
    =YgD                     @   s  d dl mZ ddlmZmZmZmZmZmZm	Z	 ddl
mZm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 d dlmZ dd ZG dd deZG dd deeZ G dd deeZ!G dd deZ"G dd deeZ#G dd deej$Z%G dd deej$Z&G dd deej'Z(G dd  d eej$Z)G d!d" d"eej'Z*G d#d$ d$eej$Z+G d%d& d&eej'Z,G d'd( d(eej$Z-G d)d* d*eej'Z.G d+d, d,eej$Z/dS )-    )render   )PublicationResearchEquipmentEquipment_CategoryThesisPatentProjectOpen_Thesis)PublicationSearchFormThesisSearchForm)SearchListView)
BaseFilter)genericN)F)ContextMixin)OuterRefSubqueryValuePrefetch)Coalescec                 C   s$   t j  }d|i}t| d|dS )z View function for research page.num_publicationzresearch.html)context)r   objectsallcountr   )requestr   r    r   "/var/www/nanotud/research/views.pyresearch   s    r   c                   @   s"   e Zd ZddddddddgiZd	S )
PublicationFiltersearch_texttitleauthor_listjournaljournal_short	arxiv_urlZproject__nameZproject__project_acrN__name__
__module____qualname__search_fieldsr   r   r   r   r       s    r    c                   @   s:   e Zd ZeZdZejjddjddZdZ	dZ
eZeZdS )PublicationSearchListpublication_listT	chair_pubapproved   publication_search.htmlNr(   r)   r*   r   modelcontext_object_namer   filterquerysetpaginate_bytemplate_namer   
form_classr    filter_classr   r   r   r   r,   $   s   r,   c                   @   s:   e Zd ZeZdZejjddjddZdZ	dZ
eZeZdS )PublicationALLListr-   Tr.   r0   i r3   Nr4   r   r   r   r   r=   -   s   r=   c                   @   s   e Zd ZdddgiZdS )ThesisFilterr!   r"   authorNr'   r   r   r   r   r>   9   s    r>   c                   @   s:   e Zd ZeZdZej ZdZ	dZ
eZeZejdZdS )ThesisSearchListZthesis_listd   zthesis_search.html	-end_dateN)r(   r)   r*   r   r5   r6   r   r   r8   r9   r:   r   r;   r>   r<   order_byr   r   r   r   r@   >   s   
r@   c                   @   s   e Zd ZeZdZdZdS )ThesisDetailViewzthesis_detail.htmlthesis_detailN)r(   r)   r*   r   r5   r:   r6   r   r   r   r   rD   I   s   rD   c                   @   s   e Zd ZeZdZdZdS )PublicationDetailViewzpublication_detail.htmlZ
pub_detailN)r(   r)   r*   r   r5   r:   r6   r   r   r   r   rF   P   s   rF   c                   @   s   e Zd ZeZdZdZdZdS )PatentListViewZpatent_listzpatent_list.htmlrA   N)r(   r)   r*   r   r5   r6   r:   r9   r   r   r   r   rG   V   s   rG   c                   @   s   e Zd ZeZdZdZdS )PatentDetailViewZpatent_detailzpatent_detail.htmlN)r(   r)   r*   r   r5   r6   r:   r   r   r   r   rH   \   s   rH   c                   @   s*   e Zd ZeZejjddZdZdZ	dZ
dS )OpenThesisListViewT)publicZopen_thesis_listzopen_thesis.htmlrA   N)r(   r)   r*   r
   r5   r   r7   r8   r6   r:   r9   r   r   r   r   rI   d   s
   rI   c                   @   s   e Zd ZeZdZdZdS )OpenThesisDetailViewrE   zopen_thesis_detail.htmlN)r(   r)   r*   r
   r5   r6   r:   r   r   r   r   rK   k   s   rK   c                   @   sz   e Zd ZeZejjedd	d
ddd ZejjeedZejededd		d
djddZdZdZdZdS )ResearchEquipmentListViewpk)$researchequipment_equipment_categoryorder_indexNr   )min_order_indexrP   i?B )
sort_orderrQ   z-priceTactiveZresearch_equipment_listzresearch_equipment.html   )r(   r)   r*   r   r5   r   r   r7   r   rC   valuessubqueryannotater   r8   r   r   r6   r:   r9   r   r   r   r   rL   w   s0    rL   c                   @   s&   e Zd ZeZejjddZdZdZ	dS )ResearchEquipmentDetailViewTrR   Zresearch_equipment_detailzresearch_equipment_detail.htmlN)
r(   r)   r*   r   r5   r   r7   r8   r6   r:   r   r   r   r   rX      s   rX   c                   @   s0   e Zd ZeZejjdddZdZ	dZ
dZdS )ProjectListViewTshow_publicrB   project_listzproject.htmlrA   N)r(   r)   r*   r	   r5   r   r7   rC   r8   r6   r:   r9   r   r   r   r   rY      s
   rY   c                   @   s&   e Zd ZeZejjddZdZdZ	dS )ProjectDetailViewTrZ   Zproject_detailzproject_detail.htmlN)
r(   r)   r*   r	   r5   r   r7   r8   r6   r:   r   r   r   r   r]      s   r]   )0Zdjango.shortcutsr   modelsr   r   r   r   r   r	   r
   formsr   r   Zsearch_views.searchr   Zsearch_views.filtersr   Zdjango.viewsr   sysdjango.db.modelsr   nanotud.add_global_contextr   r   r   r   r   django.db.models.functionsr   r   r    r,   r=   r>   r@   
DetailViewrD   rF   ListViewrG   rH   rI   rK   rL   rX   rY   r]   r   r   r   r   <module>   s4   $	