U
    ªJd.  ã                   @   s`   d dl mZ d dlmZ d dlZd dlmZ d dlmZ G dd„ dej	ƒZ
G dd	„ d	ejƒZdS )
é    )Úmodels)ÚUniqueConstraintN)ÚSKUDtlCategoryModel)ÚAttributesModelc                       s$   e Zd Z‡ fdd„Zdd„ Z‡  ZS )Ú	ULIDFieldc                    s   d|d< t t| ƒj||Ž d S )Né   Ú
max_length)Úsuperr   Ú__init__)ÚselfÚargsÚkwargs©Ú	__class__© úJC:\Users\offic\Desktop\PIM\XCMS_PIM\app\models\category_attribute_model.pyr
   	   s    zULIDField.__init__c                 C   s   dS )Nzchar(26)r   )r   Ú
connectionr   r   r   Údb_type   s    zULIDField.db_type)Ú__name__Ú
__module__Ú__qualname__r
   r   Ú__classcell__r   r   r   r   r      s   r   c                   @   sF   e Zd Zejedejddd�Zejedejddd�Z	G dd	„ d	ƒZ
d
S )ÚCategoryAttributeModelÚcreated_attributesÚslc_cdÚcateogry_cd)Úrelated_nameÚ	on_deleteÚto_fieldÚ	db_columnÚupdated_attributesÚcdÚattribute_cdc                   @   s0   e Zd ZdZdZedgdd� edgdd� dS )	zCategoryAttributeModel.MetaFÚattributes_tr!   Zattrib_unique)ÚfieldsÚnamer%   Zattrib_unique_nameN)r   r   r   ÚmanagedÚdb_tabler   r   r   r   r   ÚMeta   s   r(   N)r   r   r   r   Ú
ForeignKeyr   Ú
DO_NOTHINGr   r   r"   r(   r   r   r   r   r      s       ÿ    ÿr   )Ú	django.dbr   Údjango.db.models.constraintsr   ÚulidÚapp.models.sku_dtl_ctgry_modelr   Úapp.models.attributes_modelr   Ú	CharFieldr   ÚModelr   r   r   r   r   Ú<module>   s   	