I need to have a modular table in postgres that will contain different data with…
- User
I need to have a modular table in postgres that will contain different data with different field names (but the same data). This table needs to be accessed by a django app which will need to always refer to the same field names. How do I do this?
- Assistant
To achieve a modular table structure in PostgreSQL that can be accessed by a Django application, you can use a combination of Polymorphic Associations and Table-Per-Concrete-Class (TPC) inheritance. Here's a step-by-step guide:
- Define a base model in Django:
python
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.