[Answered ]-How to implement dictionary-like field in Django model?

2👍

You have persons, that are related to groups. You assign group of persons to specific Job and track equipment by job, equipment type and its count.

class Group(models.Model):
    title = models.CharField()

class Person(models.Model):
    name = models.CharField()
    group = models.ForeignKey(Group)

class Job(models.Model)
    name = models.CharField()
    group = models.ForeignKey(Group)

class EquipmentUsage(models.Model)
    job = models.ForeignKey(Job)
    equip_name = models.CharField()
    count = models.IntegerField()

Leave a comment