deschler / django-modeltranslation

Translates Django models using a registration approach.
BSD 3-Clause "New" or "Revised" License
1.34k stars 257 forks source link

fix(types): make admin classes generic as their super classes #737

Closed mschoettle closed 1 month ago

mschoettle commented 1 month ago

BaseModelAdmin and ModelAdmin are generic:

https://github.com/typeddjango/django-stubs/blob/496190e1b5dc344980d8f6ee81ff5dcecc05ded9/django-stubs/contrib/admin/options.pyi#L88

https://github.com/typeddjango/django-stubs/blob/496190e1b5dc344980d8f6ee81ff5dcecc05ded9/django-stubs/contrib/admin/options.pyi#L145

This PR makes the translation admin classes generic as well.

last-partizan commented 1 month ago

Good start, now let's fix CI :)

Viicos commented 1 month ago

You might be interested in this thread: https://github.com/lazybird/django-solo/pull/128#discussion_r1451790020, where I proposed a (verbose) solution.

last-partizan commented 1 month ago

Merged it! Thanks for your contribution!

mschoettle commented 1 month ago

Thanks a lot for fixing the last issues and merging it!