Soliciting dynamic data model advice

Hello. I’ve built and work on a Django (4.2) app for work, so I’m pretty familiar with the way things function.

I’m looking for advice/input on how to approach a particular data modeling task.

What I would like to do is use Django to create something similar to a “master data management” tool. What this means is that users should be able to create a project and within the project, they should be able to specify the structured data/fields that they want to store as well as how those fields relate to others they specify.

For example, in a new project, a user might specify that they want to track:

  • Brand (as a ‘class’) with properties
    • name (string)
    • age (integer)
    • stores (many-to-many relationship to a Store model)
  • Product
    • name (string)
    • price (float/decimal)
    • brand (foreign key to Brand model)
  • Store
    • name (string)
    • location

What I would like to do is have their specification of this create a series of forms they can use to edit the data and also to optionally make the data available on an API (I typically use Django-ninja).

I do not need these to be Django ORM models in the database with their own tables, etc, but it would be fine if they were. I’m not working with massive amounts of data either.

I’m seeking advice on what models I would create in Django and how I would wire it together to make it seem to the end user like they were working with data models in the same way that they might with hard-coded Django models; full CRUD access (ignoring permissions for the time being).

I should add that another user may need to create an entirely different set of models/forms, so I need a generic data structure that would handle tracking what they want to create and then I suppose another set of models for storing the data itself? It seems like this could be done with a graph model (nodes, edges, each with properties), but I’m not sure that’s a good fit for Django.

Does anybody have links to example projects or resources that provide tips on how to do this type of dynamic data modeling in Django?