
     h                        d 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 ddlmZmZ ddlmZ dd	lmZmZmZmZ dd
lmZmZ ddlmZ ddlmZ  dZ!dZ"d5dZ#d5dZ$d Z%	 	 	 	 	 	 	 	 	 d6dddZ& G d d          Z' G d de          Z( G d dee	          Z) G d de)e(          Z*e*dddddddddf
dZ+ G d  d!ee	          Z,e*de,d"d#d#ddddd#dddddd#ddddd#fd$Z- G d% d&e,          Z.d7d'Z/e*e.dddd(d#ddddd#dddddd#ddddd#fd)Z0 G d* d+e          Z1 G d, d-          Z2 G d. d/          Z3 G d0 d1e          Z4 G d2 d3e4          Z5d4 Z6dS )8z[
Helper functions for creating Form classes from Django models
and database field objects.
    )chain)NON_FIELD_ERRORS
FieldErrorImproperlyConfiguredValidationError)
AltersData)ChoiceFieldField)BaseFormDeclarativeFieldsMetaclass)BaseFormSetformset_factory)	ErrorList)HiddenInputMultipleHiddenInputRadioSelectSelectMultiple)capfirstget_text_listgettext)gettext_lazy)	ModelFormBaseModelFormmodel_to_dictfields_for_modelModelChoiceFieldModelMultipleChoiceField
ALL_FIELDSBaseModelFormSetmodelformset_factoryBaseInlineFormSetinlineformset_factorymodelform_factory__all__Nc                    ddl m} |j        }| j        }g }|j        D ]"}|j        rt          ||j                  s	|j        |vr)|
|j        |vr5|r
|j        |v rA|	                                r| |j                 j
        j                            | j        | j        |                     |j                            r2|                    |j                  | |j                 j
        j        v rt          ||j                  r|                    |           |                    |||j                            $|D ]#}|                    |||j                            $|S )z
    Construct and return a model instance from the bound ``form``'s
    ``cleaned_data``, but do not save the returned instance to the database.
    r   )models)	django.dbr'   _metacleaned_datafieldseditable
isinstance	AutoFieldnamehas_defaultfieldwidgetvalue_omitted_from_datadatafiles
add_prefixgetempty_values	FileFieldappendsave_form_data)	forminstancer+   excluder'   optsr*   file_field_listfs	            R/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/django/forms/models.pyconstruct_instancerC   .   s   
 !     >D$LO[ = =
	!V-..	 v\))!&"6"6 	qv(( MMOO	QV")AA	4:tqv'>'> 	
   ((DL,>,KKK a)** 	=""1%%%%X|AF';<<<< 9 9	<#78888O    c                     | j         }i }t          |j        |j        |j                  D ]I}t          |dd          s|
|j        |vr |r
|j        |v r,|                    |           ||j        <   J|S )a  
    Return a dict containing the data in ``instance`` suitable for passing as
    a Form's ``initial`` keyword argument.

    ``fields`` is an optional list of field names. If provided, return only the
    named.

    ``exclude`` is an optional list of field names. If provided, exclude the
    named from the returned dict, even if they are listed in the ``fields``
    argument.
    r,   F)r)   r   concrete_fieldsprivate_fieldsmany_to_manygetattrr/   value_from_object)r=   r+   r>   r?   r4   rA   s         rB   r   r   ^   s     >DD4')<d>OPP 5 5q*e,, 	!&"6"6 	qv((**844QVKrD   c                    ddl m}m}m} t	          | d          rt	          | d          r|                                 }|r|}t          ||          s |di |}| | |d                    z  }| j                             || j        j	        j
                            |                              | _        dS dS dS dS )	z=Apply limit_choices_to to the formfield's queryset if needed.r   )ExistsOuterRefQquerysetget_limit_choices_topkrQ   N )django.db.modelsrL   rM   rN   hasattrrP   r-   rO   filtermodel_base_manager)	formfieldrL   rM   rN   limit_choices_tocomplex_filters         rB   #apply_limit_choices_to_to_formfieldr\   w   s   4444444444y*%% 
')=S*T*T 
$99;; 	-Nna00 7!"!6!6%5!6!6aa88D>>2222N!*!3!:!:y)/=DD^TTUU" "I
 
 
 
	 	rD   Tapply_limit_choices_toc
                   i g | j         }ddlm fd|j        D             }t	          t          |j        ||j                            D ]w}t          |dd          s7|4|j	        |v r+	|j	        vr t          d|j	        d| j        d	          K|
|j	        |vrWr
|j	        v rci }|r|j	        |v r||j	                 |d
<   |t          k    s|r|j	        |v rd|d<   |r|j	        |v r||j	                 |d<   |r|j	        |v r||j	                 |d<   |r|j	        |v r||j	                 |d<   |	r|j	        |	v r|	|j	                 |d<   | |j        di |}n't          |          st          d           ||fi |}|r|
rt!          |           ||j	        <   ]                    |j	                   y|rfd|D             S )a4  
    Return a dictionary containing form fields for the given model.

    ``fields`` is an optional list of field names. If provided, return only the
    named fields.

    ``exclude`` is an optional list of field names. If provided, exclude the
    named fields from the returned fields, even if they are listed in the
    ``fields`` argument.

    ``widgets`` is a dictionary of model field names mapped to a widget.

    ``formfield_callback`` is a callable that takes a model field and returns
    a form field.

    ``localized_fields`` is a list of names of fields which should be localized.

    ``labels`` is a dictionary of model field names mapped to a label.

    ``help_texts`` is a dictionary of model field names mapped to a help text.

    ``error_messages`` is a dictionary of model field names mapped to a
    dictionary of error messages.

    ``field_classes`` is a dictionary of model field names mapped to a form
    field class.

    ``apply_limit_choices_to`` is a boolean indicating if limit_choices_to
    should be applied to a field's queryset.
    r   )r
   c                 4    g | ]}t          |          |S rS   )r-   ).0rA   
ModelFields     rB   
<listcomp>z$fields_for_model.<locals>.<listcomp>   s8       *Q
*C*C	  rD   r,   FN'z' cannot be specified for z) model form as it is a non-editable fieldr2   Tlocalizelabel	help_texterror_messages
form_classz1formfield_callback must be a function or callablec                 P    i | ]"}r|v|v|                     |          #S rS   )r7   )ra   rA   r>   
field_dictignoreds     rB   
<dictcomp>z$fields_for_model.<locals>.<dictcomp>   sP     
 
 

  !//Qg5E5E z~~a  5E5E5ErD   rS   )r)   rT   r
   rG   sortedr   rF   rH   rI   r/   r   __name__r   rY   callable	TypeErrorr\   r:   )rW   r+   r>   widgetsformfield_callbacklocalized_fieldslabels
