While this is django+postgresql, the answer could be generic sql or from a "Databases for Dummies" book.
We have a database with several interrelated models (one to one, one to many, and many to many fields). We'd like to allow a user to shadow-edit the database, and only publish once he's happy with the changes.
For a single model, I could use something like django-reversions, and I could handle the relationships by hand in a hacky sort of way. But, this would have several side effects:
- The models not in control of django could change, which would update the data immediately (no shadow copy)
- Since external relationships are being stored, things will get strange if there are a lot of edits to them.
- Huge amount of work 'catching' CRUD operations and routing them to published or draft entries (if particular user is editing)
- Need to fix all pks on relations when publishing (more hack-titude)
What I'd really like is something that would do this:
- Allow editing of many related tables at once, over many REST CRUD calls, and only updating after 'publishing'
- Allow rolling back to previous version (versioning)
Any ideas?