[okfn-help] vdm: primary keys question

Rufus Pollock rufus.pollock at okfn.org
Mon Aug 16 19:21:08 BST 2010


On 16 August 2010 15:45, Martijn Faassen <faassen at startifact.com> wrote:
> Hi there,
>
> On Mon, Aug 16, 2010 at 3:55 PM, Rufus Pollock <rufus.pollock at okfn.org> wrote:
>
>> This is used indeed to track the deleted state (though also pending:
>> you could have an object that is created but not yet displayed pending
>> approval by someone). You could also use 'pending' on object
>> *revisions* to have several revisions to the same object (so same
>> object_id, but different revision ids) each in a pending state.
>
> How does state interact with relations? I.e. if I have a relation to
> an object that is deleted, will
> it show up in the relation or not? I'm trying to figure out how smart
> the code that uses the
> model will need to be about this.

No it won't because we have a fairly complete 'stateful' wrapper for
dicts and lists in the stateful.py module and we use that when
creating the relations (usually relations have to be created via
associationproxy model to make this all work).

> (I'll have to think the pending story through a bit more. it's very
> important to my use case, including pending relations and the ability
> to revert pending items)

Indeed, and reverting with vdm is very easy: you just delete (really
delete!) the relevant 'revision'

Rufus



More information about the okfn-help mailing list