o
    wvXjv  ã                   @   sŽ   d 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mZ ddlmZ dd	lmZ eejƒZeeeeƒƒZeG d
d„ dejƒƒZdS )zDatabase models.é    )Úabsolute_importÚunicode_literals)Úsettings)Úmodels)Úugettext_lazy)Ústates)Úpython_2_unicode_compatibleé   )Úmanagersc                   @   sš  e Zd ZdZejeeddƒddedƒedƒd�Z	ejdddedƒed	ƒd
�Z
ejdedƒedƒd�Zejdedƒedƒd�Zejdejdeedƒedƒd�Zejddddedƒedƒd�Zejdedƒedƒd�Zejdedƒedƒd�Zejddd ed!ƒed"ƒd#�Zejdded$ƒed%ƒd&�Zejdded'ƒed(ƒd)�Zejdded*ƒed+ƒd,�Zejddd ed-ƒed.ƒd#�Ze ¡ ZG d/d0„ d0ƒZd1d2„ Zd3d4„ Z dS )5Ú
TaskResultzTask result/status.Ú(DJANGO_CELERY_RESULTS_TASK_ID_MAX_LENGTHéÿ   TzTask IDz#Celery ID for the Task that was run)Ú
max_lengthÚuniqueÚdb_indexÚverbose_nameÚ	help_textz	Task NamezName of the Task which was run)Únullr   r   r   r   zTask Positional ArgumentszBJSON representation of the positional arguments used with the task)r   r   r   zTask Named Argumentsz=JSON representation of the named arguments used with the taské2   z
Task Statez#Current state of the task being run)r   Údefaultr   Úchoicesr   r   éd   NÚWorkerzWorker that executes the task)r   r   r   r   r   r   é€   zResult Content TypezContent type of the result data)r   r   r   é@   zResult Encodingz.The encoding used to save the task result dataFzResult DatazUThe data returned by the task.  Use content_encoding and content_type fields to read.)r   r   Úeditabler   r   zCreated DateTimez6Datetime field when the task result was created in UTC)Úauto_now_addr   r   r   zCompleted DateTimez1Datetime field when the task was completed in UTC)Úauto_nowr   r   r   Ú	Tracebackz/Text of the traceback if the task generated one)Úblankr   r   r   zTask Meta InformationzHJSON meta information about the task, such as information on child tasksc                   @   s&   e Zd ZdZdgZedƒZedƒZdS )zTaskResult.MetazTable information.z
-date_doneztask resultztask resultsN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚorderingÚ_r   Úverbose_name_plural© r'   r'   úY/var/www/html/myproject/venv/lib/python3.10/site-packages/django_celery_results/models.pyÚMetaV   s
    r)   c                 C   s.   | j | j| j| j| j| j| j| j| j| j	dœ
S )N©
Útask_idÚ	task_nameÚ	task_argsÚtask_kwargsÚstatusÚresultÚ	date_doneÚ	tracebackÚmetaÚworkerr*   ©Úselfr'   r'   r(   Úas_dict^   s   özTaskResult.as_dictc                 C   s
   d  | ¡S )Nz <Task: {0.task_id} ({0.status})>)Úformatr5   r'   r'   r(   Ú__str__l   s   
zTaskResult.__str__)!r    r!   r"   r#   r   Ú	CharFieldÚgetattrr   r%   r+   r,   Ú	TextFieldr-   r.   r   ÚPENDINGÚTASK_STATE_CHOICESr/   r4   Úcontent_typeÚcontent_encodingr0   ÚDateTimeFieldÚdate_createdr1   r2   r3   r
   ÚTaskResultManagerÚobjectsr)   r7   r9   r'   r'   r'   r(   r      s˜    ýø	ýýýüþýýýýýýýr   N)r#   Ú
__future__r   r   Údjango.confr   Ú	django.dbr   Údjango.utils.translationr   r%   Úceleryr   Úcelery.fiver   Ú r
   ÚsortedÚ
ALL_STATESÚzipr>   ÚModelr   r'   r'   r'   r(   Ú<module>   s    
