Questions tagged [multi-table-inheritance]
52 questions
0
votes
0 answers
Why does Django Admin shows empty dropdown on foreign key field to multi-inheritance model?
I have the following models:
class BaseModel(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
class Meta:
abstract = True
class Content(BaseModel):
title =…

Tuk
- 143
- 2
- 10
0
votes
1 answer
Hibernate: How to model an Inheritance type structure and do operations without explicit casting
I have an application that consumes incoming messages, parses the data present in the message, and then applies rules to that data. On the Rule entity, there's a column that distinguishes the type of rule.
I want to persist the Result of the rule to…

daniel9x
- 755
- 2
- 11
- 28
0
votes
1 answer
Effectively use Multi-table inheritance (one-to-one relationships)
I need several models that inherit from a base class in a one-to-one relationship. In keeping with the Django example:
from django.db import models
class Place(models.Model):
name = models.CharField(max_length=50)
class Restaurant(Place):
…

Roy Prins
- 2,790
- 2
- 28
- 47
0
votes
0 answers
django-rest-framework multiple serializers in the same request
I know there's something similar answered here, but my question is not the same. I'm using multi-table inheritance to model 2 different types of entities, and both of them can create posts. My problem is when trying to create a view that shows all…

Andres Espinosa
- 402
- 7
- 14
0
votes
1 answer
Double insert using value from previous insert
I have a simple data structure which uses multi-table inheritance:
Table: Event
cols: int **id**, int game_tick
Table Event_A
cols: int *id*, int dmg_taken
Table Event_B
cols: int *id*, float x, float y, float z
.. and other specific event…

Simon Langhoff
- 1,395
- 3
- 18
- 28
0
votes
1 answer
model inheritance + django admin
I am reusing the News model from cmsplugin_news, just adding some extra fields in my inheriting model. (Multi-table inheritance, just as explained here.
from cmsplugin_news.models import News
class News(News):
departments =…

sogeking
- 1,216
- 2
- 14
- 45
0
votes
0 answers
Entity relationship multiple inheritance issue
I have this entity model:
I want to have a Customer entity, which can be either a Person or an Organization, It can't be both.
As of now I came up with a customer entity which points to both organization and person but with a nullable field…

Ashkan
- 3,322
- 4
- 36
- 47