
    dh                        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 Z G d de          Z G d dee          Z  G d dee          Z! G d de          Z" G d dee          Z# G d deej$                  Z% G d deej$                  Z& G d deej'                  Z( G d deej$                  Z) G d  d!eej'                  Z* G d" d#eej$                  Z+ G d$ d%eej'                  Z, G d& d'eej$                  Z- G d( d)eej'                  Z. G 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                     t           j                                                                        }d|i}t	          | d|          S )z View function for research page.num_publicationzresearch.html)context)r   objectsallcountr   )requestr   r   s      "/var/www/nanotud/research/views.pyresearchr       sC     ")--//5577O 1G'?G<<<<    c                       e Zd Zdg diZdS )PublicationFiltersearch_text)titleauthor_listjournaljournal_short	arxiv_urlproject__nameproject__project_acrN__name__
__module____qualname__search_fields r!   r   r#   r#      s!        ~~~MMMr!   r#   c                       e Zd ZeZdZe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_classr1   r!   r   r3   r3   $   sW        E,"))D)99@@$@OOHK-M&J$LLLr!   r3   c                       e Zd ZeZdZej                            d                              d          ZdZ	dZ
eZeZdS )PublicationALLListr4   Tr5   r7   i r:   Nr;   r1   r!   r   rE   rE   -   sW        E,"))D)99@@$@OOHK-M&J$LLLr!   rE   c                       e Zd Zdg diZdS )ThesisFilterr$   )r%   author_new__given_nameauthor_new__last_nameauthor_manualNr,   r1   r!   r   rG   rG   9   s!        dddMMMr!   rG   c                   j     e Zd ZeZdZdZdZeZ	e
Zej                            d          Z fdZ xZS )ThesisSearchListthesis_listd   zthesis_search.html	-end_datec                     t                                                      }|                    t          d                                                    S )N
author_new)superget_querysetprefetch_relatedr   distinct)selfqs	__class__s     r   rS   zThesisSearchList.get_querysetF   sD    WW!!##""\""
 

(**	r!   )r-   r.   r/   r   r<   r=   r@   rA   r   rB   rG   rC   r   order_byr?   rS   __classcell__)rX   s   @r   rL   rL   >   sl        E'K(M!JL~&&{33H        r!   rL   c                       e Zd ZeZdZdZdS )ThesisDetailViewzthesis_detail.htmlthesis_detailN)r-   r.   r/   r   r<   rA   r=   r1   r!   r   r\   r\   M   s         E(M)r!   r\   c                       e Zd ZeZdZdZdS )PublicationDetailViewzpublication_detail.html
pub_detailN)r-   r.   r/   r   r<   rA   r=   r1   r!   r   r_   r_   T   s         E-M&r!   r_   c                       e Zd ZeZdZdZdZdS )PatentListViewpatent_listzpatent_list.htmlrN   N)r-   r.   r/   r	   r<   r=   rA   r@   r1   r!   r   rb   rb   Z   s#        E'&MKKKr!   rb   c                       e Zd ZeZdZdZdS )PatentDetailViewpatent_detailzpatent_detail.htmlN)r-   r.   r/   r	   r<   r=   rA   r1   r!   r   re   re   `   s        E)(MMMr!   re   c                   T    e Zd ZeZej                            d          ZdZdZ	dZ
dS )OpenThesisListViewT)publicopen_thesis_listzopen_thesis.htmlrN   N)r-   r.   r/   r   r<   r   r>   r?   r=   rA   r@   r1   r!   r   rh   rh   h   s<        E")))66H,&MKKKr!   rh   c                       e Zd ZeZdZdZdS )OpenThesisDetailViewr]   zopen_thesis_detail.htmlN)r-   r.   r/   r   r<   r=   rA   r1   r!   r   rl   rl   o   s        E)-MMMr!   rl   c                      e Zd ZeZej                             ed                    	                    d          
                    d          dd         Zej                             ee                    Ze                     ed ed                    	          	                    d
d                              d          ZdZdZdZdS )ResearchEquipmentListViewpk)$researchequipment_equipment_categoryorder_indexNr   )min_order_indexrr   i?B )
sort_orderz-pricers   Tactiveresearch_equipment_listzresearch_equipment.html   )r-   r.   r/   r   r<   r   r   r>   r   rY   valuessubqueryannotater   r?   r   r   r=   rA   r@   r1   r!   r   rn   rn   {   s        E!)0019$ 1 
 

(=
!
!&&"7"7<H !(11 ** 2  H   8-uuV}}== !  hx%%ffDf&9&9  4-MKKKr!   rn   c                   P    e Zd ZeZej                            d          ZdZdZ	dS )ResearchEquipmentDetailViewTrt   research_equipment_detailzresearch_equipment_detail.htmlN)
r-   r.   r/   r   r<   r   r>   r?   r=   rA   r1   r!   r   r|   r|      s7        E (//t/<<H54MMMr!   r|   c                   z    e Zd ZeZej                            d                              d          ZdZ	dZ
dZdS )ProjectListViewTshow_publicrO   project_listzproject.htmlrN   N)r-   r.   r/   r
   r<   r   r>   rY   r?   r=   rA   r@   r1   r!   r   r   r      sI        E%%$%77@@MMH("MKKKr!   r   c                   P    e Zd ZeZej                            d          ZdZdZ	dS )ProjectDetailViewTr   project_detailzproject_detail.htmlN)
r-   r.   r/   r
   r<   r   r>   r?   r=   rA   r1   r!   r   r   r      s6        E%%$%77H*)MMMr!   r   )0django.shortcutsr   modelsr   r   r   r   r	   r
   r   formsr   r   search_views.searchr   search_views.filtersr   django.viewsr   sysdjango.db.modelsr   nanotud.add_global_contextr   r   r   r   r   django.db.models.functionsr   r    r#   r3   rE   rG   rL   
DetailViewr\   r_   ListViewrb   re   rh   rl   rn   r|   r   r   r1   r!   r   <module>r      s   # # # # # # k k k k k k k k k k k k k k k k k k : : : : : : : : . . . . . . + + + + + +             



       3 3 3 3 3 3 @ @ @ @ @ @ @ @ @ @ @ @ / / / / / /= = =    
   % % % % %L. % % %% % % % %~ % % %    :   
    |^   * * * * *|W%7 * * *' ' ' ' 'L'*< ' ' '    \7#3   ) ) ) ) )|W%7 ) ) )    w'7   . . . . .<); . . .    g.>   $5 5 5 5 5,0B 5 5 5    lG$4   * * * * *g&8 * * * * *r!   