
    ˯g                         d dl mZ d dlmZ d dlmZmZ ddlmZ  G d dej                        Z
 G d d	eeej                        Zej                  j                  ee       y
)    )admin)	resources)ImportMixinExportMixin   )Channelc                   ,    e Zd Z G d d      Zd Zd Zy)ChannelResourcec                       e Zd ZeZdZy)ChannelResource.Meta)idN)__name__
__module____qualname__r   modelexclude     */var/www/skyplay_api_hub/channels/admin.pyMetar      s    r   r   c                     d|v r|d= |S )Nr   r   )selfrowkwargss      r   before_import_rowz!ChannelResource.before_import_row   s    3;D	
r   c                     |j                  d      }|r!	 t        j                  j                  |      S y# t        j                  $ r Y yw xY w)z
        Override this method to check for the `channel_id` and update the instance 
        if it exists, or create a new one if it doesn't.
        
channel_id)r   N)getr   objectsDoesNotExist)r   instance_loaderr   r   s       r   get_instancezChannelResource.get_instance   sQ     WW\*
**j*AA  '' s   6 AAN)r   r   r   r   r   r"   r   r   r   r
   r
      s     r   r
   c                       e Zd ZdZeZy)ChannelAdmin)r   channel_namepriceN)r   r   r   list_displayr
   resource_classr   r   r   r$   r$       s    :L$Nr   r$   N)django.contribr   import_exportr   import_export.adminr   r   modelsr   ModelResourcer
   
ModelAdminr$   siteregisterr   r   r   <module>r1      sO      # 8 i-- 4%;U-=-= %
 

  G\ *r   