[Answer]-Seeking help in designing django models

1👍

You probably need to retrieve all the documents of a wells from time to time. Or you may need to move a document from GTO to EWR. To be efficient with that, I wouldn’t use 3 tables but 1.

You can use choices :

TYPE_CHOICES = (
    (1, 'GTO'),
    (2, 'EWR'),
    (3, 'QPR'),
)

class Document(models.Model):
    # ...your other fields here...
    type = models.IntegerField(choices=TYPE_CHOICES)

Leave a comment