help_textsrh   field_classesr^   r?   sortable_private_fieldsrA   kwargsrY   rb   rk   rl   s     `             @@@rB   r   r      s   X JG;D444444   &   d"$;T=NOO  /# /# q*e,, 
	"Ff$$_g(=(= j,-FFFENNND   !&"6"6 	qv(( 	/qv((&qvF8z)) *!"+;!;!;!%F: 	-af&&$QVnF7O 	5!&J..",QV"4F; 	>af66'5af'=F#$ 	9QV}44#0#8F< %#--f--II,-- 	8OPPP**17777I 	#% ?3I>>>!*JqvNN16"""" 

 
 
 
 
 

 
 


 rD   c                       e Zd ZddZdS )ModelFormOptionsNc                    t          |dd           | _        t          |dd           | _        t          |dd           | _        t          |dd           | _        t          |dd           | _        t          |dd           | _        t          |dd           | _        t          |dd           | _        t          |d	d           | _	        t          |d
d           | _
        d S )NrW   r+   r>   rr   rt   ru   rv   rh   rw   rs   )rI   rW   r+   r>   rr   rt   ru   rv   rh   rw   rs   )selfoptionss     rB   __init__zModelFormOptions.__init__   s    Wgt44
gx66w	488w	488 '1CT J Jgx66!'<>>%g/?FF$WotDD")'3G"N"NrD   N)ro   
__module____qualname__r   rS   rD   rB   r{   r{      s.        
O 
O 
O 
O 
O 
OrD   r{   c                        e Zd Z fdZ xZS )ModelFormMetaclassc                    t                                          | |||          }|t          fk    r|S t          t	          |dd                     x}|_        dD ]O}t	          ||          }t          |t                    r(|t          k    rd|j	        ||dz  }t          |          P|j        r|j        |j        t          d|z            |j        t          k    rd |_        t          |j        |j        |j        |j        |j        |j        |j        |j        |j        |j        d          }	d |	                                D             }
|
                    |j                  }|r5d	}|d
                    |          |j        j	        fz  }t7          |          |	                    |j                   n|j        }	|	|_        |S )NMeta)r+   r>   rt   zP%(model)s.Meta.%(opt)s cannot be a string. Did you mean to type: ('%(value)s',)?)rW   optvaluez|Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited; form %s needs updating.Fr]   c                     h | ]	\  }}||
S rS   rS   )ra   kvs      rB   	<setcomp>z-ModelFormMetaclass.__new__.<locals>.<setcomp><  s!     G G Gtq!Q G G G GrD   z&Unknown field(s) (%s) specified for %sz, )super__new__r   r{   rI   r)   r-   strr   ro   rq   rW   r+   r>   r   r   rr   rs   rt   ru   rv   rh   rw   items
differencedeclared_fieldsjoinr   updatebase_fields)mcsr/   basesattrs	new_classr?   r   r   msgr+   none_model_fieldsmissing_fieldsmessage	__class__s                rB   r   zModelFormMetaclass.__new__  s   GGOOCue<<	]$$$!1')VT2R2R!S!SSy
 = 	% 	%CD#&&E%%% 
%%:*=*=< "+!3"!&    nn$: (	/{"t|';*&(,-   {j(( #%
'%#"',  F  !H Gv||~~ G G G.99):STTN *BDIIn55tz7JKK ))) MM)34444.F &	rD   )ro   r   r   r   __classcell__r   s   @rB   r   r     sA        E E E E E E E E ErD   r   c                   p     e Zd Zdddddedddddf fd	Zd Zd Zd Zd Zd	 Z	d
 Z
ddZde_         xZS )r   Nid_%sFc                    | j         }|j        t          d          |	|                                | _        i }n"|	| _        t	          |	|j        |j                  }||                    |           d| _        t                      
                    |||||||||
|
  
         | j                                        D ]}t          |           d S )Nz'ModelForm has no model class specified.F)use_required_attributerenderer)r)   rW   
ValueErrorr=   r   r+   r>   r   _validate_uniquer   r   valuesr\   )r}   r4   r5   auto_idprefixinitialerror_classlabel_suffixempty_permittedr=   r   r   r?   object_datarY   r   s                  rB   r   zBaseModelForm.__init__N  s     z:FGGG JJLLDMKK$DM'$+t|LLKw''' !&#9 	 	
 	
 	
 ++-- 	; 	;I/	::::	; 	;rD   c                 p   t                      }| j        j        j        D ]}|j        }|| j        vr|                    |j                   .| j        j        r)|| j        j        vr|                    |j                   c| j        j        r)|| j        j        v r|                    |j                   || j        v r|                    |j                   | j        |         }| j        	                    |          }|j
        s*|j        s#||j        v r|                    |j                   |S )z
        For backwards-compatibility, exclude several types of fields from model
        validation. See tickets #12507, #12521, #12553.
        )setr=   r)   r+   r/   addr>   _errorsr*   r7   blankrequiredr8   )r}   r>   rA   r1   
form_fieldfield_values         rB   _get_validation_exclusionsz(BaseModelForm._get_validation_exclusions|  sD   
 %% $+ "	( "	(AFE DK''AF####
 " (uDJ4E'E'EAF##### (1C(C(CAF#### $,&&AF#### "[/
"/33E::(&/( $z'>>>KK'''rD   c                     d| _         | j        S )NT)r   r*   r}   s    rB   cleanzBaseModelForm.clean  s     $  rD   c                    | j         }t          |d          r|j        }n	t          |i}|                                D ]\  }}|t          k    r(|j        r!t          |j        v r|j        t                   }n|| j        v r| j        |         j        }nU|D ]2}t          |t                    r|j	        |v r||j	                 |_
        3|                     d |           d S )N
error_dict)r)   rU   r   r   r   rh   r+   r-   r   coder   	add_error)r}   errorsr?   r   r1   messagesrh   r   s           rB   _update_errorszBaseModelForm._update_errors  s    z 6<(( 	4*JJ*F3J)//11 	C 	COE8)))' *$(;;;!%!45E!F$+%%!%U!3!B# C Cw88C66&4W\&BGOC 	tV$$$$$rD   c                 D   | j         }|                                 }| j                                        D ]/\  }}t	          |t
                    r|                    |           0	 t          | | j        |j        |j	                  | _        n,# t          $ r}|                     |           Y d }~nd }~ww xY w	 | j                            |d           n,# t          $ r}|                     |           Y d }~nd }~ww xY w| j        r|                                  d S d S )NF)r>   validate_unique)r)   r   r+   r   r-   InlineForeignKeyFieldr   rC   r=   r>   r   r   
full_cleanr   r   )r}   r?   r>   r/   r1   es         rB   _post_cleanzBaseModelForm._post_clean  sb   z1133  ;,,.. 	" 	"KD%%!677 "D!!!	#.dmT[$, DMM  	# 	# 	#""""""""	#	#M$$We$LLLL 	# 	# 	#""""""""	#   	#  """""	# 	#s0   &&B 
B6B11B6:C 
D !C;;D c                     |                                  }	 | j                            |           dS # t          $ r }|                     |           Y d}~dS d}~ww xY w)z
        Call the instance's validate_unique() method and update the form's
        validation errors if any were raised.
        )r>   N)r   r=   r   r   r   )r}   r>   r   s      rB   r   zBaseModelForm.validate_unique  s~    
 1133	#M))')::::: 	# 	# 	#"""""""""	#s   3 
AAAc                 F   | j         }| j        j        }| j        j        }| j        j        }t          |j        |j                  D ]Z}t          |d          s|r
|j	        |vr|r
|j	        |v r+|j	        |v r&|
                    | j        ||j	                            [dS )zS
        Save the many-to-many fields and generic relations for this form.
        r;   N)r*   r)   r>   r+   r=   r   rH   rG   rU   r/   r;   )r}   r*   r>   r+   r?   rA   s         rB   	_save_m2mzBaseModelForm._save_m2m  s     (*$"}" t($*=>> 	F 	FA1.//  !&.. 16W,,v%%  QV0DEEE	F 	FrD   Tc                    | j         r8t          d| j        j        j        d| j        j        j        rdndd          |r.| j                                         |                                  n| j        | _	        | j        S )z
        Save this form's self.instance object if commit=True. Otherwise, add
        a save_m2m() method to the form which can be called after the instance
        is saved manually at a later time. Return the model instance.
        zThe z could not be createdchangedz" because the data didn't validate.)
r   r   r=   r)   object_name_stateaddingsaver   save_m2m)r}   commits     rB   r   zBaseModelForm.save  s     ; 	* M'333!%!5!<KII)KK    	+M   NN !NDM}rD   T)ro   r   r   r   r   r   r   r   r   r   r   r   alters_datar   r   s   @rB   r   r   M  s         #,; ,; ,; ,; ,; ,;\+ + +Z! ! !% % %B# # #@	# 	# 	#F F F*   0 DrD   r   c                       e Zd ZdS )r   N)ro   r   r   rS   rD   rB   r   r   )  s        DrD   r   )	metaclassc                    d| i}|||d<   |||d<   |||d<   |||d<   |||d<   |||d<   |	|	|d	<   |
|
|d
<   t          |d          r|j        fnd}t          d||          }|rt          |          |_        | j        dz   }d|i}t          |dd           t          |dd          t          d           t          |          ||f|          S )al  
    Return a ModelForm containing form fields for the given model. You can
    optionally pass a `form` argument to use as a starting point for
    constructing the ModelForm.

    ``fields`` is an optional list of field names. If provided, include only
    the named fields in the returned fields. If omitted or '__all__', use all
    fields.

    ``exclude`` is an optional list of field names. If provided, exclude the
    named fields from the returned fields, even if they are listed in the
    ``fields`` argument.

    ``widgets`` is a dictionary of model field names mapped to a widget.

    ``localized_fields`` is a list of names of fields which should be localized.

    ``formfield_callback`` is a callable that takes a model field and returns
    a form field.

    ``labels`` is a dictionary of model field names mapped to a label.

    ``help_texts`` is a dictionary of model field names mapped to a help text.

    ``error_messages`` is a dictionary of model field names mapped to a
    dictionary of error messages.

    ``field_classes`` is a dictionary of model field names mapped to a form
    field class.
    rW   Nr+   r>   rr   rt   ru   rv   rh   rw   r   rS   FormzZCalling modelform_factory without defining 'fields' or 'exclude' explicitly is prohibited.)rU   r   typestaticmethodrs   ro   rI   r   )rW   r<   r+   r>   rs   rr   rt   ru   rv   rh   rw   r   r   r   
class_nameform_class_attrss                   rB   r$   r$   -  sI   ` eE h"i"i#$4 ! h(l!"0 !.o $D&119TYLLrEu%%D C"./A"B"B&(J ~tXt$$,y$1O1O1W"2
 
 	
 4::j4'+;<<<rD   c                        e Zd ZdZdZdZ e            Z	 	 	 	 	 ddd fdZ fdZ	d Z
