vendredi 18 janvier 2019

Draft/public database pattern for articles with unique fields and multiple edition after published

I have to publish different Map-articles which must have draft/published version and the chance to keep modifying in draft mode after the map was published.

The workflow is : create draft version -> wait for approval and publish -> edit draft version -> wait for approval and publish the update -> edit on draft version -> ...

On each Map may appears many or none points of interest (PoI) or many or none routes, each PoI or Routes dataset cames from external APIs.

On draft mode you could add or delete as many references to dataset as you need.

Also, the Map model need an unique SLUG

This way the model could be:

Map:
    ID
    SLUG (Unique) 
    Name
    Description
    CreationDate
    ...

Data_Url:
    ID
    Type (PoI or Route)
    url
    name
    description
    ...

and a relation of one to many [Map] --< [Data_Url]

I found this post that is similar, but do not work for this case, because it don't work when you have unique fields and do not consider the scenario where you can edit the article(map) after is was published.

Do you know any pattern that take care of this need.

(I'm ussing django for this.)

Aucun commentaire:

Enregistrer un commentaire