ó
i4Vdc           @   s^   d  Z  d d l Z d d l m Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d d „ Z	 d S(	   s  
Convenience routines for creating non-trivial Field subclasses, as well as
backwards compatibility utilities.

Add SubfieldBase as the metaclass for your Field subclass, implement
to_python() and the other necessary methods and everything will work
seamlessly.
iÿÿÿÿN(   t   RemovedInDjango110Warningt   SubfieldBasec           B   s   e  Z d  Z d „  Z RS(   s…   
    A metaclass for custom Field subclasses. This ensures the model's attribute
    has the descriptor protocol attached to it.
    c         C   sV   t  j d t d d ƒt t |  ƒ j |  | | | ƒ } t | | j d ƒ ƒ | _ | S(   NsB   SubfieldBase has been deprecated. Use Field.from_db_value instead.t
   stackleveli   t   contribute_to_class(	   t   warningst   warnR    t   superR   t   __new__t   make_contribt   getR   (   t   clst   namet   basest   attrst	   new_class(    (    sq   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/db/models/fields/subclassing.pyR      s    	!(   t   __name__t
   __module__t   __doc__R   (    (    (    sq   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/db/models/fields/subclassing.pyR      s   t   Creatorc           B   s,   e  Z d  Z d „  Z d d „ Z d „  Z RS(   sT   
    A placeholder class that provides a way to set the attribute on the model.
    c         C   s   | |  _  d  S(   N(   t   field(   t   selfR   (    (    sq   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/db/models/fields/subclassing.pyt   __init__#   s    c         C   s!   | d  k r |  S| j |  j j S(   N(   t   Nonet   __dict__R   R   (   R   t   objt   type(    (    sq   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/db/models/fields/subclassing.pyt   __get__&   s    c         C   s#   |  j  j | ƒ | j |  j  j <d  S(   N(   R   t	   to_pythonR   R   (   R   R   t   value(    (    sq   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/db/models/fields/subclassing.pyt   __set__+   s    N(   R   R   R   R   R   R   R   (    (    (    sq   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/db/models/fields/subclassing.pyR      s   	c            s   ‡  ‡ f d †  } | S(   sP  
    Returns a suitable contribute_to_class() method for the Field subclass.

    If 'func' is passed in, it is the existing contribute_to_class() method on
    the subclass and it is called before anything else. It is assumed in this
    case that the existing contribute_to_class() calls all the necessary
    superclass methods.
    c            sU   ˆ  r ˆ  |  | | |  n t  ˆ |  ƒ j | | |  t | |  j t |  ƒ ƒ d  S(   N(   R   R   t   setattrR   R   (   R   R
   R   t   kwargs(   t   funct
   superclass(    sq   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/db/models/fields/subclassing.pyR   8   s    (    (   R!   R    R   (    (   R    R!   sq   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/db/models/fields/subclassing.pyR   /   s    	(
   R   R   t   django.utils.deprecationR    R   R   t   objectR   R   R   (    (    (    sq   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/db/models/fields/subclassing.pyt   <module>   s
   