Commit 6c98c553 by Dudás Ádám

storage: improve documentation

parent 5ca86fb9
...@@ -49,7 +49,8 @@ class Disk(TimeStampedModel): ...@@ -49,7 +49,8 @@ class Disk(TimeStampedModel):
size = FileSizeField() size = FileSizeField()
base = ForeignKey('self', blank=True, null=True, base = ForeignKey('self', blank=True, null=True,
related_name='derivatives') related_name='derivatives')
ready = BooleanField(default=False) ready = BooleanField(default=False,
help_text=_("The associated resource is ready."))
dev_num = CharField(default='a', max_length=1, dev_num = CharField(default='a', max_length=1,
verbose_name=_("device number")) verbose_name=_("device number"))
destroyed = DateTimeField(blank=True, default=None, null=True) destroyed = DateTimeField(blank=True, default=None, null=True)
...@@ -163,6 +164,13 @@ class Disk(TimeStampedModel): ...@@ -163,6 +164,13 @@ class Disk(TimeStampedModel):
:param self: the disk model to reify :param self: the disk model to reify
:type self: storage.models.Disk :type self: storage.models.Disk
:param user: The user who's issuing the command.
:type user: django.contrib.auth.models.User
:param task_uuid: The task's UUID, if the command is being executed
:type task_uuid: str
:return: True if a new reification of the disk has been created; :return: True if a new reification of the disk has been created;
otherwise, False. otherwise, False.
:rtype: bool :rtype: bool
...@@ -212,6 +220,8 @@ class Disk(TimeStampedModel): ...@@ -212,6 +220,8 @@ class Disk(TimeStampedModel):
return True return True
def destroy_async(self, user=None): def destroy_async(self, user=None):
"""Execute destroy asynchronously.
return local_tasks.destroy.apply_async(args=[self, user], return local_tasks.destroy.apply_async(args=[self, user],
queue='') queue='')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment