
    7 f
                         d dl mZmZ d dlmZ d dlmZmZ d dlm	Z	 d dl
mZ eed                         Zeed                         ZdS )	    )HttpResponseBadRequestJsonResponse)render_to_string)render_with_toolbar_languagerequire_show_toolbar)HistoryStoreForm)DebugToolbarc                    t          | j                  }|                                r|j        d         }t	          j        |          }|j        d         }i }|t          |          S |j        D ]9}|r|j        sd|i}t          d|          t          d|          d||j
        <   :t          |          S t          d          S )	z4Returns the selected debug toolbar history snapshot.store_idexclude_historyNpanelz(debug_toolbar/includes/panel_button.htmlz)debug_toolbar/includes/panel_content.html)buttoncontentForm errors)r   GETis_validcleaned_datar	   fetchr   panelsis_historicalr   panel_idr   )requestformr   toolbarr   contextr   panel_contexts           X/var/www/equiseq/venv/lib/python3.11/site-packages/debug_toolbar/panels/history/views.pyhistory_sidebarr   	   s     GK((D}} %$Z0$X..+,=>?  (((^ 	 	E u': $e,M*>  ,? 	' 'GEN## G$$$!-000    c                 r   t          | j                  }|                                rg }t          t          j                                                  D ]B\  }}|                    |t          d||t          |dd          dd          d           Ct          d|i          S t          d	          S )
z?Returns the refreshed list of table rows for the History Panel.z$debug_toolbar/panels/history_tr.htmlT)r   r   )initial)r   r   )idstore_context)r"   r   requestsr   )r   r   r   listr	   _storeitemsappendr   r   r   )r   r   r$   r"   r   s        r   history_refreshr)   (   s     GK((D}} 4 3 9 9 ; ;<< 	 	KBOO/>"$+2(846;?-& -&)" )" )". .        * Z2333!-000r   N)django.httpr   r   django.template.loaderr   debug_toolbar.decoratorsr   r   "debug_toolbar.panels.history.formsr   debug_toolbar.toolbarr	   r   r)    r   r   <module>r0      s    < < < < < < < < 3 3 3 3 3 3 W W W W W W W W ? ? ? ? ? ? . . . . . . 1 1  1: 1 1  1 1 1r   