archivebox.base_models.models
Base models using UUIDv7 for all id fields.
Module Contents
Classes
DateTimeField that automatically updates on save (legacy compatibility). |
|
Mixin for models with a notes field. |
|
Mixin for models with health tracking fields. |
|
Mixin for models with a JSON config field. |
|
Functions
API
- class archivebox.base_models.models.PagedQuerySet[source]
Bases:
django.db.models.QuerySet- paged_iterator(chunk_size: int = 500)[source]
Iterate rows using bounded keyset pages instead of one streaming cursor.
Django’s iterator(chunk_size=…) still keeps a single SQLite SELECT cursor open until the full queryset is exhausted. That is fine for read-only exports, but update/migration code does filesystem work and writes while iterating; a long-lived read cursor there can stretch lock waits across thousands of rows. This respects the queryset’s existing filters, order_by(), select_related(), and prefetch_related() state; if no ordering is defined, it falls back to primary-key order.
- class archivebox.base_models.models.AutoDateTimeField[source]
Bases:
django.db.models.DateTimeFieldDateTimeField that automatically updates on save (legacy compatibility).
- class archivebox.base_models.models.ModelWithNotes[source]
Bases:
django.db.models.ModelMixin for models with a notes field.
- class archivebox.base_models.models.ModelWithHealthStats[source]
Bases:
django.db.models.ModelMixin for models with health tracking fields.
- class archivebox.base_models.models.ModelWithConfig[source]
Bases:
django.db.models.ModelMixin for models with a JSON config field.