bg .ddlmZddlmZmZmZmZmZddlm Z ddl m Z ddl mZmZmZmZmZdZded eed ed eeeffd Zd efdZee eeeeedddddddddd dededededededededededededed ed eefd!Z dS)")partial)DictAnySequenceCallableOptional)Model)compare)_compare_mappingregisterCompareContext unspecifiedRegistryc#ZK|j}dD]}t||d}|r |D]}|VdS)N)concrete_fieldsvirtual_fieldsprivate_fields)_metagetattr)instanceoptsnamefieldsfields d/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/testfixtures/django.pyinstance_fieldsr s^ >D tT**     rexcludeinclude_not_editablereturnci}t|D]=}|j|vr t|dds|s ||||j<>|S)NeditableF)rrrvalue_from_object)rrr datafs r model_to_dictr'so D X & &55 6W   q*e,, 5I  **844QV Krcontextc2|dt}|dd}g}||fD]&}|t|||'||||t |S)a Returns an informative string describing the differences between the two supplied Django model instances. The way in which this comparison is performed can be controlled using the following parameters: :param ignore_fields: A sequence of fields to ignore during comparison, most commonly set to ``['id']``. By default, no fields are ignored. :param non_editable_fields: If `True`, then fields with ``editable=False`` will be included in the comparison. By default, these fields are ignored. ignore_fieldsnon_editable_fieldsF) get_optionsetappendr'r )xyr(r*r+argsobjs r compare_modelr3&s&&>>M ++,A5II D!tLL M#}6IJJKKKKKKKKNNN T ""rNTF r/r0expectedactualprefixsuffixx_labely_labelraises recursivestrict ignore_eq comparersr/r0r5r6r7r8r9r:r;r<r=r>r?optionsc 6t| |||||||||| | | | d |S)z This is identical to :func:`~testfixtures.compare`, but with ``ignore=True`` automatically set to make comparing django :class:`~django.db.models.Model` instances easier. r4) base_compare)r/r0r5r6r7r8r9r:r;r<r=r>r?r1r@s rr r AsO,       r) functoolsrtypingrrrrrdjango.db.modelsr r rB comparisonr r rrrrstrboolr'r3rrrKs::::::::::::::""""""%%%%%%YYYYYYYYYYYYYY     # #  #s(^    #####0   #!"&&& & & &  &  &&&&&&&&&& c]!&&&&&&r