django inspectdb, foreignkey from different schema

Viewed 20

in schema_curriculum & table clearance_item I added a constraint(ForeignKey) to schema_srgb & table_student then, I try to run inspectdb with the following command py manage.py inspectdb --database=curriculum clearance_item > models.py

class ClearanceItem(models.Model):
cl_itemid = models.CharField(primary_key=True, max_length=20)
studid = models.CharField(max_length=9, blank=True, null=True)
office = models.ForeignKey('ClearingOffice', models.DO_NOTHING, blank=True, null=True)
sem = models.CharField(max_length=1, blank=True, null=True)
sy = models.CharField(max_length=9, blank=True, null=True)
remarks = models.TextField(blank=True, null=True)
resolution = models.TextField(blank=True, null=True)
resolve = models.BooleanField(blank=True, null=True)
resolve_date = models.DateField(blank=True, null=True)
resolve_by = models.CharField(max_length=8, blank=True, null=True)
recorded_by = models.CharField(max_length=8, blank=True, null=True)
record_date = models.DateField(blank=True, null=True)

class Meta:
    managed = False
    db_table = 'clearance_item'

I was hoping studid should change from CharField to ForeignKey, is it possible to form a connection from db1.schema2 > db.1schema1 tables

0 Answers
Related