When developing a website for documenting system documentation, I came across a hard nut to crack the "mapping" / relationship between databases in Django.
A simplified model for my local database:
from django.db import models
class Document(models.Model):
name = models.CharField(max_length=200)
system_id = models.IntegerField()
...
Imaginary model, system data is stored in a remote database.
from django.db import models
class System(models.Model):
name = models.CharField(max_length=200)
system_id = models.IntegerField()
...
The idea is that when creating a new document record on my site, the identifier of the associated system should be stored in a local database. When presenting the data, I would have to use the stored identifier to get the system name among other details from the remote database.
, , , . / Document, , , /.
?
, . , . PostgreSQL, , , .