mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-17 20:01:44 +02:00
add docstrings
This commit is contained in:
@@ -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 typing import Any, Dict, Union, List, Set, NamedTuple, cast
|
||||||
|
|
||||||
from ulid import ULID
|
from ulid import ULID
|
||||||
@@ -54,6 +60,9 @@ def get_or_create_system_user_pk(username='system'):
|
|||||||
|
|
||||||
|
|
||||||
class ABIDModel(models.Model):
|
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_prefix: str = DEFAULT_ABID_PREFIX # e.g. 'tag_'
|
||||||
abid_ts_src = 'None' # e.g. 'self.created'
|
abid_ts_src = 'None' # e.g. 'self.created'
|
||||||
abid_uri_src = 'None' # e.g. 'self.uri'
|
abid_uri_src = 'None' # e.g. 'self.uri'
|
||||||
|
@@ -50,7 +50,7 @@ STATUS_CHOICES = [
|
|||||||
|
|
||||||
class Tag(ABIDModel):
|
class Tag(ABIDModel):
|
||||||
"""
|
"""
|
||||||
Based on django-taggit model
|
Based on django-taggit model + ABID base.
|
||||||
"""
|
"""
|
||||||
abid_prefix = 'tag_'
|
abid_prefix = 'tag_'
|
||||||
abid_ts_src = 'self.created' # TODO: add created/modified time
|
abid_ts_src = 'self.created' # TODO: add created/modified time
|
||||||
|
Reference in New Issue
Block a user