Sinar / popit_ng

Database and API implementation of Popolo standard
GNU Affero General Public License v3.0
22 stars 4 forks source link

Integrate django reversion #27

Open sweemeng opened 8 years ago

sweemeng commented 8 years ago

Tl;Dr Make changes to app to enable reversion to work well with app, and create API endpoint

Currently reversion works with hvad with some work.

Currently need to extract the model from _meta from a TranslationModel Instance

reversion.register(ContactDetail, follow=[ "translation" ])
# a bit magical. Should streamline this
reversion.register(ContactDetail._meta.translations_model)

Revision for translation actually exist, and can be viewed with the library

reversion.get_for_object(contact._meta.translations_model.objects.get(language_code="en",master=contact.id))[0].object_version.object

But the admin page will break, as we need to redo the translation. And need to design an API for this feature, API is not planned as we expect to use admin page for this feature.

sweemeng commented 7 years ago

Consider to drop this feature in favor of https://github.com/popolo-project/popolo-spec/issues/47

Bigger concern is how do we support rollback of data