3

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?

David Frascone
  • 283
  • 1
  • 2
  • 6
  • This question seems to be out of scope for SO, and should possibly be posted on http://softwareengineering.stackexchange.com instead. – uvesten Mar 07 '17 at 17:01
  • Well, if the "answer" ends up being a typical database scenario, then, sure, it should be moved. But, since I don't know the answer, and, since there may be a postgres / django way to do it, wouldn't migrating be a bit premature? – David Frascone Mar 07 '17 at 17:08
  • You might be right, I just thought that the "any ideas" ending looked a bit overly broad. But yes, there might be "one way to do it" using Django/Postgres. I don't know of any, however. – uvesten Mar 07 '17 at 17:26
  • This question is still relevant and not answered. Does anyone have any updates? – L. P. Oct 22 '20 at 20:21
  • I ended up writing my own. I'd share details, but, it's proprietary, and not owned by me :( – David Frascone Oct 27 '20 at 14:16

0 Answers0