o
    >h
                     @   s|   d dl mZmZ d dl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	edd Zee	ed	d
 ZdS )    )HttpResponseBadRequestJsonResponse)render_to_string)login_not_required)render_with_toolbar_languagerequire_show_toolbar)HistoryStoreForm)DebugToolbarc                 C   s   t | j}| rD|jd }t|}|jd }i }|du r"t|S |jD ]}|r-|js-q%d|i}t	d|t	d|d||j
< q%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_context r   /var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-packages/debug_toolbar/panels/history/views.pyhistory_sidebar
   s*   





r   c                 C   sp   t | j}| r4g }ttj D ]\}}||td||t |dddddd qt	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   r   r   r   history_refresh*   s,   
r'   N)django.httpr   r   django.template.loaderr   debug_toolbar._compatr   debug_toolbar.decoratorsr   r   "debug_toolbar.panels.history.formsr   debug_toolbar.toolbarr	   r   r'   r   r   r   r   <module>   s    