Opened 12 years ago

Closed 12 years ago

Last modified 2 weeks ago

#19103 closed Uncategorized (wontfix)

Docs for swappable model option

Reported by: me@… Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords: swappable
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Used by auth user model.

Change History (4)

comment:1 by Preston Holmes, 12 years ago

Resolution: wontfix
Status: newclosed

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.

comment:2 by Omer Katz, 11 years ago

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

comment:3 by Justin Michalicek, 5 months ago

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.

comment:4 by Ryan Hiebert, 2 weeks ago

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 ORM. Either get rid of it (excepting backward compatibility concerns) or support it fully, continuing this limbo state is bad for everyone.

Last edited 2 weeks ago by Ryan Hiebert (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top