
TQc           @   s  d  d l  Z  d  d l m Z m Z d  d l 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 m Z d  d l m Z d  d l m Z m Z d  d	 l m Z m Z m Z m Z d  d
 l m Z d  d l m Z d  d l m Z d  d l  m! Z! m" Z" d  d l# m$ Z$ d  d l% m& Z& d  d l' m( Z( m) Z) m* Z* d  d l+ m, Z, d  d l- m. Z. d  d l/ m0 Z0 m1 Z1 d  d l2 m3 Z3 d  d l4 m5 Z5 m6 Z6 m7 Z7 d  d l8 m9 Z9 d  d l: m; Z; m< Z< d  d l= m> Z> d  d l? m@ Z@ d  d lA mB ZB mC ZC d  d lD mE ZE d  d lF mG ZG d  d lH mI ZI mJ ZJ d  d lK mL ZM d  d lK mN ZN d  d  lO mP ZP d! d" f \ ZQ ZR d#   ZS d$ eT f d%     YZU i
 i e jV d& 6e jW d' 6e( jX 6i e jY d' 6e( jZ 6i e j[ d' 6e( j\ 6i e j] d' 6e( j^ 6i e j_ d' 6e( j` 6i e ja d' 6e( jb 6i e jc d' 6e( jd 6i e je d' 6e( jf 6i e jg d' 6e( jh 6i e jg d' 6e( ji 6Zj e> e  Zk d( eG jl e jm  f d)     YZn d* en f d+     YZo d, en f d-     YZp d. ep f d/     YZq d0 ep f d1     YZr d S(2   iN(   t   update_wrappert   partial(   t   forms(   t   settings(   t	   all_valid(   t   modelform_factoryt   modelformset_factoryt   inlineformset_factoryt   BaseInlineFormSet(   t   ContentType(   t   widgetst   helpers(   t   unquotet   flatten_fieldsetst   get_deleted_objectst   model_format_dict(   t   static(   t   messages(   t   csrf_protect(   t   PermissionDeniedt   ValidationError(   t	   Paginator(   t   reverse(   t   modelst   transactiont   router(   t
   LOOKUP_SEP(   t   RelatedObject(   t   BLANK_CHOICE_DASHt   FieldDoesNotExist(   t   QUERY_TERMS(   t   Http404t   HttpResponset   HttpResponseRedirect(   t   get_object_or_404(   t   SimpleTemplateResponset   TemplateResponse(   t   method_decorator(   t
   SortedDict(   t   escapet   escapejs(   t	   mark_safe(   t   six(   t   capfirstt   get_text_list(   t   ugettext(   t	   ungettext(   t
   force_texti   i   c         C   s   d |  t  k r d p d S(   Ns   radiolist%ss    inlinet    (   t
   HORIZONTAL(   t   x(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   <lambda>'   s    t   IncorrectLookupParametersc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR4   *   s   t
   form_classt   widgett   BaseModelAdminc           B   s   e  Z d  Z d Z d Z d Z d Z e j	 Z
 d Z d Z i  Z i  Z i  Z d Z d Z d   Z d   Z d d  Z d d  Z d d  Z d   Z e e  Z d   Z d d  Z d d	  Z d
   Z d   Z d   Z d d  Z  d d  Z! RS(   s8   Functionality common to both ModelAdmin and InlineAdmin.c         C   s)   t  j   } | j |  j  | |  _ d  S(   N(   t   FORMFIELD_FOR_DBFIELD_DEFAULTSt   copyt   updatet   formfield_overrides(   t   selft	   overrides(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   __init__S   s    c         K   s  | j  d d  } | j r. |  j | | |  St | t j t j f  rG| j |  j	 k rw t
 |  j	 | j |  } n  t | t j  r |  j | | |  } n* t | t j  r |  j | | |  } n  | rC| j |  j k rC|  j j j | j j  } t | o| j |   } t j | j | j |  j d | | _ n  | SxR | j j   D]A } | |  j	 k rWt
 t j |  j	 |  |  } | j |   SqWW| j |   S(   s   
        Hook for specifying the form Field instance for a given database Field
        instance.

        If kwargs are given, they're passed to the form Field's constructor.
        t   requestt   can_add_relatedN(   t   popt   Nonet   choicest   formfield_for_choice_fieldt
   isinstanceR   t
   ForeignKeyt   ManyToManyFieldt	   __class__R=   t   dictt   formfield_for_foreignkeyt   formfield_for_manytomanyt   namet   raw_id_fieldst
   admin_sitet	   _registryt   gett   relt   tot   boolt   has_add_permissionR
   t   RelatedFieldWidgetWrapperR8   t   mroR;   t   deepcopyt	   formfield(   R>   t   db_fieldt   kwargsRA   RZ   t   related_modeladminRB   t   klass(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   formfield_for_dbfieldX   s0    		c         K   s   | j  |  j k r d | k rN t j d i t |  j | j   d 6 | d <n  d | k r | j d | j d d t d  f g  | d <q n  | j |   S(	   sR   
        Get a form Field for a database Field that has declared choices.
        R8   t   attrst   classRE   t   include_blankt   blank_choiceR0   RD   (	   RN   t   radio_fieldsR
   t   AdminRadioSelectt   get_ul_classt   get_choicest   blankt   _RZ   (   R>   R[   RA   R\   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyRF      s    $		"c         K   s   | j  d  } | j |  j k rF t j | j |  j d | | d <na | j |  j k r t j d i t	 |  j | j  d 6 | d <| j
 r t d  p d | d <n  | j |   S(   s4   
        Get a form Field for a ForeignKey.
        t   usingR8   R`   Ra   RD   t   empty_labelN(   RR   RN   RO   R
   t   ForeignKeyRawIdWidgetRS   RP   Rd   Re   Rf   Rh   Ri   RD   RZ   (   R>   R[   RA   R\   t   db(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyRL      s    !"c         K   s   | j  j j j s d S| j d  } | j |  j k rf t j	 | j  |  j
 d | | d <d | d <nM | j t |  j  t |  j  k r t j | j | j |  j k  | d <n  | j |   S(   s9   
        Get a form Field for a ManyToManyField.
        Rj   R8   R0   t	   help_textN(   RS   t   throught   _metat   auto_createdRD   RR   RN   RO   R
   t   ManyToManyRawIdWidgetRP   t   listt   filter_verticalt   filter_horizontalt   FilteredSelectMultiplet   verbose_nameRZ   (   R>   R[   RA   R\   Rm   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyRM      s    %(c         C   s4   |  j  r |  j  S|  j r0 d  i |  j d 6f g Sd  S(   Nt   fields(   t	   fieldsetsRx   RD   (   R>   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   _declared_fieldsets   s
    		c         C   s   |  j  p d S(   s5   
        Hook for specifying field ordering.
        (    (   t   ordering(   R>   RA   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_ordering   s    c         C   s   |  j  S(   s=   
        Hook for specifying custom readonly fields.
        (   t   readonly_fields(   R>   RA   t   obj(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_readonly_fields   s    c         C   s   |  j  S(   sA   
        Hook for specifying custom prepopulated fields.
        (   t   prepopulated_fields(   R>   RA   R~   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_prepopulated_fields   s    c         C   s=   |  j  j j   } |  j |  } | r9 | j |   } n  | S(   s   
        Returns a QuerySet of all model instances that can be edited by the
        admin site. This is used by changelist_view.
        (   t   modelt   _default_managert   get_query_setR|   t   order_by(   R>   RA   t   qsR{   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   queryset   s
    c         C   s  |  j  } xV | j j D]H } x? t j |  j   D]( \ } } | | k r2 | | k r2 t Sq2 Wq W| j t  } t	 |  d k r | d t
 k r | j   n  d  } x | d  D] }	 y" | j j |	  \ }
 } } } Wn t k
 r t SXt |
 d  r|
 j j } |
 j j   j } q t |
 t  rH|
 j  } | j j j } q d  } q W| rt	 |  d k r| d | k r| j   n  t	 |  d k rt St j |  } | |  j k p| |  j k S(   Ni   iRS   (   R   Rp   t   related_fkey_lookupsR
   t   url_params_from_lookup_dictt   itemst   Truet   splitR   t   lenR   RC   RD   t   get_field_by_nameR   t   hasattrRS   RT   t   get_related_fieldRN   RG   R   t   pkt   joint   list_filtert   date_hierarchy(   R>   t   lookupt   valueR   t   lt   kt   vt   partst   rel_namet   partt   fieldRi   t   clean_lookup(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   lookup_allowed   s6    	"""	
(c         C   s*   |  j  } | j j | j d | j    S(   s   
        Returns True if the given request has permission to add an object.
        Can be overriden by the user in subclasses.
        t   .(   t   optst   usert   has_permt	   app_labelt   get_add_permission(   R>   RA   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyRV     s    	c         C   s*   |  j  } | j j | j d | j    S(   s  
        Returns True if the given request has permission to change the given
        Django model instance, the default implementation doesn't examine the
        `obj` parameter.

        Can be overriden by the user in subclasses. In such case it should
        return True if the given request has permission to change the `obj`
        model instance. If `obj` is None, this should return True if the given
        request has permission to change *any* object of the given type.
        R   (   R   R   R   R   t   get_change_permission(   R>   RA   R~   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   has_change_permission  s    	c         C   s*   |  j  } | j j | j d | j    S(   s  
        Returns True if the given request has permission to change the given
        Django model instance, the default implementation doesn't examine the
        `obj` parameter.

        Can be overriden by the user in subclasses. In such case it should
        return True if the given request has permission to delete the `obj`
        model instance. If `obj` is None, this should return True if the given
        request has permission to delete *any* object of the given type.
        R   (   R   R   R   R   t   get_delete_permission(   R>   RA   R~   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   has_delete_permission,  s    	(    N(    (    (    ("   R5   R6   t   __doc__RO   RD   Rx   t   excludeRy   R   t	   ModelFormt   formRt   Ru   Rd   R   R=   R}   R{   R@   R_   RF   RL   RM   Rz   t   propertyt   declared_fieldsetsR|   R   R   R   R   RV   R   R   (    (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR9   C   s8   			6				-	t
   ModelAdminc           B   s  e  Z d  Z d1 Z d2 Z d3 Z e Z d Z d Z	 d4 Z
 d5 Z d6 Z e Z e Z e Z g  Z d6 Z d6 Z d6 Z d6 Z d6 Z d6 Z g  Z e j Z e Z e Z e Z  d   Z! d6 d  Z" d   Z# d   Z$ e% e$  Z$ e% d    Z& d	   Z' d6 d
  Z( d6 d  Z) d   Z* d   Z+ d   Z, d   Z- d6 d  Z. d e d  Z/ d   Z0 d   Z1 d   Z2 d   Z3 e4 d  e3 _5 e e3 _6 d   Z7 e8 d  Z9 d   Z: d   Z; d   Z< d   Z= d   Z> e? j@ d e d   ZA d!   ZB d"   ZC d#   ZD d$   ZE d%   ZF e e d d6 d&  ZG d6 d'  ZH d(   ZI d)   ZJ d*   ZK d+   ZL eM eN jO d d6 d,    ZP eM eN jO d d6 d-    ZQ eM d6 d.   ZR eM eN jO d6 d/    ZS d6 d0  ZT RS(7   sC   Encapsulates all admin options and functionality for a given model.t   __str__id   i   c         C   s5   | |  _  | j |  _ | |  _ t t |   j   d  S(   N(   R   Rp   R   RP   t   superR   R@   (   R>   R   RP   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR@   Z  s    		c         C   s   g  } x |  j  D] } | |  j |  j  } | r | j |  pa | j | |  pa | j | |  sj q n  | j |  s d | _ q n  | j |  q W| S(   Ni    (   t   inlinesR   RP   RV   R   R   t   max_numt   append(   R>   RA   R~   t   inline_instancest   inline_classt   inline(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_inline_instances`  s    c            s   d d l  m } m }   f d   }   j j j   j j j f } | d | d |   j  d d | | d |   j  d d	 | | d
 |   j	  d d | | d |   j
  d d | | d |   j  d d |  } | S(   Ni(   t   patternst   urlc            s      f d   } t  |    S(   Nc             s     j  j   |  |   S(   N(   RP   t
   admin_view(   t   argsR\   (   R>   t   view(    s5   ../Django//lib/python/django/contrib/admin/options.pyt   wrappers  s    (   R    (   R   R   (   R>   (   R   s5   ../Django//lib/python/django/contrib/admin/options.pyt   wrapr  s    R0   s   ^$RN   s   %s_%s_changelists   ^add/$s	   %s_%s_adds   ^(.+)/history/$s   %s_%s_historys   ^(.+)/delete/$s   %s_%s_deletes   ^(.+)/$s   %s_%s_change(   t   django.conf.urlsR   R   R   Rp   R   t   module_namet   changelist_viewt   add_viewt   history_viewt   delete_viewt   change_view(   R>   R   R   R   t   infot   urlpatterns(    (   R>   s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_urlso  s(    



c         C   s
   |  j    S(   N(   R   (   R>   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   urls  s    c         C   s   t  j r d n d } d d d | d g } |  j d  k	 rN | j d |  n  |  j rq | j d d	 | g  n  |  j j   r | j d
 d d g  n  t	 j
 d g  | D] } t d |  ^ q  S(   NR0   s   .mins   core.jss   admin/RelatedObjectLookups.jss   jquery%s.jss   jquery.init.jss   actions%s.jss	   urlify.jss   prepopulate%s.jss   getElementsBySelector.jss   dom-drag.jss   admin/ordering.jst   jss   admin/js/%s(   R   t   DEBUGt   actionsRD   R   R   t   extendR   t   get_ordered_objectsR   t   MediaR   (   R>   t   extraR   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   media  s    		c         C   s4   i |  j  |  d 6|  j |  d 6|  j |  d 6S(   s   
        Returns a dict of all perms for this model. This dict has the keys
        ``add``, ``change``, and ``delete`` mapping to the True/False for each
        of those actions.
        t   addt   changet   delete(   RV   R   R   (   R>   RA   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_model_perms  s    c         C   s[   |  j  r |  j  S|  j | |  } t | j  t |  j | |   } d i | d 6f g S(   s/   Hook for specifying fieldsets for the add form.Rx   N(   R   t   get_formRs   t   base_fieldsR   RD   (   R>   RA   R~   R   Rx   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_fieldsets  s
    	%c         K   s  |  j  r t |  j   } n d } |  j d k r9 g  } n t |  j  } | j |  j | |   |  j d k r t |  j d  r |  j j	 j r | j |  j j	 j  n  | p d } i |  j d 6| d 6| d 6t
 |  j d | d 6} | j |  t |  j |  S(   sw   
        Returns a Form class for use in the admin add view. This is used by
        add_view and change_view.
        Rp   R   Rx   R   RA   t   formfield_callbackN(   R   R   RD   R   Rs   R   R   R   R   Rp   R   R_   R<   R   R   (   R>   RA   R~   R\   Rx   R   t   defaults(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR     s"    		0
c         K   s   d d l  m } | S(   sN   
        Returns the ChangeList class for use on the changelist page.
        i(   t
   ChangeList(   t   django.contrib.admin.views.mainR   (   R>   RA   R\   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_changelist  s    c         C   sc   |  j  |  } | j } y) | j j j |  } | j d |  SWn | j t f k
 r^ d SXd S(   s   
        Returns an instance matching the primary key provided. ``None``  is
        returned if no match is found (or the object_id failed validation
        against the primary key field).
        R   N(	   R   R   Rp   R   t	   to_pythonRR   t   DoesNotExistR   RD   (   R>   RA   t	   object_idR   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt
   get_object  s    	c         K   s9   i t  |  j d | d 6} | j |  t |  j |  S(   sU   
        Returns a Form class for use in the Formset on the changelist page.
        RA   R   (   R   R_   R<   R   R   (   R>   RA   R\   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_changelist_form  s    c         K   sT   i t  |  j d | d 6} | j |  t |  j |  j |  d d d |  j | S(   sj   
        Returns a FormSet class for use on the changelist page if list_editable
        is used.
        RA   R   R   i    Rx   (   R   R_   R<   R   R   R   t   list_editable(   R>   RA   R\   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_changelist_formset  s    	c         c   s2   x+ |  j  | |  D] } | j | |  Vq Wd  S(   N(   R   t   get_formset(   R>   RA   R~   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_formsets  s    i    c         C   s   |  j  | | | |  S(   N(   t	   paginator(   R>   RA   R   t   per_paget   orphanst   allow_empty_first_page(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_paginator  s    c         C   sc   d d l  m } m } | j j d | j j d t j j |  j d | j d t	 |  d |  d S(	   s   
        Log that an object has been successfully added.

        The default implementation creates an admin LogEntry object.
        i(   t   LogEntryt   ADDITIONt   user_idt   content_type_idR   t   object_reprt   action_flagN(
   t   django.contrib.admin.modelsR   R   t   objectst
   log_actionR   R   R	   t   get_for_modelR/   (   R>   RA   t   objectR   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   log_addition  s    	c         C   si   d d l  m } m } | j j d | j j d t j j |  j d | j d t	 |  d | d |  d	 S(
   s   
        Log that an object has been successfully changed.

        The default implementation creates an admin LogEntry object.
        i(   R   t   CHANGER   R   R   R   R   t   change_messageN(
   R   R   R   R   R   R   R   R	   R   R/   (   R>   RA   R   t   messageR   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt
   log_change  s    	c         C   s`   d d l  m } m } | j j d | j j d t j j |  j	  j d | j d | d |  d S(	   s   
        Log that an object will be deleted. Note that this method is called
        before the deletion.

        The default implementation creates an admin LogEntry object.
        i(   R   t   DELETIONR   R   R   R   R   N(
   R   R   R   R   R   R   R   R	   R   R   (   R>   RA   R   R   R   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   log_deletion%  s    	c         C   s   t  j j t  j t | j   S(   sE   
        A list_display column containing a checkbox widget.
        (   R   t   checkboxt   rendert   ACTION_CHECKBOX_NAMER/   R   (   R>   R~   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   action_checkbox5  s    s,   <input type="checkbox" id="action-toggle" />c         C   sD  d d l  m } |  j d k s. | | j k r5 t   Sg  } xN |  j j D]@ \ } } t | d | j d d   } | j	 | | | f  qH Wxk |  j
 j   d d d  D]M } t | d g   } | s q n  | j g  | D] }	 |  j |	  ^ q  q Wt d |  } t g  | D]$ \ } } }
 | | | |
 f f ^ q } | S(   s   
        Return a dictionary mapping the names of all actions for this
        ModelAdmin to a tuple of (callable, name, description) for each action.
        i(   t   IS_POPUP_VARt   short_descriptionRi   t    NR   (   R   R  R   RD   t   GETR&   RP   t   getattrt   replaceR   RJ   RX   R   t
   get_actiont   filter(   R>   RA   R  R   RN   t   funct   descriptionR^   t   class_actionst   actiont   desc(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_actions=  s"    #-1c         C   s`   g  | } xO t  j |  j |   D]5 \ } } } | | t |  j  f } | j |  q# W| S(   sy   
        Return a list of choices for use in a form object.  Each choice is a
        tuple (name, description).
        (   R*   t
   itervaluesR  R   R   R   (   R>   RA   t   default_choicesRE   R  RN   R  t   choice(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_action_choicesc  s
    
(c         C   s   t  |  r | } | j } nR t |  j |  rE t |  j |  } n+ y |  j j |  } Wn t k
 ro d SXt | d  r | j	 } n t
 | j d d   } | | | f S(   s   
        Return a given action from a parameter, which can either be a callable,
        or the name of a method on the ModelAdmin.  Return is a tuple of
        (callable, name, description).
        R  Ri   R  N(   t   callableR5   R   RJ   R  RP   R
  t   KeyErrorRD   R  R+   R	  (   R>   R  R  R  (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR
  n  s    c         C   s   |  j  S(   sd   
        Return a sequence containing the fields to be displayed on the
        changelist.
        (   t   list_display(   R>   RA   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_list_display  s    c         C   s)   |  j  s | r |  j  St |  d  Sd S(   s   
        Return a sequence containing the fields to be displayed as links
        on the changelist. The list_display parameter is the list of fields
        returned by get_list_display().
        i   N(   t   list_display_linksRs   (   R>   RA   R  (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_list_display_links  s    c         C   s   |  j  S(   s   
        Returns a sequence containing the fields to be displayed as filters in
        the right sidebar of the changelist page.
        (   R   (   R>   RA   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   get_list_filter  s    c   
   	   C   sq  g  } | j  r; | j t d  t | j  t d    n  | rRx| D]} xH | j D]= } | j t d  i t | j j  d 6t |  d 6 qX Wxd | j D]Y \ } } | j t d  i t | t d   d 6t | j j  d 6t |  d 6 q WxH | j	 D]= }	 | j t d  i t |	 j j  d 6t |	  d 6 q
WqH Wn  d	 j
 |  } | ppt d
  S(   sC   
        Construct a change message from a changed object.
        s   Changed %s.t   ands   Added %(name)s "%(object)s".RN   R   s+   Changed %(list)s for %(name)s "%(object)s".Rs   s   Deleted %(name)s "%(object)s".R  s   No fields changed.(   t   changed_dataR   Ri   R,   t   new_objectsR/   Rp   Rw   t   changed_objectst   deleted_objectsR   (
   R>   RA   R   t   formsetsR   t   formsett   added_objectt   changed_objectt   changed_fieldst   deleted_object(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   construct_change_message  s(    	,R0   c         C   s   t  | t  s y t t j | j    } Wq t k
 r t j j j   } d j	 d   | D  } t
 d | | f   q Xn  t j | | | d | d | d S(   s  
        Send a message to the user. The default implementation
        posts a message using the django.contrib.messages backend.

        Exposes almost the same API as messages.add_message(), but accepts the
        positional arguments in a different order to maintain backwards
        compatibility. For convenience, it accepts the `level` argument as
        a string rather than the usual level number.
        s   , c         s   s   |  ] } d  | Vq d S(   s   `%s`N(    (   t   .0R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pys	   <genexpr>  s    s7   Bad message level string: `%s`. Possible values are: %st
   extra_tagst   fail_silentlyN(   RG   t   intR  R   t	   constantst   uppert   AttributeErrort   DEFAULT_TAGSt   valuesR   t
   ValueErrort   add_message(   R>   RA   R   t   levelR*  R+  t   levelst   levels_repr(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   message_user  s    c         C   s   | j  d t  S(   s   
        Given a ModelForm return an unsaved instance. ``change`` is True if
        the object is being changed, and False if it's being added.
        t   commit(   t   savet   False(   R>   RA   R   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt	   save_form  s    c         C   s   | j    d S(   sA   
        Given a model instance save it to the database.
        N(   R9  (   R>   RA   R~   R   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt
   save_model  s    c         C   s   | j    d S(   sE   
        Given a model instance delete it from the database.
        N(   R   (   R>   RA   R~   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   delete_model  s    c         C   s   | j    d S(   sB   
        Given an inline formset save it to the database.
        N(   R9  (   R>   RA   R   R#  R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   save_formset  s    c         C   s8   | j    x' | D] } |  j | | | d | q Wd S(   sO  
        Given the ``HttpRequest``, the parent ``ModelForm`` instance, the
        list of inline formsets and a boolean value based on whether the
        parent is being added or changed, save the related objects to the
        database. Note that at this point save_form() and save_model() have
        already been called.
        R   N(   t   save_m2mR>  (   R>   RA   R   R"  R   R#  (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   save_related  s    
c         C   s:  |  j  j } | j } | j   }	 | j i | d 6| d 6|  j |  d 6|  j | |  d 6|  j | |  d 6t d 6t	 |  j  d  d 6|	 d	 6| d
 6| d 6t
 j j |  j   j d 6|  j d 6|  j d 6 | r |  j d  k	 r |  j }
 n	 |  j }
 t | |
 p'd | | j j   f d | d g | d |  j j S(   NR   R   RV   R   R   t   has_file_fieldt   get_absolute_urlt   has_absolute_urlt   ordered_objectst   form_urlR   R   t   save_ast   save_on_tops   admin/%s/%s/change_form.htmls   admin/%s/change_form.htmls   admin/change_form.htmlt   current_app(   R   Rp   R   R   R<   RV   R   R   R   R   R	   R   R   t   idRF  RG  t   add_form_templateRD   t   change_form_templateR$   t   object_namet   lowerRP   RN   (   R>   RA   t   contextR   R   RE  R~   R   R   RD  t   form_template(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   render_change_form  s2    		
	c         C   s  | j  } | j   } i t | j  d 6t |  d 6} d | j k rt d  | } |  j | |  | d k r t d | j	 | j
 f d | f d |  j j } n8 y$ | | } t j d t d	 d
 Wn t k
 r n Xd | j k r | d 7} n  t |  Sd | j k r4t d t |  t |  f  Sd | j k rpt d  | } |  j | |  t | j  St d  | } |  j | |  |  j | |  Sd S(   sE   
        Determines the HttpResponse for the add_view stage.
        RN   R~   t	   _continuesK   The %(name)s "%(obj)s" was added successfully. You may edit it again below.s   admin:%s_%s_changeR   RH  s   The use of string formats for post_url_continue in ModelAdmin.response_add() is deprecated. Provide a pre-formatted url instead.t
   stackleveli   t   _popups	   ?_popup=1s   <!DOCTYPE html><html><head><title></title></head><body><script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script></body></html>t   _addanothersR   The %(name)s "%(obj)s" was added successfully. You may add another %(name)s below.s.   The %(name)s "%(obj)s" was added successfully.N(   Rp   t   _get_pk_valR/   Rw   t   POSTRi   R7  RD   R   R   R   RP   RN   t   warningst   warnt   DeprecationWarningt	   TypeErrorR!   R    R'   R(   t   patht   response_post_save_add(   R>   RA   R~   t   post_url_continueR   t   pk_valuet   msg_dictt   msg(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   response_add  s@    	#	

c         C   s  |  j  j } | j   } i t | j  d 6t |  d 6} d | j k r t d  | } |  j | |  d | j k r t	 | j
 d  St	 | j
  Sn d | j k r t d  | } |  j | |  t	 t d	 | j | j f d
 | f d |  j j  Sd | j k rYt d  | } |  j | |  t	 t d | j | j f d |  j j  St d  | } |  j | |  |  j | |  Sd S(   sH   
        Determines the HttpResponse for the change_view stage.
        RN   R~   RQ  sM   The %(name)s "%(obj)s" was changed successfully. You may edit it again below.RS  s	   ?_popup=1t
   _saveasnewsK   The %(name)s "%(obj)s" was added successfully. You may edit it again below.s   admin:%s_%s_changeR   RH  RT  sT   The %(name)s "%(obj)s" was changed successfully. You may add another %(name)s below.s   admin:%s_%s_adds0   The %(name)s "%(obj)s" was changed successfully.N(   R   Rp   RU  R/   Rw   RV  Ri   R7  t   REQUESTR!   R[  R   R   R   RP   RN   t   response_post_save_change(   R>   RA   R~   R   R^  R_  R`  (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   response_changeK  s2    #			c         C   sk   |  j  j } |  j | d  rI t d | j | j f d |  j j } n t d d |  j j } t	 |  S(   sy   
        Figure out where to redirect after the 'Save' button has been pressed
        when adding a new object.
        s   admin:%s_%s_changelistRH  s   admin:indexN(
   R   Rp   R   RD   R   R   R   RP   RN   R!   (   R>   RA   R~   R   t   post_url(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR\  m  s    	c         C   sk   |  j  j } |  j | d  rI t d | j | j f d |  j j } n t d d |  j j } t	 |  S(   s   
        Figure out where to redirect after the 'Save' button has been pressed
        when editing an existing object.
        s   admin:%s_%s_changelistRH  s   admin:indexN(
   R   Rp   R   RD   R   R   R   RP   RN   R!   (   R>   RA   R~   R   Rf  (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyRd  |  s    	c         C   s  y t  | j j d d   } Wn t k
 r8 d } n X| j j   } | j t j d	  | j d d	  y% | j	 i | j
 d  | d 6 Wn t k
 r n X|  j | d d	 } |  j |  | j d _ | j   r| j d } | j d } |  j |  | \ } }	 }
 | j j
 t j  } | rW| rWt d  } |  j | |  d	 S| sr| j d |  } n  | |  | |  } t | t  r| St | j    Sn  t d  } |  j | |  d	 Sd	 S(
   s   
        Handle an admin action. This is called if a request is POSTed to the
        changelist; it returns an HttpResponse if the action was handled, and
        None otherwise.
        t   indexi    R  t   auto_idt   select_acrosssW   Items must be selected in order to perform actions on them. No items have been changed.t   pk__ins   No action selected.N(   R,  RV  RR   R2  R;   RC   R   R  RD   R<   t   getlistt
   IndexErrort   action_formR  Rx   RE   t   is_validt   cleaned_dataR  Ri   R7  R  RG   R    R!   t   get_full_path(   R>   RA   R   t   action_indext   dataRm  R  Ri  R  RN   R  t   selectedR`  t   response(    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   response_action  s>    

%c         C   s  |  j  } | j } |  j |  s* t  n  |  j |  } g  } |  j | d  } | j d k r| | j | j	  }	 |	 j
   r |  j | |	 d t }
 t } n t } |  j    }
 i  } x t |  j |  |  D] \ } } | j   } | j | d  d | | <| | d k s| r3d | | | f } n  | d | j d | j	 d |
 d	 d
 | j k d | d | j |   } | j |  q Wt |  r2| r2|  j | |
 |	 t  |  j | |	 | t  |  j | |
  |  j | |
  SnHt | j j    } xg | D]_ } y | j |  } Wn t j k
 r8qn Xt | t j   r| | j! d  | | <qqW| d |  }	 i  } x t |  j |  |  D] \ } } | j   } | j | d  d | | <| | d k s| rd | | | f } n  | d |  j    d | d | j |   } | j |  qWt" j# |	 t$ |  j% |   |  j& |  |  j' |  d |  } |  j( | j( } g  } x t | |  D] \ } } t$ | j% |   } t$ | j' |   } t | j& |   } t" j) | | | | | d |  } | j |  | | j( } qWi t* d  t+ | j,  d 6| d 6d | j- k d 6| d 6| d 6t" j. |	 |  d 6| j/ d 6} | j0 | pi   |  j1 | | d | d t S(   s$   The 'add' admin view for this model.RV  R   i    i   s   %s-%sRr  t   filest   instancet   save_as_newRb  t   prefixR   t   ,t   initialt   model_admins   Add %st   titlet	   adminformRS  t   is_popupR   t   inline_admin_formsetst   errorsR   RE  R   N(2   R   Rp   RV   R   R   R   RD   t   methodRV  t   FILESRn  R;  R:  R   t   zipR   t   get_default_prefixRR   R   R   R   R<  R@  R   Ra  RK   R  R   t	   get_fieldR   R   RG   RI   R   R   t	   AdminFormRs   R   R   R   R   t   InlineAdminFormSetRi   R/   Rw   Rc  t   AdminErrorListR   R<   RP  (   R>   RA   RE  t   extra_contextR   R   R   R"  R   R   t
   new_objectt   form_validatedt   prefixest   FormSetR   Ry  R#  R{  R   t   ft	   adminFormR   R  Ry   t   readonlyt   prepopulatedt   inline_admin_formsetRN  (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR     s    				%%	c         C   s	  |  j  } | j } |  j | t |   } |  j | |  sE t  n  | d k r t t d  i t	 | j
  d 6t |  d 6  n  | j d k r d | j k r |  j | d t d | j | j f d |  j j S|  j | |  } g  }	 |  j | |  }
 | j d k r| | j | j d	 | } | j   r[t } |  j | | d
 t } n t } | } i  } x t |  j | |  |
  D] \ } } | j   } | j | d  d | | <| | d k s| rd | | | f } n  | | j | j d	 | d | d | j |  } |	 j  |  qWt! |	  ri| ri|  j" | | | t  |  j# | | |	 t  |  j$ | | |	  } |  j% | | |  |  j& | |  Sn | d	 |  } i  } x t |  j | |  |
  D] \ } } | j   } | j | d  d | | <| | d k s| r4d | | | f } n  | d	 | d | d | j |   } |	 j  |  qWt' j( | |  j) | |  |  j* | |  |  j+ | |  d |  } |  j, | j, } g  } x t |
 |	  D] \ } } t- | j) | |   } t- | j+ | |   } t. | j* | |   } t' j/ | | | | | d |  } | j  |  | | j, } qWi	 t d  t	 | j
  d 6| d 6| d 6| d 6d | j0 k d 6| d 6| d 6t' j1 | |	  d 6| j d 6} | j2 | pi   |  j3 | | d
 t d | d | S(   s'   The 'change' admin view for this model.s8   %(name)s object with primary key %(key)r does not exist.RN   t   keyRV  Rb  RE  s   admin:%s_%s_addRH  Rw  R   i    i   s   %s-%sRy  R   R|  s	   Change %sR}  R~  R   t   originalRS  R  R   R  R  R   R~   N(4   R   Rp   R   R   R   R   RD   R   Ri   R/   Rw   R'   R  RV  R   R   R   R   RP   RN   R   R   R  Rn  R   R;  R:  R  R   R  RR   R   R   R   R<  R@  R(  R   Re  R   R  R   R   R   R   Rs   RK   R  Rc  R  R<   RP  (   R>   RA   R   RE  R  R   R   R~   R   R"  R   R   R  R  R  R  R   Ry  R#  R   R  R   R  Ry   R  R  R  RN  (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR   %  s    			6((	c         C   s  d d l  m } |  j j } | j } |  j | d.  s@ t  n  |  j |  } |  j	 | |  } |  j
 |  } |  j |  }	 |	 r d g t |  } n  |  j |  }
 yF |
 | |  j | | | |  j |  j |  j |  j |  j |  j |   } WnV t k
 rH| | j j   k r/t d i t d  d 6 St | j d | d  SXt } | j j t j  } |	 r| j  d	 k rd
 | j k rd | j k r| r|  j! | d | j" |  } | r| St# } qt d  } |  j$ | |  t# } n  |	 rr| j  d	 k rrt j | j k rrd
 | j k rrd | j k rr| rr|  j! | d | j" |  } | rf| St# } qrn  d. } | _% | j  d	 k r| j rd | j k r| r|  j& |  } | | j | j' d | j( } | _% | j)   rSd } x | j* D] } | j+   r|  j, | | d t# } |  j- | | | d t# |  j. | | d g  d t# |  j/ | | d.  } |  j0 | | |  | d 7} qqW| r| d k rt1 | j2  } n t1 | j3  } t4 d d |  i | d 6| d 6t1 |  d 6} |  j$ | |  n  t | j5    Sn4 | j rS|  j& |  } | d | j(  } | _% n  | rl|  j6 | j6 } n	 |  j6 } |	 r|  j7 d d.  } |  j8 |  | j9 d _: n d. } t4 d d | j;  } i t1 | j3  d 6t d  i t< | j(  d 6d 6| i | j; d 6d  6| j= d 6| j> d! 6| d" 6| d# 6|  j? |  d$ 6| d% 6| d& 6|  j@ d' 6|  jA d( 6|  jB d) 6} | jC | p}i   tD | |  jE pd* | | jF jG   f d+ | d, g | d- |  jH jI S(/   s>   
        The 'change list' admin view for this model.
        i(   t
   ERROR_FLAGR  s   admin/invalid_setup.htmls   Database errorR}  t   ?s   =1RV  Rg  t   _saveR   sW   Items must be selected in order to perform actions on them. No items have been changed.i    R   R"  i   s,   %(count)s %(name)s was changed successfully.s-   %(count)s %(name)s were changed successfully.t   countRN   R~   Rh  R  s   %(total_count)s selecteds   All %(total_count)s selectedR   s   0 of %(cnt)s selectedt   cntt   selection_notet   total_countt   selection_note_allR  t   clR   RV   R   Rm  t   actions_on_topt   actions_on_bottomt   actions_selection_counters   admin/%s/%s/change_list.htmls   admin/%s/change_list.htmls   admin/change_list.htmlRH  N(J   R   R  R   Rp   R   R   RD   R   R  R  R  R  Rs   R   R   t   search_fieldst   list_select_relatedt   list_per_paget   list_max_show_allR   R4   R  t   keysR#   Ri   R!   R[  R:  RV  Rk  R   R  R  Ru  R   R   R7  R#  R   R  t   result_listRn  R   t   has_changedR;  R<  R@  R(  R   R/   Rw   t   verbose_name_pluralR.   Rp  R   Rm  R  Rx   RE   t   result_countR   R}  R  RV   R  R  R  R<   R$   t   change_list_templateRL  RM  RP   RN   (   R>   RA   R  R  R   R   R  R  R   R   R   R  t   action_failedRs  Rt  R`  R#  R  t   changecountR   R~   t
   change_msgRN   R   Rm  R  RN  (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR     s    					%		!



c      	   C   su  |  j  j } | j } |  j | t |   } |  j | |  sH t  n  | d k r t t	 d  i t
 | j  d 6t |  d 6  n  t j |  j   } t | g | | j |  j |  \ } }	 }
 | j r|	 r t  n  t
 |  } |  j | | |  |  j | |  |  j | t	 d  i t
 | j  d 6t
 |  d 6 |  j | d  srt t d d |  j j  St t d | j | j f d |  j j  St
 | j  } |	 s|
 rt	 d	  i | d 6} n t	 d
  } i | d 6| d 6| d 6| d 6|	 d 6|
 d 6| d 6| d 6} | j | p,i   t | |  j pbd | | j j   f d | d g | d |  j j S(   s'   The 'delete' admin view for this model.s8   %(name)s object with primary key %(key)r does not exist.RN   R  s0   The %(name)s "%(obj)s" was deleted successfully.R~   s   admin:indexRH  s   admin:%s_%s_changelists   Cannot delete %(name)ss   Are you sure?R}  RL  R   R!  t   perms_lackingt	   protectedR   R   s$   admin/%s/%s/delete_confirmation.htmls!   admin/%s/delete_confirmation.htmls   admin/delete_confirmation.htmlN(    R   Rp   R   R   R   R   R   RD   R   Ri   R/   Rw   R'   R   t   db_for_writeR   R   RP   RV  R   R=  R7  R   R!   R   RN   R   R<   R$   t   delete_confirmation_templateRL  RM  (   R>   RA   R   R  R   R   R~   Rj   R!  t   perms_neededR  t   obj_displayRL  R}  RN  (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR     sT    		6'		7	
c         C   sD  d d l  m } |  j } t | d t |  } |  j | |  sL t  n  | j } | j } | j	 j
 d t |  d t j	 j |  j  j   j d  }	 i t d  t |  d 6|	 d	 6t t | j   d
 6| d 6| d 6| d 6}
 |
 j | p i   t | |  j p1d | | j j   f d | d g |
 d |  j j S(   s(   The 'history' admin view for this model.i(   R   R   R   t   content_type__id__exactt   action_times   Change history: %sR}  t   action_listR   R   R   R   s   admin/%s/%s/object_history.htmls   admin/%s/object_history.htmls   admin/object_history.htmlRH  (   R   R   R   R"   R   R   R   Rp   R   R   R  R	   R   RI  t   select_relatedR   Ri   R/   R+   R  R<   R$   t   object_history_templateRL  RM  RP   RN   (   R>   RA   R   R  R   R   R~   R   R   R  RN  (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR   Y  s0    					
(   s   __str__(    (    (    (    N(U   R5   R6   R   R  R  R   R:  R  R  R  R   R  RD   R   RF  RG  R   R   R   RJ  RK  R  R  t%   delete_selected_confirmation_templateR  R   R   t
   ActionFormRm  R   R  R  R  R@   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  R)   R  t
   allow_tagsR  R   R  R
  R  R  R  R(  R   t   INFOR7  R;  R<  R=  R>  R@  RP  Ra  Re  R\  Rd  Ru  t   csrf_protect_mR   t   commit_on_successR   R   R   R   R   (    (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR   :  s   								
							&											/	"			CUZ=t   InlineModelAdminc           B   s   e  Z d  Z d
 Z d
 Z e Z d Z d
 Z	 d
 Z
 d
 Z d
 Z e Z d   Z e d    Z d
 d  Z d
 d  Z d   Z d   Z d
 d  Z d
 d	  Z RS(   s   
    Options for inline editing of ``model`` instances.

    Provide ``name`` to specify the attribute name of the ``ForeignKey`` from
    ``model`` to its parent. This is required if ``model`` has more than one
    ``ForeignKey`` to its parent.
    i   c         C   s   | |  _  | |  _ |  j j |  _ t t |   j   |  j d  k rX |  j j j |  _ n  |  j
 d  k r| |  j j j
 |  _
 n  d  S(   N(   RP   t   parent_modelR   Rp   R   R   R  R@   Rw   RD   R  (   R>   R  RP   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR@     s    		c         C   s   t  j r d n d } d | d d | g } |  j rO | j d d | g  n  |  j sa |  j rw | j d d	 g  n  t j d
 g  | D] } t d |  ^ q  S(   NR0   s   .mins   jquery%s.jss   jquery.init.jss   inlines%s.jss	   urlify.jss   prepopulate%s.jss   SelectBox.jss   SelectFilter2.jsR   s   admin/js/%s(	   R   R   R   R   Rt   Ru   R   R   R   (   R>   R   R   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR     s    	c      	   K   sW  |  j  r t |  j   } n d } |  j d k r9 g  } n t |  j  } | j |  j | |   |  j d k r t |  j d  r |  j j	 j r | j |  j j	 j  n  | p d } |  j
 o |  j | |  } i	 |  j d 6|  j d 6|  j d 6| d 6| d 6t |  j d | d 6|  j d	 6|  j d
 6| d 6} | j |  t |  j |  j |  S(   sD   Returns a BaseInlineFormSet class for use in admin add/change views.Rp   R   R#  t   fk_nameRx   R   RA   R   R   R   t
   can_deleteN(   R   R   RD   R   Rs   R   R   R   R   Rp   R  R   R#  R  R   R_   R   R   R<   R   R  R   (   R>   RA   R~   R\   Rx   R   R  R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR     s.    		0





c         C   s^   |  j  r |  j  S|  j | |  j } t | j  t |  j | |   } d  i | d 6f g S(   NRx   (   R   R   R   Rs   R   R   RD   (   R>   RA   R~   R   Rx   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR     s
    	%c         C   s:   t  t |   j |  } |  j |  s6 | j   } n  | S(   N(   R   R  R   R   t   none(   R>   RA   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR     s    c         C   s@   |  j  j r |  j |  S| j j |  j  j d |  j  j    S(   NR   (   R   Rq   R   R   R   R   R   (   R>   RA   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyRV     s    	c         C   s{   |  j  } | j rZ xE | j D]7 } | j r | j j |  j k r | j j j } Pq q Wn  | j j | j	 d | j
    S(   NR   (   R   Rq   Rx   RS   RT   R  Rp   R   R   R   R   (   R>   RA   R~   R   R   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR     s    			c         C   sC   |  j  j r |  j | |  S| j j |  j  j d |  j  j    S(   NR   (   R   Rq   R   R   R   R   R   (   R>   RA   R~   (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR     s    	N(   R5   R6   R   RD   R   R  R   R#  R   R   t   templateRw   R  R   R  R@   R   R   R   R   R   RV   R   R   (    (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR  z  s$   	

!		
t   StackedInlinec           B   s   e  Z d  Z RS(   s   admin/edit_inline/stacked.html(   R5   R6   R  (    (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR    s   t   TabularInlinec           B   s   e  Z d  Z RS(   s   admin/edit_inline/tabular.html(   R5   R6   R  (    (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyR    s   (s   R;   t	   functoolsR    R   RW  t   djangoR   t   django.confR   t   django.forms.formsetsR   t   django.forms.modelsR   R   R   R   t"   django.contrib.contenttypes.modelsR	   t   django.contrib.adminR
   R   t   django.contrib.admin.utilR   R   R   R   t.   django.contrib.admin.templatetags.admin_staticR   t   django.contribR   t   django.views.decorators.csrfR   t   django.core.exceptionsR   R   t   django.core.paginatorR   t   django.core.urlresolversR   t	   django.dbR   R   R   t   django.db.models.constantsR   t   django.db.models.relatedR   t   django.db.models.fieldsR   R   t   django.db.models.sql.constantsR   t   django.httpR   R    R!   t   django.shortcutsR"   t   django.template.responseR#   R$   t   django.utils.decoratorsR%   t   django.utils.datastructuresR&   t   django.utils.htmlR'   R(   t   django.utils.safestringR)   t   django.utilsR*   t   django.utils.textR+   R,   t   django.utils.translationR-   Ri   R.   t   django.utils.encodingR/   R1   t   VERTICALRf   t	   ExceptionR4   t   SplitDateTimeFieldt   AdminSplitDateTimet   DateTimeFieldt   AdminDateWidgett	   DateFieldt   AdminTimeWidgett	   TimeFieldt   AdminTextareaWidgett	   TextFieldt   AdminURLFieldWidgett   URLFieldt   AdminIntegerFieldWidgett   IntegerFieldt   AdminBigIntegerFieldWidgett   BigIntegerFieldt   AdminTextInputWidgett	   CharFieldt   AdminFileWidgett
   ImageFieldt	   FileFieldR:   R  t   with_metaclasst   MediaDefiningClassR9   R   R  R  R  (    (    (    s5   ../Django//lib/python/django/contrib/admin/options.pyt   <module>   st   ""	
"    Du