doorstop icon indicating copy to clipboard operation
doorstop copied to clipboard

extended attribute when creating a document

Open eterX opened this issue 4 years ago • 2 comments

Hi guys,

Can't realize why the conclusion to #344 was that UUID's are not an important feature (considering their role in import/export round cycles). :) Anyway, it's a good excuse for a newbie like me to practice with ext_attrs. So, I implemented them in my tree initialisation script this way:

doc = self.tree.create_document()
doc.extended_reviewed.append("guid")
doc._attribute_defaults = {"guid": None}
doc.save()

Is that somewhere near a good solution? (hidden member and all...)

Leandro

ps: thanks for this wondeful software!

/label help

eterX avatar Jan 13 '21 00:01 eterX

Hey, the code seems to work and should result in the proper fields in the generated .doorstop.yml file for your document. 👍

On the topic of UUID's: each item has a UID (as specified in the name), wouldn't that suffice for identifying items? This UID is also included in imports and exports, so that should do the trick, right?

berendkleinhaneveld avatar May 28 '21 20:05 berendkleinhaneveld

UUID-functionality is vital for tracing over long periods of time. It is, in the current implementation, possible to remove a requirement and re-add it. So the UID in the name will not suffice to follow some standards currently.

Minimum example of UID-reuse (which is bad!):

$ doorstop add REQ REQ
building tree...
created document: REQ (@/REQ)
$ doorstop add REQ
building tree...
added item: REQ001 (@/REQ/REQ001.yml)
$ doorstop add REQ
building tree...
added item: REQ002 (@/REQ/REQ002.yml)
$ doorstop remove REQ002
building tree...
removed item: REQ002 (@/REQ/REQ002.yml)
$ doorstop add REQ
building tree...
added item: REQ002 (@/REQ/REQ002.yml)

neerdoc avatar Mar 09 '22 10:03 neerdoc