Skip to content

scrap TOPICS, store data as NODE_CACHE #5

@bcipolli

Description

@bcipolli

NODE_CACHE format should be the standard format for our topic tree. It's a much more simple representation, more amenable to editing and fast searching.

The major issue with NODE_CACHE is that it can't be saved easily--parent, parents, and children all have object references that wind up creating loops.

So, here's how to save/load NODE_CACHE to/from disk. Then, TOPICS just becomes NODE_CACHE['Topic'][""]:

  • convert parent, parents, and children to slugs before streaming to disk
  • after loading from disk, convert those slugs into actual object references in a simple loop. Efficient, as lookup in a dict is hashed, so fast.

That's it! Then, editing becomes so easy, to add / edit / delete nodes. No tree structure needed for navigation; just add, setting all properties necessary on the node, and you're done!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions