Subclass model classes #52

Closed
brew opened this Issue Nov 8, 2012 · 2 comments

Comments

Projects
None yet
2 participants

brew commented Nov 8, 2012

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 commented Nov 8, 2012

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

brew/django-user-accounts@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'

Owner

brosner commented Jan 14, 2014

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 Jan 14, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment