Closed Viicos closed 9 months ago
It seems that different logic is involved between __init__
and create
, so:
self
argument, and each subclass should provide the self
annotation (i.e. self: BaseManager[model_name]/_QuerySet[model_name, _Row]/model_name
)__init__
, look a the actual runtim implementation, there is a lot going on. In the future, also support property settersEdit: actually logic doesn't differ that much. This is still refactored as described so that separated rules can be used.
Follow up on https://github.com/Viicos/django-autotyping/issues/10:
NotRequired
: is there a reliable way of determining this?Field.get_default()
seems to always return a value even though a field value should be provided. Django seems to try inserting the value, so it might not be possible to know in advance? Should we apply some common sense and set fields as being not required if there's adefault
/db_default
ornull=True
? see this discussion. Implemented, but should also look at the mypy plugin: