UkraineNow-Intel / autoSA-backend

Django backend for autoSA
0 stars 1 forks source link

Manual source refresh #26

Closed D0nPiano closed 2 years ago

D0nPiano commented 2 years ago

Description

This is not meant to be merged (like this at least), but a proof of concept for refreshing with an extra url /refresh.

Limitations:

Checklist

j-bennet commented 2 years ago

Note to self: look at

https://django-postgres-extra.readthedocs.io/en/master/conflict_handling.html

for upsert functionality.

j-bennet commented 2 years ago

@D0nPiano I made some changes to your branch here, to hopefully make this more production-ready. The most important change, I'm using external_id (which should be unique) to ensure items are not duplicated.

Example response:

{
        "liveuamap": {
            "detail": "Refresh completed",
            "errors": {"exceptions": [], "total": 0},
            "overwrite": "true",
            "processed": 3,
        }
    }

Please take a look.