Roadmap #733
Replies: 7 comments 6 replies
-
|
@bckohan i want to start working on adding the stub files do i need to wait until the lib is getting updated to v5? |
Beta Was this translation helpful? Give feedback.
-
|
Hi @JohananOppongAmoateng! Thank you for volunteering! You might want to checkout #647 Huy had mentioned wanting to work on this but I'm not sure anything has happened yet. He mentioned maybe putting these types in typeshed instead of django-polymorphic... what do you think? |
Beta Was this translation helpful? Give feedback.
-
|
Honestly i think having the types in typeshed isnt bad but i am looking at long term the fact that we need to always sync the types as they change in the lib with typeshed. I think for start we can have them there if the need arises to include them in the lib we then move them here |
Beta Was this translation helpful? Give feedback.
-
|
I'm also partial to keeping them in this library. I also don't think we need to wait for 5.0 - who knows how long it will be before we get to that... If you want to start a branch we can just do our best to stay in sync until the merge! |
Beta Was this translation helpful? Give feedback.
-
|
I would want to keep all the types in stub files though. I think the rebasing will be waaaay easier that way. |
Beta Was this translation helpful? Give feedback.
-
|
@bckohan thanks for putting this all together. As someone who has built multiple businesses atop Django Polymorphic, I'd really like to help in any way I can. I think an area that needs addressing is documentation. I know that's low on the priority list given all the changes that will happen internally, but when the time is right, send me a ping! |
Beta Was this translation helpful? Give feedback.
-
|
For the record, I have now made you an owner of pypi.
Thanks so much for your hard work and for moving the project forward!
Chris
…On Tue, 6 Jan 2026 at 06:40, Brian Kohan ***@***.***> wrote:
This is an update for everyone on how I'm thinking about and prioritizing
work on this library so you may make decisions about continuing to use it
based on more than nothing.
The first version of django-polymorphic
<https://pypi.org/project/django-polymorphic> was released 15 years ago
in 2011. There are many users of this library and it runs in production
systems around the world - per PyPi statistics it is not unreasonable to
assume that somewhere approaching 5% of production Django systems depend on
this library. During that time it has been supported by 6 different
maintainers ***@***.*** <https://github.com/bconstantin> @vdboor
<https://github.com/vdboor> @chrisglass <https://github.com/chrisglass>
@jleclanche <https://github.com/jleclanche> @meshy
<https://github.com/meshy> with me <https://github.com/bckohan> being the
most recent) and over 125 individual contributors
<https://github.com/jazzband/django-polymorphic/graphs/contributors>.
Maintaining open source is difficult. Volunteers burn out, get busy or
have life changes that pull them away. There was a period of ~4 years where
this library was essentially unmaintained. The Django/Python ecosystem
marched on and things started to break. When I was granted maintainership
there were 163 open issues and 16 open PRs - the oldest dating back 14
years.
Move to django-commons <https://github.com/django-commons>
This project was moved into jazzband <https://github.com/jazzband> not
that long ago. Unfortunately the move took place without an identified
maintainer so it languished for a few years without a successful update.
The jazzband <https://github.com/jazzband> has been a true boon to the
Django ecosystem over the years but I think this move is necessary for the
health of this library for several reasons:
I maintain several other packages
<https://github.com/django-commons?q=django-typer+OR+django-enum&type=all&language=&sort=>
at django-commons <https://github.com/django-commons> so its just going
to be easier for me to unify all my Django package workflows under a common
organization.
I still jazzband/help#415 <jazzband/help#415>
through the jazzband process. <https://jazzband.co/about/releases> and
moving to django-commons <https://github.com/django-commons> would enable
trusted publishing through backbone infrastructure in a way that I believe
is just more secure. Right now I am publishing directly through my own PyPi
account which is not ideal.
If something happened to me this project would be stuck again with nobody
in position to issue releases. django-commons
<https://github.com/django-commons> has 5 active admins
<https://github.com/orgs/django-commons/teams/admins> to jazzband's
overstretched single admin. This means if something happened to me there
would be 5 people able to grant maintainership to someone else.
I do not have admin rights to this repo, nor do I have full admin rights
to the pypi repository. This move will be hard to coordinate as we will
need to get help from at least @jezdez <https://github.com/jezdez> @vdboor
<https://github.com/vdboor> or @chrisglass <https://github.com/chrisglass>
. Please be patient.
Additional Maintainer
I would like to find at least one other additional maintainer with publish
privileges. This will likely not move forward until the move to
django-commons <https://github.com/django-commons> is complete. Given
where I would like to take this library (see below) if you have experience
in the guts of Django's ORM that would be extremely helpful! Otherwise -
for trust - you would need an established record in the open source Django
ecosystem. The best way to help right now is to pick off issues by opening
PRs - I promise to look at them within a reasonable amount of time!
Progress So Far
I have closed around 70 issues and merged around 15 outstanding PRs. Most
of these issues were longstanding bug fixes. Many issues were duplicates or
were addressing bugs that were fixed without the issue having been closed.
For specific bug reports I have been adding matching tests and closing the
issue if the tests pass. I ask for your continued patience because this is
a very laborious process - no PR was merged without changes. Most merged
PRs have included bug fixes. See the changelog
<https://django-polymorphic.readthedocs.io/en/latest/changelog.html> for
a comprehensive list. A few notable improvements include:
Polymorphic QuerySet iteration now produces #672
<#672>.
A #684 <#684> that
provides a shortcut for "promoting" an existing model row to a direct
subclass of that model. This was the longest standing open PR (from 2013!).
#543 <#543>. This
eliminates spurious failures that some users were encountering.
Many admin bug fixes.
Code coverage has increased by ~7%.
I have enabled discussions and for issues that were how-to-like questions
I have been moving them into Q&A
<https://github.com/jazzband/django-polymorphic/discussions/categories/q-a>.
If I have answered your question satisfactorily please accept the answer.
The intention is for Q&A
<https://github.com/jazzband/django-polymorphic/discussions/categories/q-a>
to function as an FAQ.
Packaging has been modernized:
uv <https://docs.astral.sh/uv/guides/install-python/> is now the package
manager.
just <https://just.systems/man/en/> has implemented many package
management shortcuts.
CI runs on all Django supported RDBMS and more combinations of supported
dependencies.
Admin tests now test full integration (including the delivered javascript)
using playwright <https://playwright.dev/>
Roadmap
I am cognizant that there are many outstanding bugs in this library and
for users that have invested in its existing functionality fixing these
should and will be be my top priority. The focus of the version 4.x series
will be fixing those bugs while maintaining backwards compatibility. For
version 5.x I would like to take a deeper look at how django-polymorphic
works and determine if there are some #743
<#743> in ways
that address the longstanding lack of support for selected_related and
prefetch_related.
The current design of django-polymorphic is mostly a manager/queryset
extension. It basically works by storing the most-derived leaf class
ContentType on the parent table(s). When queries are made a second step
uses those ContentTypes to run an additional query (or queries) if there
are more derived tables for any model in the queryset. This works, is
performant enough for most workflows, and is aligned with how most users
would implement polymorphism themselves - but there may be deeper tie-ins
to the Django ORM that could replace the 2-phase process with a single step
process.
I want to acknowledge that of all the outstanding PRs those by @pgammans
<https://github.com/pgammans> ***@***.*** <https://github.com/676> and
https://github.com/545) were the most thorough and impactful but they are
the only two outstanding PRs I have not merged yet. I am delaying proxy
model changes ***@***.*** <https://github.com/676>) to version 5.x because
there will be breaking changes. The current proxy model support is
unintuitive and, I think, incongruous with the intent of proxy models in
Django. I did not see a way to offer backwards compatibility with the
current behavior without requiring users to change their code. I am
delaying select_related and prefetch_related support ***@***.***
<https://github.com/676>) until I can do a more thorough review of the
library's architecture and I do not want to publish an interface that might
be immediately deprecated in the next release. Thank you @pgammans
<https://github.com/pgammans> - I promise these PRs will not languish
forever!
Version 4.x
The last 4.x release will coincide with a Django LTS release (hopefully
6.2) to give users a solid 3 years to migrate to 5.x.
In priority order, with some issue links these are my areas of focus. Each
block will be a release containing fixes in a related area. This should
help users more easily identify the source of regressions if they arise and
help keep me sane as I work through the backlog.
Deletion Woes (there are many longstanding issues with Polymorphic
deletion - punting some of these issues to 5.x may be necessary but getting
deletion to work as well as possible in the 4.x series is my top priority)
(4.5)
#673 <#673>
#608 <#608>
#547 <#547>
#540 <#540>
#481 <#481>
#357 <#357>
#352 <#352>
#274 <#274>
#229 <#229>
#160 <#160>
#34 <#34>
ORM Deficiencies (4.6)
#784 <#784>
#758 <#758>
#744 <#744>
#686 <#686>
#658 <#658>
#645 <#645>
#613 <#613>
#495 <#495>
#494 <#494>
#486 <#486>
#447 <#447>
#446 <#446>
#423 <#423>
#414 <#414>
#347 <#347>
#295 <#295>
#290 <#290>
#280 <#280>
#71 <#71>
Admin Bugs (4.7)
#612 <#612>
#532 <#532>
#497 <#497>
#479 <#479>
#381 <#381>
#380 <#380>
#375 <#375>
#356 <#356>
#346 <#346>
#234 <#234>
#182 <#182>
#158 <#158>
#144 <#144>
#125 <#125>
Formset Bugs (4.8)
#578 <#578>
#549 <#549>
#472 <#472>
#409 <#409>
#363 <#363>
#294 <#294>
Serialization bugs (4.9)
#517 <#517>
#513 <#513>
#502 <#502>
#342 <#342>
#175 <#175>
#146 <#146>
Miscellaneous Issues - anything else thats open and not slated for 5.x
(4.x)
#618 <#618>
#570 <#570>
#520 <#520>
#505 <#505>
#476 <#476>
#470 <#470>
#431 <#431>
#420 <#420>
#398 <#398>
#397 <#397>
#396 <#396>
#388 <#388>
#383 <#383>
#378 <#378>
#366 <#366>
#334 <#334>
#252 <#252>
#244 <#244>
#202 <#202>
#137 <#137>
#660 <#660>
The best way for folks to help right now is to pick out open issues and
open PRs that have tests and fixes! I will happily accept and work on PRs
that have tests illustrating bugs without the fixes in place yet!
Version 5.x
Version 5.x will include a significant scope of refactoring and potential
breaking changes.
Single-step queries (#743
<#743>)
#727 <#727>
Intuitive Proxy Model Support
#676 <#676>
#466 <#466>
#390 <#390>
#376 <#376>
#358 <#358>
#256 <#256>
Support for select_related and prefetch_related
#545 <#545>
#641 <#641>
#436 <#436>
#410 <#410>
#359 <#359>
#198 <#198>
Bring in popular third party extensions.
#655 <#655>
Non-backwards compat misc
#429 <#429>
#233 <#233>
#148 <#148>
New Features
#172 <#172>
#686 <#686>
Type hints
#647 <#647>
#579 <#579>
#529 <#529>
#498 <#498>
Documentation overhaul
Test Suite Reorg/Refactor
Please hold some grace for me and the other contributors to this library.
Coming updates will likely trigger regressions. This is unavoidable to make
progress and that progress lies at the feet of volunteers who are not
remunerated for this work.
—
Reply to this email directly, view it on GitHub
<#733>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAGE6Z66IT5BC5VMO3VQY34FNDDBAVCNFSM6AAAAACPDX3KU2VHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZZGI2TAMJRHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is an update for everyone on how I'm thinking about and prioritizing work on this library so you may make decisions about continuing to use it based on more than nothing.
The first version of django-polymorphic was released 15 years ago in 2011. There are many users of this library and it runs in production systems around the world - per PyPi statistics it is not unreasonable to assume that somewhere approaching 5% of production Django systems depend on this library. During that time it has been supported by 6 different maintainers (@bconstantin @vdboor @chrisglass @jleclanche @meshy with me being the most recent) and over 125 individual contributors.
Maintaining open source is difficult. Volunteers burn out, get busy or have life changes that pull them away. There was a period of ~4 years where this library was essentially unmaintained. The Django/Python ecosystem marched on and things started to break. When I was granted maintainership there were 163 open issues and 16 open PRs - the oldest dating back 14 years.
Move to django-commons
This project was moved into jazzband not that long ago. Unfortunately the move took place without an identified maintainer so it languished for a few years without a successful update. The jazzband has been a true boon to the Django ecosystem over the years but I think this move is necessary for the health of this library for several reasons:
I still have not been able to get a successful release through the jazzband process.and moving to django-commons would enable trusted publishing through backbone infrastructure in a way that I believe is just more secure. Right now I am publishing directly through my own PyPi account which is not ideal.I do not have admin rights to this repo, nor do I have full admin rights to the pypi repository. This move will be hard to coordinate as we will need to get help from at least @jezdez @vdboor or @chrisglass . Please be patient.
Additional Maintainer
I would like to find at least one other additional maintainer with publish privileges. This will likely not move forward until the move to django-commons is complete. Given where I would like to take this library (see below) if you have experience in the guts of Django's ORM that would be extremely helpful! Otherwise - for trust - you would need an established record in the open source Django ecosystem. The best way to help right now is to pick off issues by opening PRs - I promise to look at them within a reasonable amount of time!
Progress So Far
Roadmap
I am cognizant that there are many outstanding bugs in this library and for users that have invested in its existing functionality fixing these should and will be be my top priority. The focus of the version 4.x series will be fixing those bugs while maintaining backwards compatibility. For version 5.x I would like to take a deeper look at how django-polymorphic works and determine if there are some fundamental changes that might notably increase its performance or simplify the implementation in ways that address the longstanding lack of support for
selected_relatedandprefetch_related.The current design of django-polymorphic is mostly a manager/queryset extension. It basically works by storing the most-derived leaf class ContentType on the parent table(s). When queries are made a second step uses those ContentTypes to run an additional query (or queries) if there are more derived tables for any model in the queryset. This works, is performant enough for most workflows, and is aligned with how most users would implement polymorphism themselves - but there may be deeper tie-ins to the Django ORM that could replace the 2-phase process with a single step process.
I want to acknowledge that of all the outstanding PRs those by @pgammans (@676 and @545) were the most thorough and impactful but they are the only two outstanding PRs I have not merged yet. I am delaying proxy model changes (@676) to version 5.x because there will be breaking changes. The current proxy model support is unintuitive and, I think, incongruous with the intent of proxy models in Django. I did not see a way to offer backwards compatibility with the current behavior without requiring users to change their code. I am delaying
select_relatedandprefetch_relatedsupport (@676) until I can do a more thorough review of the library's architecture and I do not want to publish an interface that might be immediately deprecated in the next release. Thank you @pgammans - I promise these PRs will not languish forever!Version 4.x
The last 4.x release will coincide with a Django LTS release (hopefully 6.2) to give users a solid 3 years to migrate to 5.x.
In priority order, with some issue links these are my areas of focus. Each block will be a release containing fixes in a related area. This should help users more easily identify the source of regressions if they arise and help keep me sane as I work through the backlog.
.alias()On Polymorphic Querysets #658.delete(keep_parents=True)#645savean entity when using a non-default db #486django-polymorphicfilter the popup change list for raw ID fields? #144dumpdata --naturalmanagement command missing parent fields to restore polymorphic child models #175The best way for folks to help right now is to pick out open issues and open PRs that have tests and fixes! I will happily accept and work on PRs that have tests illustrating bugs without the fixes in place yet!
Version 5.x
Version 5.x will include a significant scope of refactoring and potential breaking changes.
select_relatedandprefetch_relatedselect_relatedissue from parent on inherited models to avoid n+1 queries? #436select_relatedfor a polymorphic model only returns base class objects #410Please hold some grace for me and the other contributors to this library. Coming updates will likely trigger regressions. This is unavoidable to make progress and that progress lies at the feet of volunteers who are not remunerated for this work.
Beta Was this translation helpful? Give feedback.
All reactions