Ńņ
¤.Jc           @   s\   d  Z  d d k l Z d d k l Z d d k l Z d d k l Z d   Z	 d   Z
 d S(	   s   
Utility functions for retrieving and generating forms for the
site-specific user profile model specified in the
``AUTH_PROFILE_MODULE`` setting.

i’’’’(   t   forms(   t   settings(   t   SiteProfileNotAvailable(   t	   get_modelc          C   sY   t  t d  p t i o
 t  n t t i i d    }  |  d j o
 t  n |  S(   sė   
    Return the model class for the currently-active user profile
    model, as defined by the ``AUTH_PROFILE_MODULE`` setting. If that
    setting is missing, raise
    ``django.contrib.auth.models.SiteProfileNotAvailable``.
    
    t   AUTH_PROFILE_MODULEt   .N(   t   hasattrR   R   R   R   t   splitt   None(   t   profile_mod(    (    s/   /var/www/Pootle/external_apps/profiles/utils.pyt   get_profile_model   s    

c             s,   t      d t i f   f d     Y}  |  S(   s:  
    Return a form class (a subclass of the default ``ModelForm``)
    suitable for creating/editing instances of the site-specific user
    profile model, as defined by the ``AUTH_PROFILE_MODULE``
    setting. If that setting is missing, raise
    ``django.contrib.auth.models.SiteProfileNotAvailable``.
    
    t   _ProfileFormc              s!   e  Z d  d   f d     YZ RS(   t   Metac              s   e  Z   Z d Z RS(   t   user(   s   user(   t   __name__t
   __module__t   modelt   exclude(    (   R	   (    s/   /var/www/Pootle/external_apps/profiles/utils.pyR   *   s   (    (   R   R   R   (    (   R	   (    s/   /var/www/Pootle/external_apps/profiles/utils.pyR   )   s   (   R
   R    t	   ModelForm(   R   (    (   R	   s/   /var/www/Pootle/external_apps/profiles/utils.pyt   get_profile_form   s    		N(   t   __doc__t   djangoR    t   django.confR   t   django.contrib.auth.modelsR   t   django.db.modelsR   R
   R   (    (    (    s/   /var/www/Pootle/external_apps/profiles/utils.pyt   <module>   s   	