ó
!_c           @   s¼   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 d d l m Z d d	 l m Z m Z m Z d
 e j f d „  ƒ  YZ e j j e e ƒ d S(   iÿÿÿÿ(   t   check_output(   t   admin(   t   format_html(   t   reverse(   t   TemplateResponse(   t   server_errori   (   t   LicenseModel(   t   serialGenerateWithORMt   serialDeactivateWithORMt   serialDeletet   LicenseAdminc           B   s€   e  Z d  Z d Z d Z d d g Z d Z d Z d Z d d d „ Z
 d „  Z d d	 g Z d
 „  Z d e _ d „  Z d e _ RS(   s   admin/my_change_form.htmlt   activation_datet   serialt   expiration_datet	   activatedt    c         C   s<   y' t  d ƒ d } |  j | | | ƒ SWn t | ƒ SXd  S(   Ni   i    (   R   t   change_viewR   (   t   selft   requestt   form_urlt   extra_contextR   (    (    s+   /var/www/html/tbcc-django/licenses/admin.pyt   add_view   s
    c         C   s,   t  ƒ  j | ƒ } d | k r( | d =n  | S(   Nt   delete_selected(   t   supert   get_actions(   R   R   t   actions(    (    s+   /var/www/html/tbcc-django/licenses/admin.pyR   %   s    
t   deactivate_selectedt   my_delete_selectedc         C   s(   x! | j  ƒ  D] } t | j ƒ q Wd  S(   N(   t   allR   R   (   R   R   t   objectst   o(    (    s+   /var/www/html/tbcc-django/licenses/admin.pyR   .   s    s   Deactivate selectedc         C   s2   x+ | j  ƒ  D] } t | j ƒ | j ƒ  q Wd  S(   N(   R   R	   R   t   delete(   R   R   t   objR   (    (    s+   /var/www/html/tbcc-django/licenses/admin.pyR   3   s    s   Delete selected(   R   R   R   R   (   R   R   (   R   R   (   R   R   R   R   (   R   N(   t   __name__t
   __module__t   change_form_templatet   date_hierarchyt   readonly_fieldst   fieldst   empty_value_displayt   list_displayt   search_fieldst   NoneR   R   R   R   t   short_descriptionR   (    (    (    s+   /var/www/html/tbcc-django/licenses/admin.pyR
   
   s"      				N(   t
   subprocessR    t   django.contribR   t   django.utils.htmlR   t   django.core.urlresolversR   t   django.template.responseR   t   django.views.defaultsR   t   modelsR   t   cliR   R   R	   t
   ModelAdminR
   t   sitet   register(    (    (    s+   /var/www/html/tbcc-django/licenses/admin.pyt   <module>   s   0