Open josidridolfo opened 7 months ago
Hello, The plugin is pretty young, and I realize that I forgot some considerations; Many-to-many fields are not stored in the model table, and the resulting intermediate table is just two foreign keys to model records.
If I had to support this kind of relationship (and not GenericForeignKey of course), I would have to make a special case for M2MRelatedManagers. I'll have some time today to try something, I'll keep you updated, but probably not quickly
Hi! First, thanks for making this library!
I'm having an issue with it and m2m models using postgres and psycopg.
Here are is a relevant set of models, one of which inherits the MonitoredModel and the other of which is the Approval that is in the Sandbox.
Here is the output from the interactive shell when I create and try to save a Bid that inherits the MonitoredModel class. First, the relevant content:
Now, the full error message:
I'm unsure if this is an error that others are facing when trying to monitor models with m2m relations. Relevant contents of my Pipfile:
Looks like the save() method in the DynamicSandbox class might be the culprit.
Is there a way to add a check to see if the model has any attributes that are m2m and if so, pass those fields off to separate methods that serialize and deserialize them by grabbing each related model's pk, storing them in a dictionary one-by-one (maybe changing the key so that it appends '-#' to the end of each key), adding that dictionary of related objects and their PKs into the JSON object, and then doing the reverse in the _update_source method?
Alternatively, if this is a known issue - or if this is something that might be unique to my setup - please let me know.