o
    aQhb                     @   s,   d dl mZ d dlmZ G dd deZdS )    )BaseCommand)
TShirtSizec                   @   s   e Zd ZdZdd ZdS )Commandz;Updates the order of T-shirt sizes from smallest to largestc                 O   s   ddddddd}|  D ]A\}}z%tjj|d}||_|  | j| j	d	|j
 d
|j d|  W q tjyN   | j| jd| d Y qw | j| j	d d S )N                  )SMLXLXXLXXXL)codezUpdated order for z (z) to zSize with code z
 not foundz'Successfully updated T-shirt size order)itemsr   objectsgetordersavestdoutwritestyleSUCCESSnamer   DoesNotExistWARNING)selfargsoptions
size_orderr   r   size r#   S/var/www/html/smartRegister/apparel/management/commands/update_tshirt_size_order.pyhandle   s"   
. zCommand.handleN)__name__
__module____qualname__helpr%   r#   r#   r#   r$   r      s    r   N)django.core.management.baser   apparel.modelsr   r   r#   r#   r#   r$   <module>   s    