Add an Abstract Model
See original GitHub issueIs your feature request related to a problem? Please describe. For a multi-tenant database, the original model may need to be extended to include some type of foreign key relationship.
Describe the solution you’d like
It would be nice to have a class like AbstractAPIKey
where we can make our own customizations to the default model.
Describe alternatives you’ve considered Having a mixin that can be used, along with some documentation for subclassing helpers, admin, and permissions.
Additional context N/A
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to create Abstract Model Class in Django? - GeeksforGeeks
Abstract Base Class are useful when you want to put some common information into a number of other models. You write your base...
Read more >How to create an abstract model class in Django - Dev Genius
Creating abstract model classes in Django is pretty easy! Let's examine the example below: from django.db import modelsclass Car(models.Model):
Read more >Using abstract models in Django - DEV Community
All you have to do is create a base model with all the common fields and set abstract = True in the meta...
Read more >Models - Django documentation
A model is the single, definitive source of information about your data. It contains the essential fields and behaviors of the data you're...
Read more >django abstract models versus regular inheritance
I actually want to know the difference between a model class that inherits from a django abstract class (Meta: abstract = True) and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It could solve the extensibility use case. However, it makes the assumption that you want relationships to each key as opposed to being able to add fields to the model itself.
Those are the two common use cases IMO.
@curtismorte I tracked the customization of permissions in #43 and admin in #45. Updated the roadmap in #42 as well. 👍