[Django] #19103: Docs for swappable model option

16 views
Skip to first unread message

Django

unread,
Oct 10, 2012, 10:30:42 AM10/10/12
to django-...@googlegroups.com
#19103: Docs for swappable model option
-------------------------------+-----------------------
Reporter: me@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.4
Severity: Normal | Keywords: swappable
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------
Used by auth user model.

--
Ticket URL: <https://code.djangoproject.com/ticket/19103>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 10, 2012, 1:07:48 PM10/10/12
to django-...@googlegroups.com
#19103: Docs for swappable model option
-------------------------------+--------------------------------------
Reporter: me@… | Owner: nobody
Type: Uncategorized | Status: closed
Component: Documentation | Version: 1.4
Severity: Normal | Resolution: wontfix

Keywords: swappable | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by ptone):

* status: new => closed
* needs_docs: => 0
* resolution: => wontfix
* needs_tests: => 0
* needs_better_patch: => 0


Comment:

At this time, the swappable machinery used for swappable user models is a
private API, intentionally undocumented.

User models are the pilot program and will let us understand what
challenges exist with such an API - providing the chance to make changes
before this API is made public.

If you want to experiment with your API - you can do so, but at your own
risk. However if you do experiment, and have feedback on how the design
works, by all means share it on the mailing list.

In other words, consider this a stealth alpha feature.

--
Ticket URL: <https://code.djangoproject.com/ticket/19103#comment:1>

Django

unread,
Jul 10, 2014, 12:02:08 PM7/10/14
to django-...@googlegroups.com
#19103: Docs for swappable model option
-------------------------------+--------------------------------------
Reporter: me@… | Owner: nobody
Type: Uncategorized | Status: closed
Component: Documentation | Version: 1.4
Severity: Normal | Resolution: wontfix

Keywords: swappable | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by the_drow):

https://github.com/wq/django-swappable-models provides both docs and API
for swappable models.

--
Ticket URL: <https://code.djangoproject.com/ticket/19103#comment:2>

Django

unread,
Sep 2, 2024, 4:54:28 PM9/2/24
to django-...@googlegroups.com
#19103: Docs for swappable model option
-------------------------------+--------------------------------------
Reporter: me@… | Owner: nobody
Type: Uncategorized | Status: closed
Component: Documentation | Version: 1.4
Severity: Normal | Resolution: wontfix
Keywords: swappable | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Comment (by Justin Michalicek):

I found this today after fighting with getting swappable models working
for an app, digging through the source to find the undocumented
`Meta.swappable` for models, and then further finding places in the
swappable model code specifically looking for `AUTH_USER_MODEL`.

I'm very curious as to if there's any plan to complete this functionality.
Currently, it seems to work as long as your settings actually have the
setting specified in `swappable` on your model, which is of course not
great when relying on the default models, but means it's apparently close
to being functional. I saw a few other things when looking at existing
migrations on the app I am working with which looked like they had the
potential to go awry but I haven't tested yet to see.

I had noticed the app mentioned above, but ignored it initially assuming
it was outdated and no longer needed. For now, I will of course give it a
try since it is still actively maintained.
--
Ticket URL: <https://code.djangoproject.com/ticket/19103#comment:3>

Django

unread,
Jan 6, 2025, 10:51:29 AM1/6/25
to django-...@googlegroups.com
#19103: Docs for swappable model option
-------------------------------+--------------------------------------
Reporter: me@… | Owner: nobody
Type: Uncategorized | Status: closed
Component: Documentation | Version: 1.4
Severity: Normal | Resolution: wontfix
Keywords: swappable | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Comment (by Ryan Hiebert):

If we were able to do it over again, I'd try much harder to avoid
swappable models. At this point, they've been a feature for long enough
that we're going to have a really hard time getting rid of it. Major
libraries are using it, such as waffle. Unless we're so solidly against it
that we're going to start actively discouraging using this feature, I
think it's time that we buck up and document and support this feature of
our authentication system. Either get rid of it (excepting backward
compatibility concerns) or support it fully, continuing this limbo state
is bad for everyone.
--
Ticket URL: <https://code.djangoproject.com/ticket/19103#comment:4>
Reply all
Reply to author
Forward
0 new messages