
    si                         d dl mZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZmZ d dlmZmZ  eed	       e ed
      d	       G d de                    Z G d de      Zy)    )Any)method_decorator)gettext_lazy)AssetFilter)Asset)login_requiredpermission_required)HorillaDetailedViewHorillaListViewdispatch)namezasset.view_assetlotc                   L     e Zd ZdZeZeZg dZdZ	dZ
dZddiZd	 fd	ZdZ xZS )
AssetListViewz$
    list view for batch number
    )
asset_nameasset_statusasset_tracking_idasset_lot_number_idFaction_columnr   zstyle='width:200px !important;'c                 f    t        |   ||g|i |j                  | j                  d         S )Ncat_id)asset_category_id)superget_querysetfilterkwargs)selfquerysetfilteredargsr   	__class__s        3/var/www/python-projects/worksol/asset/cbv/asset.pyr   zAssetListView.get_queryset   sA    G "H?/3?7=?Vdkk(&;V<	
    z
        hx-get='{asset_detail}?instance_ids={ordered_ids}'
        hx-target="#genericModalBody"
        data-target="#genericModal"
        data-toggle="oh-modal-toggle"
    )NF)__name__
__module____qualname____doc__r   modelr   filter_classcolumnsshow_filter_tagsbulk_select_optionaction_methodheader_attrsr   	row_attrs__classcell__r    s   @r!   r   r      sA     ELXG#M "CDL
Ir"   r   c                   <     e Zd ZdZdef fdZeZdZdZ	g dZ
 xZS )AssetInformationViewz!
    Detail view of the page
    r   c                 N    t        |   di |}|d   j                  }||d<   |S )zP
        Return context data with the title set to the contract's name.
        assettitle )r   get_context_datar   )r   r   contextr   r    s       r!   r7   z%AssetInformationView.get_context_data/   s6    
 '*4V4W%00
%r"   Fdetail_view_action)r   asset_purchase_dateasset_purchase_costr   r   r   )r#   r$   r%   r&   r   r7   r   r'   headerr,   bodyr/   r0   s   @r!   r2   r2   *   s,      EF(MDr"   r2   N)typingr   django.utils.decoratorsr   django.utils.translationr   _asset.filtersr   asset.modelsr   horilla_views.cbv_methodsr   r	   horilla_views.generic.cbv.viewsr
   r   r   r2   r6   r"   r!   <module>rF      s`     4 6 %  I P .z2%&;<:NO  O 38. r"   