mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
apply recommendation of code-review-doctor
This commit is contained in:
parent
6d3550bb24
commit
2910a3229a
3 changed files with 19 additions and 26 deletions
|
@ -9,12 +9,12 @@ class Storages(models.Model):
|
|||
size = models.IntegerField(_('size'))
|
||||
volumes = models.IntegerField(_('volumes'))
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.name}'
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.name}'
|
||||
|
||||
|
||||
class Volume(models.Model):
|
||||
name = models.CharField(_('name'), max_length=128)
|
||||
|
@ -22,13 +22,13 @@ class Volume(models.Model):
|
|||
allocation = models.IntegerField(_('allocation'))
|
||||
size = models.IntegerField(_('size'))
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.name}'
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
verbose_name_plural = "Volumes"
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.name}'
|
||||
|
||||
|
||||
class Storage(models.Model):
|
||||
state = models.IntegerField(_('state'))
|
||||
|
@ -38,10 +38,10 @@ class Storage(models.Model):
|
|||
path = models.CharField(_('path'), max_length=128)
|
||||
type = models.CharField(_('type'), max_length=128)
|
||||
autostart = models.BooleanField(_('autostart'))
|
||||
volumes = models.ForeignKey(Volume, on_delete=models.DO_NOTHING)
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.path}'
|
||||
volumes = models.ForeignKey(Volume, related_name="storage_volumes", on_delete=models.DO_NOTHING)
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.path}'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue