Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/models.py
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
class DepositClient(User): | class DepositClient(User): | ||||
"""Deposit client | """Deposit client | ||||
""" | """ | ||||
collections = ArrayField(models.IntegerField(), null=True) | collections = ArrayField(models.IntegerField(), null=True) | ||||
objects = UserManager() | objects = UserManager() # type: ignore | ||||
# this typing hint is due to a mypy/django-stubs limitation, | |||||
# see https://github.com/typeddjango/django-stubs/issues/174 | |||||
provider_url = models.TextField(null=False) | provider_url = models.TextField(null=False) | ||||
domain = models.TextField(null=False) | domain = models.TextField(null=False) | ||||
class Meta: | class Meta: | ||||
db_table = 'deposit_client' | db_table = 'deposit_client' | ||||
def __str__(self): | def __str__(self): | ||||
return str({ | return str({ | ||||
Show All 28 Lines | class Deposit(models.Model): | ||||
swh_anchor_id = models.TextField(blank=True, null=True) | swh_anchor_id = models.TextField(blank=True, null=True) | ||||
swh_anchor_id_context = models.TextField(blank=True, null=True) | swh_anchor_id_context = models.TextField(blank=True, null=True) | ||||
# Deposit's status regarding loading | # Deposit's status regarding loading | ||||
status = models.TextField( | status = models.TextField( | ||||
choices=DEPOSIT_STATUS, | choices=DEPOSIT_STATUS, | ||||
default=DEPOSIT_STATUS_PARTIAL) | default=DEPOSIT_STATUS_PARTIAL) | ||||
status_detail = JSONField(null=True) | status_detail = JSONField(null=True) | ||||
# deposit can have one parent | # deposit can have one parent | ||||
parent = models.ForeignKey('self', null=True) | parent = models.ForeignKey('self', on_delete=models.PROTECT, null=True) | ||||
check_task_id = models.TextField( | check_task_id = models.TextField( | ||||
blank=True, null=True, | blank=True, null=True, | ||||
verbose_name="Scheduler's associated checking task id" | verbose_name="Scheduler's associated checking task id" | ||||
) | ) | ||||
load_task_id = models.TextField( | load_task_id = models.TextField( | ||||
blank=True, null=True, | blank=True, null=True, | ||||
verbose_name="Scheduler's associated loading task id" | verbose_name="Scheduler's associated loading task id" | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |