0

Basically a worker reads a queue of rows. I create a table called Work . A worker takes a row (work), it contains several tasks. Each task has several properties.

Is this essentially a Work table with has_many relationship to a Task table holding all the individual tasks belong into a specific work_id? And the individual properties belonging to a single task would be just columns?

Lafexlos
  • 7,618
  • 5
  • 38
  • 53
KJW
  • 15,035
  • 47
  • 137
  • 243

1 Answers1

1

Yes, in my opinion(like yours), Work and Task should be separate tables, where the relation would be, a Work has_many Task

class Work(Model):
    workname = TextField()

class Task(Model):
    work = ForeignKeyField(Work, related_name='works')
    taskname = TextField()
QuestionEverything
  • 4,809
  • 7
  • 42
  • 61