Skip to content

Document overridden serializer methods - #54

Merged
FriggemannMichael merged 2 commits into
mainfrom
docs/serializer-method-docstrings
Jul 8, 2026
Merged

Document overridden serializer methods#54
FriggemannMichael merged 2 commits into
mainfrom
docs/serializer-method-docstrings

Conversation

@FriggemannMichael

Copy link
Copy Markdown
Owner

Motivation

Mentor feedback (blocking): overridden serializer methods (e.g. create, update, and the detail helpers in the offers serializer) lacked docstrings. Once a method overrides DRF's default behavior, it should state what it does and why it differs from the built-in implementation.

Changes

Add concise, single-line docstrings to the overridden lifecycle methods and their private helpers across all app serializers:

  • offersvalidate, validate_details, _validate_update_details, create, update, _create_details, _update_details
  • authvalidate_username, validate (registration + login), create
  • profilesupdate
  • ordersvalidate, create, _get_offer_detail
  • reviewsvalidate, create, _validate_business_user, _validate_unique_review

Trivial computed-field getters (get_price, get_min_price, get_url, …) are intentionally left undocumented, as the mentor considers such one-liners redundant. Existing class docstrings are kept because the project's ruff config enforces D101.

Docstrings are kept to one line so functions stay within the project's 14-line limit (test_code_style).

Verification

  • ruff: clean
  • pytest: 179 passed, coverage 98.26%

Add concise docstrings to the overridden validate/create/update
methods and their private helpers across the app serializers, so
each customization states what it does and how it differs from the
default DRF behavior. Trivial computed-field getters are left as is.
@FriggemannMichael
FriggemannMichael merged commit a6df106 into main Jul 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant