Skip to content

Commit

Permalink
Update extract_field_value() docstring to explain what 'suppress_null…
Browse files Browse the repository at this point in the history
…relationshipvalueencountered' does
  • Loading branch information
ababic authored and gasman committed Feb 21, 2024
1 parent 36b7a96 commit 44be4f4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modelcluster/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ def extract_field_value(obj, key, pk_only=False, suppress_fielddoesnotexist=Fals
By default, ``FieldDoesNotExist`` is raised if the key cannot be mapped to
a model field. Call the function with ``suppress_fielddoesnotexist=True``
to get ``None`` values instead.
to instead receive a ``None`` value when this occurs.
By default, ``NullRelationshipValueEncountered`` is raised if a ``None``
value is encountered while attempting to traverse relationships in order to
access further fields. Call the function with
``suppress_nullrelationshipvalueencountered`` to instead receive a ``None``
value when this occurs.
"""
source = obj
latest_obj = obj
Expand Down

0 comments on commit 44be4f4

Please sign in to comment.