0
Hello, guys, I’m doing a Django project and I have a question about the modeling of entities. In my project, one person can take on multiple criminal records. One day she may be a saleswoman for the company, but the next day she may be off (or even no longer be a company employee) and may be a company customer. This way, she will have two types of registration in the company. When I go to search for the person’s name, I want to get all of her records as a seller and all of her records as a customer.
Usually, modeling schemes bring separate Seller and Customer tables. But, this way, if I go to search for the name of the person I have to take the name and go through the table Seller and check if the name is there and also go through the table customer. For this system, is it normal, common to have these tables separately? Is there another way more suitable.
Thank you in advance.
From what you described, it sounds like you’re talking about an "Avon" saleswoman who’s a customer and a saleswoman, but might not make sales in a month, right? You could create an abstract Template Class containing active Boolean type in the month or not and with an auto-populated update field for every time you upgrade
– Carlos Cortez
Thank you, Carlos Cortez, for the suggestion. However, at first, I found a possible solution in the Django documentation through Onetoonefield, on the link https://docs.djangoproject.com/en/3.1/topics/db/examples/one_to_one/. In my case, I would create a table for Person and others for Seller and Customer. First, register the person, who may be a seller and/or customer.
– douglas1alc