Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Subclass model classes #52

Closed
brew opened this Issue · 2 comments

2 participants

@brew

I'd like to define my own models by extending the classes in account.models. For example, I'd like to provide my own EmailConfirmation model so I can override the send method to do some project specific things with the email templates. Have I overlooked something, or is this currently not possible with django-user-accounts?

@brew

Here's one potential way to do it using get_model().

brew@b699185

Projects can create their own class with account.EmailConfirmation as the superclass and override what ever methods they need. Then define the new class in the settings file using:

ACCOUNT_EMAIL_CONFIRMATION_MODEL = 'my_app.MyEmailConfirmation'

@brosner
Owner

Overriding models is simply not something supported. This is largely due to Django not providing a mechanism for handling that.

However, you are not out of luck. Recently we added the ability to use hooks to customize email template functionality. See http://django-user-accounts.readthedocs.org/en/latest/settings.html#account-hookset

@brosner brosner closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.