Good morning, I'm starting now with Python and Django and I had a question about the creation of my models. I'd like to create something like:
Person (models.Model)
- Name
- ...
- Address
Address ()
- Backyard
- Neighborhood
- ...
That is, separate the address as a value object to be able to use in more than one model. In the database the fields within the address class will be persisted within the People table and other entities that may appear (Company, Client, "Anyone who can have an address"). So avoid duplicating all address fields for each template you need.
I saw what you would do to set the Meta of the address to abstract and inheriting Address Person. But if I want to do more ValueObjects I will have to inherit from several classes for this, I would like to know if there is a more correct way.
Thank you.