item isManyToManyField.
class Listing:
# ...
items = models.ManyToManyField(Item, related_name="listings", blank=True)
When I hover over its methods set, add, remove and clear in VS Code, their docstrings do not show. Only signatures.
What I get when I hover over set:
listing.items.set: Listing instance
Model: listings.Listing
Module: realestate.listings.models
File: listings/models.py
(method) def set(
objs: QuerySet[Unknown, Unknown] | Iterable[Unknown],
*,
clear: bool = ...,
through_defaults: Mapping[str, Any] = ...
) -> None
What I get when I hover over clear:
listing.items.clear: Listing instance
Model: listings.Listing
Module: realestate.listings.models
File: listings/models.py
(method) def clear() -> None
I thought it was the fault in Pylance, but maybe these methods don’t actually have docstrings. I propose giving them docstrings, so that I don’t have to go to Django website every time.