d	 Z fd
Zd ZddZddZddZddZde_        d Zd Zd Zd Zd ZddZddZ fdZ xZS )r    zO
    A ``FormSet`` for editing a queryset and/or adding new objects to it.
    NFr   )r   c          	      d    || _         || _         t                      j        di ||||d| d S )N)r4   r5   r   r   rS   )rO   initial_extrar   r   )	r}   r4   r5   r   r   rO   r   ry   r   s	           rB   r   zBaseModelFormSet.__init__  sc     !$ 	
 	
" 	 
 	
 	
 	
 	
 	
rD   c                     | j         s!t          |                                           S t                                                      S )z=Return the number of forms that are required in this FormSet.)is_boundlenget_querysetr   initial_form_countr}   r   s    rB   r   z#BaseModelFormSet.initial_form_count  s=    } 	,t((**+++ww))+++rD   c                     t          | d          s#d |                                 D             | _        | j                            |          S )N_object_dictc                     i | ]
}|j         |S rS   rR   )ra   os     rB   rm   z5BaseModelFormSet._existing_object.<locals>.<dictcomp>  s     F F FQq F F FrD   )rU   r   r   r7   )r}   rQ   s     rB   _existing_objectz!BaseModelFormSet._existing_object  sN    t^,, 	G F F$2C2C2E2E F F FD $$R(((rD   c                 ^    |j          |j                                         }|j          |j        S )z
        If the field is a related field, fetch the concrete field's (that
        is, the ultimate pointed-to field's) to_python.
        )remote_fieldget_related_field	to_pythonr}   r1   s     rB   _get_to_pythonzBaseModelFormSet._get_to_python  s4    
  ,&88::E  ,rD   c                    ||                                  k     }|r| j        r|                     |          d| j        j        j        j        }	 | j        |         }|                     | j        j        j                  }	  ||          }| 	                    |          |d<   n|# t          $ r Y npw xY w# t          $ r Y n`w xY w|                                 |         |d<   n>| j        r7	 | j        ||                                  z
           |d<   n# t          $ r Y nw xY w t                      j        |fi |}|r&d|j        | j        j        j        j                 _        |S )N-r=   r   T)r   r   r6   rW   r)   rQ   r/   r4   r   r   r   KeyErrorr   r   
