X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/aae232dcf008ab39db553bc1b20573fa00e3b191..b17486a9270334855c3b908b8250e3a020803875:/doc/architecture.rst?ds=inline diff --git a/doc/architecture.rst b/doc/architecture.rst index db5b6989d..d1985e482 100644 --- a/doc/architecture.rst +++ b/doc/architecture.rst @@ -16,7 +16,7 @@ What are ``Tags`` used for? --------------------------- Each ``Tag`` objects has a ``category`` field specyfying its meaning. -The categories are enumerated in :py:const:`catalogue.models.TAG_CATEGORIES`. +The categories are enumerated in :py:const:`catalogue.models.tag.TAG_CATEGORIES`. Tags are used for: @@ -27,7 +27,6 @@ Tags are used for: * User shelves. A User can put a ``Book`` on a shelf and add some labels by adding a number of ``set`` tags to it. A book put on a shelf without any labels has a Tag with an empty name. -* Denoting :ref:`ancestor-descendant-relations` using ``book`` tags. .. _ancestor-descendant-relations: @@ -44,22 +43,6 @@ the ``dc:relation.hasPart`` metadata field, exposed by and the order of children of one parent is expressed with the child book's ``parent`` and ``parent_number`` fields. -But aside from that, Tags are used for managing those relationships, too. - -Every ``Book`` has a matching `l-tag`. It's a ``Tag`` of category -``book`` and matching slug with an added 'l-' prefix (the prefix -is superfluous and we should remove it as some point, as it was only -needed when tag slugs had to be unique). - -The `l-tag` of a ``Book`` is used on: - -* all of the book's fragments, -* all of the book's descendants, -* all of the book's descendants' fragments. - -This is used for: - -* finding fragments of a given theme in books with a given user label, -* on a filtered book list (i.e., author's page), for eliminating - descendants, if an ancestor is already on the list, -* when calculating tag book counts, for eliminating descendants as above, +Additionally, every ``Book`` has a many-to-many relationship `ancestor`, +onnecting it to all its ancestors, with reverse relationship called +`descendant`. This relationship is rebuilt after a `Book` is published.