Best solution for a limited number of dynamic model fields in Django app

21 views Asked by At

I'm using Django to build an app for outdoor professionals (educators, guides) to keep track of their experience. Basically a logbook but eventually with features like collaboration, mapping, and reporting. You can see what I have so far here

Currently working on the Experience model. An Experience will have standard attributes like where did you go, when, was it a professional trip or your own personal recreation, who were your clients? But it should also have attributes specific to each outdoor pursuit. For paddling, canoes, kayaks, etc. For whitewater, what grade (1, 2, 3..)? For climbing, what grade (5.10, 5.11..) and how many pitches?

I'll build in many of these attributes, but I also want the app to be flexible enough that users can add their own sport (e.g., barefoot snow skiing) and create fields based on what an employer would need to know about their experiences in that sport.

Many of the posts on dynamic model fields in Django are several years old. For example, this mentions EAV but says there's no clear leader for an implementation. Today Django EAV 2 seems to be pretty strong? Apparently there are still efficiency concerns compared to JSON?

Given that most of my users won't need custom fields, and those who do will define maybe 2-3 Experience types with 5-6 custom fields each, I'm wondering what would be the best way to do implement this today.

Currently on postges, but would love a database-agnostic solution in case I decide to use a different database for production. Note: I'm early enough in this project that I'm even open to using a platform other than Django, if there's one that makes way more sense for this.

Thanks in advance!

0

There are 0 answers