question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add an Abstract Model

See original GitHub issue

Is 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:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
curtismortecommented, Jun 6, 2019

Out of curiosity — have you considered whether multi-table inheritance could solve the extensibility use case we’re aiming at here?

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.

0reactions
florimondmancacommented, Jun 14, 2019

@curtismorte I tracked the customization of permissions in #43 and admin in #45. Updated the roadmap in #42 as well. 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found