IndexErrorr   _construct_formr+   r   )	r}   iry   pk_requiredpk_keyrQ   r   r<   r   s	           rB   r   z BaseModelFormSet._construct_form  s   $11333 	} <$(OOA$6$6$6$6
8H8K8P8PQG6*B !% 3 3DJ4D4G H HIG&Yr]] .2-B-B2-F-Fz** +          D &*%6%6%8%8%;z"" 	$($6q4;R;R;T;T7T$Uy!!   &uww&q33F33 	B=ADK
(+01:s6   B8 B( (
B54B58
CC.%D 
D! D!c                     t          | d          sd| j        | j        }n| j        j                                        }|j        s)|                    | j        j        j        j	                  }|| _
        | j
        S )N	_queryset)rU   rO   rW   _default_managerr   orderedorder_byr)   rQ   r/   r   )r}   qss     rB   r   zBaseModelFormSet.get_queryset  st    t[)) 	 }(]Z0==??
 : ;[[!1!4!9::
  DN~rD   Tc                 .    |                     |          S )z8Save and return a new model instance for the given form.r   r   )r}   r<   r   s      rB   save_newzBaseModelFormSet.save_new      yyy'''rD   c                 .    |                     |          S )z>Save and return an existing model instance for the given form.r  r  )r}   r<   r=   r   s       rB   save_existingzBaseModelFormSet.save_existing  r  rD   c                 6    |r|                                  dS dS )z#Deletes an existing model instance.N)delete)r}   objr   s      rB   delete_existingz BaseModelFormSet.delete_existing  s%     	JJLLLLL	 	rD   c                      |sg  _          fd}| _         j        r                     |          S                      |                               |          z   S )z
        Save model instances for every form, adding and changing instances
        as necessary, and return the list of instances.
        c                  D    j         D ]} |                                  d S r   )saved_formsr   )r<   r}   s    rB   r   z'BaseModelFormSet.save.<locals>.save_m2m  s.     , $ $DMMOOOO$ $rD   )r  r   	edit_onlysave_existing_objectssave_new_objects)r}   r   r   s   `  rB   r   zBaseModelFormSet.save   s}    
  	%!D$ $ $ $ $ %DM> 	V--f555--f558M8Mf8U8UUUrD   c                 .    |                                   d S r   )r   r   s    rB   r   zBaseModelFormSet.clean  s    rD   c                 R    t                      }t                      } j        fd j        D             }|D ]_                                }j                            |d          \  }}|                    |           |                    |           `g }|D ]\  }}	t                      }
|D ]Ê fd|	D             }t          d |D                       }|rd |vr||
v rz|                     	                    |	                      
                                                     g j                  j        t          <   |	D ]}|j        v rj        |= |
                    |           Č|D ]}t                      }
|\  }}}}|D ]j        rj        |         j        |         |dk    r"j        |         }|j        |j        |j        f}nt)          j        |         |          f}j        |         f|z   }||
v rl|                                         |                      
                                                     g j                  j        t          <   j        |= |
                    |           |rt-          |          d S )Nc                 D    g | ]}|                                 r|v|S rS   )is_valid)ra   r<   forms_to_deletes     rB   rc   z4BaseModelFormSet.validate_unique.<locals>.<listcomp>  s@     
 
 
}}
 $(#>#> #>#>#>rD   T)r>   include_meta_constraintsc              3   Z   K   | ]%}|j         v |j        v r|nj         |         V  &d S r   )r*   unique_fields)ra   r1   r<   r}   s     rB   	<genexpr>z3BaseModelFormSet.validate_unique.<locals>.<genexpr>1  sW         111 #d&888EEd>OPU>V1111 rD   c              3      K   | ]N}t          |d           r|                                n%t          |t                    rt	          |          n|V  OdS )_get_pk_valN)rU   r  r-   listtuple)ra   ds     rB   r  z3BaseModelFormSet.validate_unique.<locals>.<genexpr>7  sp       ! !  (/q-'@'@ @AMMOOO%/4%8%8?qa! ! ! ! ! !rD   )r   date)r   deleted_formsformsr   r=   _get_unique_checksr   r  r:   get_unique_error_messager   get_form_errorr   r   r   r*   r   yearmonthdayrI   get_date_error_messager   )r}   all_unique_checksall_date_checksvalid_formsr>   unique_checksdate_checksr   uclassunique_check	seen_datarow_datar1   
date_checklookup
unique_forr   	date_datar4   r<   r  s   `                  @@rB   r   z BaseModelFormSet.validate_unique  sz   EE%%,
 
 
 


 
 

   	0 	0D5577G)-)I)I)- *J * *&M; $$]333"";////$5 !	, !	, FLI# , ,    !-   ! ! ! &	! ! !    ,H 4 49,, d&C&CL&Q&QRRR9=9I9I!00223%)] :J : :%56 &2 = =E$(999$($5e$<MM(+++?,B *  	(  	(JI0:-FFE:# ( ( %()%0<)*5A ''#0<%)Y
DH$E		 &-T->z-JF%S%S$U	 -e46BDy(( d&A&A*&M&MNNN9=9I9I!00223%)] :J : :%56 !-e4MM$''';(>  	*!&)))	* 	*rD   c                     t          |          dk    rt          d          d|d         iz  S t          d          dt          |t          d                    iz  S )N   z0Please correct the duplicate data for %(field)s.r1   r   zFPlease correct the duplicate data for %(field)s, which must be unique.and)r   r   r   _)r}   r0  s     rB   r$  z)BaseModelFormSet.get_unique_error_messaget  sr    |!!MNNaR   X  |QuXX>> rD   c                 l    t          d          |d         |d         t          |d                   dz  S )NzoPlease correct the duplicate data for %(field_name)s which must be unique for the %(lookup)s in %(date_field)s.      r8  )
field_name
date_fieldr4  )r   r   )r}   r3  s     rB   r)  z'BaseModelFormSet.get_date_error_message  sH    I
 
 %Q-$Q-*Q-((
 

 	
rD   c                      t          d          S )Nz*Please correct the duplicate values below.r   r   s    rB   r%  zBaseModelFormSet.get_form_error  s    CDDDrD   c                    g | _         g | _        | j        sg S g }| j        }| j        D ]}|j        }|j        ||v r2| j                            |           |                     ||           G|                                rh| j                             ||j	        f           |                    | 
                    |||                     |s| j                            |           |S Nr  )changed_objectsdeleted_objectsinitial_formsr!  r=   rQ   r:   r  has_changedchanged_datar  r  )r}   r   saved_instancesr  r<   r
  s         rB   r  z&BaseModelFormSet.save_existing_objects  s   !!! 	I,& 	2 	2D-C
 v~&&$++C000$$S$8888!!## 2$++S$2C,DEEE&&t'9'9$F'9'S'STTT 2$++D111rD   c                 ,   g | _         | j        D ]}|                                s| j        r|                     |          r4| j                             |                     ||                     |s| j                            |           | j         S rB  )new_objectsextra_formsrF  
