0

I'm trying to create a business directory in multiple languages. Should I aggregate all the data in one JSONField, or should split it into multiple models, and why.

models.py
from django.db import models
from django.contrib.postgres.fields import JSONField

class Business(models.Model):
    name = models.CharField(max_length=500)
    subsidiary = models.ForeignKey(Business, on_delete=models.SET_NULL, null=True, blank=True)
    data = JSONField()

{"name":{"ar":"Arabic Name","en":"English Name"}} etc

ghophri
  • 183
  • 1
  • 1
  • 12

1 Answers1

0

It's actually better to use JSONField as an alternative for multilingual websites for to save TextField and CharField.

Otherwise linking everything through ForeignKey and other links is better.

ghophri
  • 183
  • 1
  • 1
  • 12