I have a Django project that has multiple django \"apps\". One of them has models to represent data coming from an external source (I do not control this data).
I want m
You could try using an unmanaged model:
from django.db import models
class ReferencedModel(models.Model):
pass
class ManagedModel(models.Model):
my_fake_fk = models.IntegerField(
db_column='referenced_model_id'
)
class UnmanagedModel(models.Model):
my_fake_fk = models.ForeignKey(
ReferencedModel,
db_column='referenced_model_id'
)
class Meta:
managed = False
db_table = ManagedModel._meta.db_table
Specifying managed=False
in a Model Meta class will not create a db table for it. However, it will behave exactly like other models.