can_delete_should_delete_formr:   r  r  )r}   r   r<   s      rB   r  z!BaseModelFormSet.save_new_objects  s    $ 		. 		.D##%%   4#;#;D#A#A ##DMM$vM$F$FGGG . ''---rD   c                 R  	
 ddl m	m}m} | j        j        j        x| _        }	
fd
 
|          s|j        |j	        vr?|j
        r |j        j        j        rdn|j        j        }n8	 | |                                 |         j        }nd}n# t          $ r d}Y nw xY wt!          |||f          r$|j        j        j                                        }n| j        j                                        }|                    |j        j        j                  }|j        j        r0|j        j                            | j        j        t.                    }nt.          }t1          ||d|          |j	        | j        j        <   t3                                          ||           dS )z0Add a hidden field for the object's primary key.r   )r.   
ForeignKeyOneToOneFieldc                     | j          pH| j        pt          |           p1| j        o*| j        j        o | j        j        j        j                  S r   )r,   auto_createdr-   r   parent_linkrW   r)   rQ   )rQ   r.   pk_is_not_editables    rB   rT  z7BaseModelFormSet.add_fields.<locals>.pk_is_not_editable  sa    [ O@z"i'@'@ O K3K**2?+@+F+IJJrD   NF)r   r   r2   )rT   r.   rO  rP  rW   r)   rQ   	_pk_fieldr/   r+   r   r=   r   r   r   r   r-   r   r   usingdbrr   r7   r   r   r   
add_fields)r}   r<   indexrO  rP  rQ   pk_valuer   r2   r.   rT  r   s            @@rB   rX  zBaseModelFormSet.add_fields  s   IIIIIIIIII"j.11		 		 		 		 		 		 b!! 	RWDK%?%?} $ $(=#7#>T44DMDT$(#'#4#4#6#6u#=#@#'! $ $ $#HHH$"z=9:: @_*;HHJJZ0==??$-.122Bz! %+//0C[QQ$/?HuV0 0 0DK+, 	4'''''s   .$B B"!B")NNr   NNr   )ro   r   r   __doc__rW   r  r   r  r   r   r   r   r   r   r  r  r  r   r   r   r   r$  r)  r%  r  r  rX  r   r   s   @rB   r    r      s         EI CEEM 
 
 
 
 
 
 
 
