î
Þ^Q\  ã               @   s    d  Z  Gd d „  d e ƒ Z d S)z*GM2MField support for autocomplete fields.c               @   s.   e  Z d  Z d Z d d „  Z d d „  Z d S)ÚGM2MFieldMixinzGM2MField ror FutureModelForm.c             C   s-   | j  s d Sd d „  t | | ƒ j ƒ  Dƒ S)z5Return the list of objects in the GM2MField relation.Nc             S   s"   g  |  ] } t  | d  | ƒ ‘ q S)Zgm2m_tgt)Úgetattr)Ú.0Úx© r   úD/var/www/dbchiro/venv/lib/python3.4/site-packages/dal_gm2m/fields.pyú
<listcomp>
   s   	z4GM2MFieldMixin.value_from_object.<locals>.<listcomp>)Úpkr   Úall)ÚselfÚinstanceÚnamer   r   r   Úvalue_from_object   s    	z GM2MFieldMixin.value_from_objectc             C   s   t  | | | ƒ d S)z%Save the relation into the GM2MField.N)Úsetattr)r
   r   r   Úvaluer   r   r   Úsave_relation_data   s    z!GM2MFieldMixin.save_relation_dataN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s   r   N)r   Úobjectr   r   r   r   r   Ú<module>   s   