sbdchd / django-types

:doughnut: Type stubs for Django
MIT License
188 stars 62 forks source link

Allow DateField to be Optional #69

Closed vst closed 2 years ago

vst commented 2 years ago

I do not know if there was a particular reason for why it was not implemented before. But, I took the liberty to mimic what was done for similar fields on the upstream.

Essentially, The __init__ was overloaded to distinguish between null=True and null=False to signal the resulting type, Optional[date] or date respectively.

sbdchd commented 2 years ago

Thank you for fixing this, looks good!