From fdf6f465db2504ca77c6f3bd7fc8fe88358cb9ab Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 14 May 2024 18:46:38 -0700 Subject: [PATCH] add docstrings --- archivebox/abid_utils/models.py | 9 +++++++++ archivebox/core/models.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/archivebox/abid_utils/models.py b/archivebox/abid_utils/models.py index 0645a32f..06fb6c79 100644 --- a/archivebox/abid_utils/models.py +++ b/archivebox/abid_utils/models.py @@ -1,3 +1,9 @@ +""" +This file provides the Django ABIDField and ABIDModel base model to inherit from. + +It implements the ArchiveBox ID (ABID) interfaces including abid_values, get_abid, .abid, .uuid, .id. +""" + from typing import Any, Dict, Union, List, Set, NamedTuple, cast from ulid import ULID @@ -54,6 +60,9 @@ def get_or_create_system_user_pk(username='system'): class ABIDModel(models.Model): + """ + Abstract Base Model for other models to depend on. Provides ArchiveBox ID (ABID) interface. + """ abid_prefix: str = DEFAULT_ABID_PREFIX # e.g. 'tag_' abid_ts_src = 'None' # e.g. 'self.created' abid_uri_src = 'None' # e.g. 'self.uri' diff --git a/archivebox/core/models.py b/archivebox/core/models.py index 0761985f..1b896217 100644 --- a/archivebox/core/models.py +++ b/archivebox/core/models.py @@ -50,7 +50,7 @@ STATUS_CHOICES = [ class Tag(ABIDModel): """ - Based on django-taggit model + Based on django-taggit model + ABID base. """ abid_prefix = 'tag_' abid_ts_src = 'self.created' # TODO: add created/modified time