Ñò
•ôÉLc           @   s  d  d k  Z  d  d k l Z d  d k l Z d  d k l Z d  d k l	 Z	 d  d k
 l Z d  d k l Z d  d k l Z d  d	 k l Z e  i d
 e  i ƒ Z d e	 i f d „  ƒ  YZ d e i f d „  ƒ  YZ e i i e e ƒ d e	 i f d „  ƒ  YZ d e i f d „  ƒ  YZ e i i e e ƒ e i i e ƒ d e i f d „  ƒ  YZ d e f d „  ƒ  YZ  e i i e e  ƒ d S(   iÿÿÿÿN(   t   ugettext_lazy(   t	   UserAdmin(   t   User(   t   forms(   t   admin(   t   Language(   t   Project(   t   PootleProfiles(   ^[a-z]{2,}([_-][a-z]{2,})*(@[a-z0-9]+)?$t   MyLanguageAdminFormc           B   s   e  Z d  „  Z RS(   c         C   sQ   |  i  d d j o1 t i |  i  d ƒ o t i t d ƒ ƒ ‚ n |  i  d S(   Nt   codet	   templatess0   Language code does not follow the ISO convention(   t   cleaned_datat   LANGCODE_REt   matchR   t   ValidationErrort   _(   t   self(    (    s.   /var/www/Pootle/local_apps/pootle_app/admin.pyt
   clean_code%   s    -(   t   __name__t
   __module__R   (    (    (    s.   /var/www/Pootle/local_apps/pootle_app/admin.pyR   $   s   t   LanguageAdminc           B   s@   e  Z d Z d Z d	 h d
 d 6f d h d d 6f f Z e Z RS(   R	   t   fullnamet   specialcharst   fieldss   Plural informationt   npluralst   pluralequation(   s   codes   fullname(   s   codes   fullnameN(   s   codes   fullnames   specialchars(   s   npluralss   pluralequation(   R   R   t   list_displayt   list_display_linkst   Nonet	   fieldsetsR   t   form(    (    (    s.   /var/www/Pootle/local_apps/pootle_app/admin.pyR   +   s   
t   MyProjectAdminFormc           B   s   e  Z d  „  Z RS(   c         C   s>   t  i d |  i d ƒ o t i t d ƒ ƒ ‚ n |  i d S(   Ns   [^a-zA-Z0-9_]R	   s4   Project code may only contain letters, numbers and _(   t   ret   searchR   R   R   R   (   R   (    (    s.   /var/www/Pootle/local_apps/pootle_app/admin.pyR   ?   s    (   R   R   R   (    (    (    s.   /var/www/Pootle/local_apps/pootle_app/admin.pyR   =   s   t   ProjectAdminc           B   sj   e  Z d
 Z d Z h d d 6Z h e i d 6Z d h d d 6f e	 d ƒ h d d 6d d 6f f Z
 e Z RS(   R	   R   t   descriptiont   localfiletypet	   treestyleR   s   Advanced Optionst   collapset   classest   ignoredfiles(   s   codes   fullnames   descriptions   localfiletype(   s   codes   fullname(   s   codeN(   s   codes   fullnames   descriptions   localfiletype(   s   collapse(   s	   treestyles   ignoredfiles(   R   R   R   R   t   prepopulated_fieldsR   t   VERTICALt   radio_fieldsR   R   R   R   R   (    (    (    s.   /var/www/Pootle/local_apps/pootle_app/admin.pyR"   D   s   
t   PootleProfileInlinec           B   s   e  Z e Z RS(    (   R   R   R   t   model(    (    (    s.   /var/www/Pootle/local_apps/pootle_app/admin.pyR,   [   s   t   MyUserAdminc           B   s   e  Z e g Z RS(    (   R   R   R,   t   inlines(    (    (    s.   /var/www/Pootle/local_apps/pootle_app/admin.pyR.   ^   s   (!   R    t   django.utils.translationR    R   t   django.contrib.auth.adminR   t   django.contrib.auth.modelsR   t   djangoR   t   django.contribR   t   pootle_language.modelsR   t   pootle_project.modelsR   t   pootle_profile.modelsR   t   compilet
   IGNORECASER   t	   ModelFormR   t
   ModelAdminR   t   sitet   registerR   R"   t
   unregistert   StackedInlineR,   R.   (    (    (    s.   /var/www/Pootle/local_apps/pootle_app/admin.pyt   <module>   s&   