., , , , ,) ) )
           D  &( ( ( (( ( ( (   
V V V V$ D  [* [* [*z
 
 

 
 
E E E   4       0( 0( 0( 0( 0( 0( 0( 0( 0(rD   r    r8  Fc                    t          |dd          }t          |d|           t          |d|	          t          d          t          | |||	||
|||||          }t          ||||||||||||          }| |_        ||_        |S )z8Return a FormSet class for the given Django model class.r   Nr+   r>   z]Calling modelformset_factory without defining 'fields' or 'exclude' explicitly is prohibited.)
r<   r+   r>   rs   rr   rt   ru   rv   rh   rw   )
extramin_nummax_num	can_orderrL  validate_minvalidate_maxabsolute_maxcan_delete_extrar   )rI   r   r$   r   rW   r  )rW   r<   rs   formsetr]  rL  r`  r_  r+   r>   rr   rb  rt   ru   rv   rh   r^  ra  rw   rc  rd  r   r  metaFormSets                            rB   r!   r!     s    4 4&&Dh''/D)W--5"2
 
 	

 -)%#  D !!!)  G GM!GNrD   c                   z     e Zd ZdZ	 	 	 	 	 	 d fd	Z fdZ fdZed             Zd fd		Z	 fd
Z
 fdZ xZS )r"   z0A formset for child objects related to a parent.NFc                    |$| j         j                                        | _        n|| _        || _        || j        j        }| j        j         |j        di | j         j        | j        i}n|	                                }| j         j        h| _
         t                      j        ||f||d| | j        j        j        r| j         j        | j        j        j        vrt!          | j        j        j        t"                    r-t%          | j        j        j                  | j        j        _        | j        j        j                            | j         j                   d S d S d S )N)r   rO   rS   )fkr   rW   r=   save_as_newr   rQ   rV   r/   noner  r   r   r<   r)   r+   r-   r  r  r:   )
r}   r4   r5   r=   rk  r   rO   ry   r   r   s
            rB   r   zBaseInlineFormSet.__init__2  sF     G06688DMM$DM&z2H=' AADGL$-#@AABBB"gl^uKVbKKFKKK 9?! 	8dgl$)/:P&P&P$)/0%88 F)-dio.D)E)E	&IO"))$',77777	8 	8&P&PrD   c                 V    | j         rdS t                                                      S )Nr   )rk  r   r   r   s    rB   r   z$BaseInlineFormSet.initial_form_countQ  s)     	1ww))+++rD   c                     t                      j        |fi |}| j        rt          |j        dd           }|d|j        _        d |j        |                    | j        j                  <   d |j        |                    | j	        j                  <   |||j        _        | j
        j        }| j	        j        j        | j	        j        j        j        j        j        k    r5t          | j
        | j	        j        j                  }t          |d|          }t!          |j
        | j	                                        |           |S )N_mutableTrQ   )r   r   rk  rI   r4   ro  r6   rU  r/   rj  r=   rQ   r   r>  rW   r)   setattrget_attname)r}   r   ry   r<   mutablefk_valuer   s         rB   r   z!BaseInlineFormSet._construct_formV  s   &uww&q33F33 	-diT::G"%)	" ?CDIdoodn&9::;7;DIdoodgl334"%,	" =#7*dg.B.H.N.Q.VVVt}dg.B.MNNHxx88Htw2244h???rD   c                 t    | j         j                            | j                                      dd          S )N)rW   + )rj  r   get_accessor_namerW   replace)clss    rB   get_default_prefixz$BaseInlineFormSet.get_default_prefixm  s1    v"44394EEMMcSUVVVrD   Tc                     t          |j        | j        j        | j                   t	                                          ||          S rB  )rp  r=   rj  r/   r   r  )r}   r<   r   r   s      rB   r  zBaseInlineFormSet.save_newq  s<     	tw|T];;;wwV444rD   c                    t                                          ||           | j        | j        k    r| j        j        }ddi}nN| j        j        }dt          |j                            |          dt          | j        j	                            i}| j        j
        j        | j        j
        j        j        j        j        k    r| j        j
        j        |d<   | j        j        j        r{|                    d          &| j        j                            |d                   }n| j        j        j        }|                                rt)          | j        |j        d            t-          | j        fi ||j        |<   d S )Npk_fieldTrf   to_field)r   rX  rU  rj  r/   rI   r+   r7   r   verbose_namer   r>  rW   r)   rQ   r=   r   r   	get_fieldr0   rp  attnamer   )r}   r<   rY  r/   ry   r~  r   s         rB   rX  zBaseInlineFormSet.add_fieldsx  s\   4'''>TW$$>&D $'FF 7<DKOOD))7HTW=Q4R4R F 7*dg.B.H.N.Q.VVV!%!5!@F: =& 	?zz*%%1=.88
9KLL=.1##%% ?x'7>>>1$-JJ6JJDrD   c                 d      fd|D             }t                                          |          S )Nc                 4    g | ]}|j         j        k    |S rS   )rj  r/   )ra   r1   r}   s     rB   rc   z>BaseInlineFormSet.get_unique_error_message.<locals>.<listcomp>  s'    QQQ%5DGL;P;P;P;P;PrD   )r   r$  )r}   r0  r   s   ` rB   r$  z*BaseInlineFormSet.get_unique_error_message  s5    QQQQ<QQQww//===rD   )NNNFNNr   )ro   r   r   r[  r   r   r   classmethodrz  r  rX  r$  r   r   s   @rB   r"   r"   /  s        :: 8 8 8 8 8 8>, , , , ,
    . W W [W5 5 5 5 5 5K K K K KB> > > > > > > > >rD   r"   c                 n    ddl m |j        }rfd|j        D             }t	          |          dk    r|d         } j                                        t          |          rb|j        j        j        j	        r|j        j        j        j
        vs4|j        j        j        j	        s>|j        j         k    r.|j        j        vr t          dd j        j        d          n|s t          d|j        j        d	d          n j                                         fd
|j        D             }t	          |          dk    r	|d         }nZ|s.|rdS t          d|j        j        d j        j        d          t          d|j        j        d j        j        d          |S )aD  
    Find and return the ForeignKey from model to parent if there is one
    (return None if can_fail is True and no such field exists). If fk_name is
    provided, assume it is the name of the ForeignKey field. Unless can_fail is
    True, raise an exception if there isn't a ForeignKey from model to
    parent_model.
    r   )rO  c                 *    g | ]}|j         k    |S rS   )r/   )ra   rA   fk_names     rB   rc   z$_get_foreign_key.<locals>.<listcomp>  s%    EEEq16W3D3D3D3D3DrD   r8  z	fk_name 'z' is not a ForeignKey to 'z'.rd   z' has no field named 'c                     g | ]`}t          |          rN|j        j        k    s<|j        j        v s.|j        j        j        j        r|j        j        j        j        v ^|aS rS   )r-   r   rW   r)   proxyproxy_for_model)ra   rA   rO  parent_listparent_models     rB   rc   z$_get_foreign_key.<locals>.<listcomp>  s     
 
 
!Z((

 $44>';66N(.4 7 ,2BkQQ  RQQrD   Nz' has no ForeignKey to 'z#' has more than one ForeignKey to 'z*'. You must specify a 'fk_name' attribute.)rT   rO  r)   r+   r   get_parent_listr-   r   rW   r  r  r   rf   )	r  rW   r  can_failr?   fks_to_parentrj  rO  r  s	   ` `    @@rB   _get_foreign_keyr    sP    ,+++++;D ?EEEEDKEEE}""q!B&,<<>>Kr:.. O)/5	
 -3C;VV -39	 W
 -==-[@@ !jww 2 8 8 8:    	*38;3D3D3DgggN  	 #(88::
 
 
 
 
 
[
 
 
 }""q!BB 	 * K%%% &,,,   * K%%% &,,,	   IrD   r=  c                     t          | ||          }|j        rd}
i d|d|d|d|d|	d|d	|d
|d|d|
d|d|d|d|d|d|d||||||d}t          |fi |}||_        |S )z
    Return an ``InlineFormSet`` for the given kwargs.

    ``fk_name`` must be provided if ``model`` has more than one ``ForeignKey``
    to ``parent_model``.
    )r  r8  r<   rs   re  r]  rL  r`  r+   r>   r^  r_  rr   ra  rb  rt   ru   rv   rh   )rw   rc  rd  r   r  )r  uniquer!   rj  )r  rW   r<   re  r  r+   r>   r]  r`  rL  r_  rs   rr   rb  rt   ru   rv   rh   r^  ra  rw   rc  rd  r   r  rj  ry   rg  s                               rB   r#   r#     s<   B 
,w	?	?	?B	y 0 	7 		
 	j 	Y 	& 	7 	7 	7 	7 	 	 	, 	&  	j!" 	.#$ '$,-  F0 #533F33GGJNrD   c                   T     e Zd ZdZeZd ed          iZddd fd
Zd Z	d	 Z
 xZS )
r   zw
    A basic integer field that deals with validating the given value to a
    given parent instance in an inline.
    invalid_choicez3The inline value did not match the parent instance.FN)r}  r~  c                    || _         || _        || _        | j         4| j        rt          | j         | j                  |d<   n| j         j        |d<   d|d<    t                      j        |i | d S )Nr   Fr   )parent_instancer}  r~  rI   rQ   r   r   )r}   r  r}  r~  argsry   r   s         rB   r   zInlineForeignKeyField.__init__=  s    .  +} <$+D,@$-$P$Py!!$($8$;y!"z$)&)))))rD   c                    || j         v r| j        rd S | j        S | j        rt	          | j        | j                  }n| j        j        }t          |          t          |          k    rt          | j        d         d          | j        S )Nr  r   )	r8   r}  r  r~  rI   rQ   r   r   rh   )r}   r   origs      rB   r   zInlineForeignKeyField.cleanI  s    D%%%} t''= 	+4/??DD'*Du::T""!#$45<L    ##rD   c                     dS NFrS   )r}   r   r4   s      rB   rF  z!InlineForeignKeyField.has_changedZ  s    urD   )ro   r   r   r[  r   r2   r:  default_error_messagesr   r   rF  r   r   s   @rB   r   r   2  s         
 F!!QRR 9> 
* 
* 
* 
* 
* 
* 
*$ $ $"      rD   r   c                   &    e Zd Zd Zd Zd Zd ZdS )ModelChoiceIteratorValuec                 "    || _         || _        d S r   )r   r=   )r}   r   r=   s      rB   r   z!ModelChoiceIteratorValue.__init___  s    
 rD   c                 *    t          | j                  S r   )r   r   r   s    rB   __str__z ModelChoiceIteratorValue.__str__c  s    4:rD   c                 *    t          | j                  S r   )hashr   r   s    rB   __hash__z!ModelChoiceIteratorValue.__hash__f  s    DJrD   c                 P    t          |t                    r|j        }| j        |k    S r   )r-   r  r   )r}   others     rB   __eq__zModelChoiceIteratorValue.__eq__i  s)    e566 	 KEzU""rD   N)ro   r   r   r   r  r  r  rS   rD   rB   r  r  ^  sP        ! ! !       # # # # #rD   r  c                   ,    e Zd Zd Zd Zd Zd Zd ZdS )ModelChoiceIteratorc                 ,    || _         |j        | _        d S r   )r1   rO   r   s     rB   r   zModelChoiceIterator.__init__p  s    
rD   c              #      K   | j         j        d| j         j        fV  | j        }|j        s|                                }|D ]}|                     |          V  d S )Nrv  )r1   empty_labelrO   _prefetch_related_lookupsiteratorchoice)r}   rO   r
  s      rB   __iter__zModelChoiceIterator.__iter__t  s~      :!-tz-....=1 	+((**H 	# 	#C++c""""""	# 	#rD   c                 V    | j                                         | j        j        dndz   S )Nr8  r   )rO   countr1   r  r   s    rB   __len__zModelChoiceIterator.__len__~  s,     }""$$TZ-C-OUVWWrD   c                 P    | j         j        d up| j                                        S r   )r1   r  rO   existsr   s    rB   __bool__zModelChoiceIterator.__bool__  s%    z%T1KT]5I5I5K5KKrD   c                     t          | j                            |          |          | j                            |          fS r   )r  r1   prepare_valuelabel_from_instancer}   r
  s     rB   r  zModelChoiceIterator.choice  s<    $TZ%=%=c%B%BCHHJ**3//
 	
rD   N)ro   r   r   r   r  r  r  r  rS   rD   rB   r  r  o  se        ' ' '# # #X X XL L L
 
 
 
 
rD   r  c            
            e Zd ZdZd ed          iZeZdddddddddd		d
Zd Z	 fdZ
d Zd Z eee          Zd Zd Z eeej                  Z fdZd Zd Zd Z xZS )r   z1A ChoiceField whose choices are a model QuerySet.r  zGSelect a valid choice. That choice is not one of the available choices.z	---------TNrv  F)	r  r   r2   rf   r   rg   to_field_namerZ   r   c       	   	          t          j        | f|||||d| |r|t          | j        t                    r
|
sd | _        n|| _        || _        |	| _        || _        d S )N)r   r2   rf   r   rg   )	r
   r   r-   r2   r   r  rO   rZ   r  )r}   rO   r  r   r2   rf   r   rg   r  rZ   r   ry   s               rB   r   zModelChoiceField.__init__  s    " 		
	
 	
 	
 	
 	
  	+,t{K00 -9> -  $D*D  0*rD   c                 `    t          | j                  r|                                 S | j        S )z
        Return ``limit_choices_to`` for this form field.

        If it is a callable, invoke it and return the result.
        )rp   rZ   r   s    rB   rP   z%ModelChoiceField.get_limit_choices_to  s2     D)** 	+((***$$rD   c                     t          t          |                               |          }| j        | j                                        |_        |S r   )r   r	   __deepcopy__rO   all)r}   memoresultr   s      rB   r  zModelChoiceField.__deepcopy__  sB    {D))66t<<=$"m//11FOrD   c                     | j         S r   )r   r   s    rB   _get_querysetzModelChoiceField._get_queryset  s
    ~rD   c                 b    |d n|                                 | _        | j        | j        _        d S r   )r  r   choicesr2   )r}   rO   s     rB   _set_querysetzModelChoiceField._set_queryset  s,    !)!1x||~~"lrD   c                      t          |          S )z
        Convert objects into strings and generate the labels for the choices
        presented by this object. Subclasses can override this method to
        customize the display of the choices.
        r   r  s     rB   r  z$ModelChoiceField.label_from_instance  s     3xxrD   c                 Z    t          | d          r| j        S |                     |           S )N_choices)rU   r  r  r   s    rB   _get_choiceszModelChoiceField._get_choices  s2     4$$ 	!=  }}T"""rD   c                     t          |d          r(| j        r|                    | j                  S |j        S t	                                          |          S Nr)   )rU   r  serializable_valuerQ   r   r  )r}   r   r   s     rB   r  zModelChoiceField.prepare_value  sV    5'"" 	 !  //0BCCCxww$$U+++rD   c                 6   || j         v rd S 	 | j        pd}t          || j        j                  rt          ||          } | j        j        di ||i}nD# t          t          | j        j        j	        f$ r  t          | j        d         dd|i          w xY w|S )NrQ   r  r   r   paramsrS   )r8   r  r-   rO   rW   rI   r7   r   rq   DoesNotExistr   rh   )r}   r   keys      rB   r   zModelChoiceField.to_python  s    D%%%4
	$,C%!455 ,s++%DM%55e55EEIt}':'GH 	 	 	!#$45%'   	 s   AA ABc                 ,    t          j        | |          S r   )r
   validater}   r   s     rB   r  zModelChoiceField.validate  s    ~dE***rD   c                     | j         rdS ||nd}||nd}t          |                     |                    t          |          k    S )NFrv  )disabledr   r  )r}   r   r4   initial_value
data_values        rB   rF  zModelChoiceField.has_changed  sT    = 	5#*#6B!-TT2
4%%m4455ZHHrD   )ro   r   r   r[  r:  r  r  r  r   rP   r  r  r  propertyrO   r  r  r	   _set_choicesr  r  r   r  rF  r   r   s   @rB   r   r     s[       ;;
 	!!U
 

 #H  "+ "+ "+ "+ "+H% % %      + + + x}55H  # # # h|[%=>>G, , , , ,   + + +I I I I I I IrD   r   c                        e Zd ZdZeZeZ ed           ed           ed          dZ	 fdZ
d Zd Zd	 Z fd
Zd Z xZS )r   z9A MultipleChoiceField whose choices are a model QuerySet.zEnter a list of values.zESelect a valid choice. %(value)s is not one of the available choices.u"   “%(pk)s” is not a valid value.)invalid_listr  invalid_pk_valuec                 @     t                      j        |fdd i| d S )Nr  )r   r   )r}   rO   ry   r   s      rB   r   z!ModelMultipleChoiceField.__init__#  s-    >>t>v>>>>>rD   c                 N    |sg S t          |                     |                    S r   )r  _check_valuesr  s     rB   r   z"ModelMultipleChoiceField.to_python&  s+     	ID&&u--...rD   c                    |                      |          }| j        r|st          | j        d         d          | j        s|s| j                                        S t          |t          t          f          st          | j        d         d          | 	                    |          }| 
                    |           |S )Nr   r  r  )r  r   r   rh   rO   rl  r-   r  r  r  run_validators)r}   r   r   s      rB   r   zModelMultipleChoiceField.clean+  s    ""5))= 	( 	(!$"5j"A
SSSS 	(u 	(=%%'''%$// 	!#N3#    && 	E"""	rD   c                    | j         pd	 t          |          }n*# t          $ r t          | j        d         d          w xY w|D ]K}	  | j        j        d
i |i # t          t          f$ r  t          | j        d         dd|i          w xY w | j        j        d
i dz  |i}fd|D             }|D ]2}t          |          |vrt          | j        d         dd	|i          3|S )z
        Given a list of possible PK values, return a QuerySet of the
        corresponding objects. Raise a ValidationError if a given value is
        invalid (not a valid PK, not in the queryset, etc.)
        rQ   r  r  r  r  z%s__inc                 J    h | ]}t          t          |                     S rS   )r   rI   )ra   r   r  s     rB   r   z9ModelMultipleChoiceField._check_values.<locals>.<setcomp>W  s)    000s71c??##000rD   r  r   rS   )	r  	frozensetrq   r   rh   rO   rV   r   r   )r}   r   rQ   r   pksvalr  s         @rB   r  z&ModelMultipleChoiceField._check_values<  s     (D	e$$EE 	 	 	!#N3#   	  	 	B$$11Ry1111	*   %'(:;+ ":    "T]!<<X^U$;<<0000R000 	 	C3xxs""%'(89)#S>    # 	s    'AA  1Bc                     t          |d          rFt          |t                    s1t          |d          s!t                      j        fd|D             S t                                          |          S )Nr  r)   c                 &    g | ]} |          S rS   rS   )ra   r   r  s     rB   rc   z:ModelMultipleChoiceField.prepare_value.<locals>.<listcomp>h  s#    444MM!$$444rD   )rU   r-   r   r   r  )r}   r   r  r   s     @rB   r  z&ModelMultipleChoiceField.prepare_valuea  s|    E:&&	5uc**	5 E7++	5
 "GG1M4444e4444ww$$U+++rD   c                     | j         rdS |g }|g }t          |          t          |          k    rdS d |                     |          D             }d |D             }||k    S )NFTc                 ,    h | ]}t          |          S rS   r  ra   r   s     rB   r   z7ModelMultipleChoiceField.has_changed.<locals>.<setcomp>t  s    KKKes5zzKKKrD   c                 ,    h | ]}t          |          S rS   r  r  s     rB   r   z7ModelMultipleChoiceField.has_changed.<locals>.<setcomp>u  s    1115CJJ111rD   )r  r   r  )r}   r   r4   initial_setdata_sets        rB   rF  z$ModelMultipleChoiceField.has_changedk  s    = 	5?G<Dw<<3t99$$4KKt/A/A'/J/JKKK11D111;&&rD   )ro   r   r   r[  r   r2   r   hidden_widgetr:  r  r   r   r   r  r  rF  r   r   s   @rB   r   r     s        CCF'M344!S
 
 ABCC ? ? ? ? ?/ / /
  "# # #J, , , , ,' ' ' ' ' ' 'rD   r   c                 Z    t          | d          o| j        j        d up| j        j        d uS r  )rU   r)   r+   r>   )ri   s    rB   modelform_defines_fieldsr  y  s7    :w'' t+Sz/?/Gt/SrD   )NN)	NNNNNNNNNr  )7r[  	itertoolsr   django.core.exceptionsr   r   r   r   django.db.models.utilsr   django.forms.fieldsr	   r
   django.forms.formsr   r   django.forms.formsetsr   r   django.forms.utilsr   django.forms.widgetsr   r   r   r   django.utils.textr   r   django.utils.translationr   r   r:  r%   r   rC   r   r\   r   r{   r   r   r   r$   r    r!   r"   r  r#   r   r  r  r   r   r  rS   rD   rB   <module>r     s                     . - - - - - 2 2 2 2 2 2 2 2 C C C C C C C C > > > > > > > > ( ( ( ( ( (            6 5 5 5 5 5 5 5 , , , , , , 6 6 6 6 6 6 
* * * *`   2  & k  k k k k k\O O O O O O O OF F F F F3 F F FRY Y Y Y YHj Y Y Yx	 	 	 	 	); 	 	 	 	 
U= U= U= U=v]( ]( ]( ]( ]({J ]( ]( ](D 

/A A A ANl> l> l> l> l>( l> l> l>^L L L Ld 

3? ? ? ?J) ) ) ) )E ) ) )X# # # # # # # #"
 
 
 
 
 
 
 
>EI EI EI EI EI{ EI EI EIP`' `' `' `' `'/ `' `' `'F    rD   