Merge pull request #657 from pcoder/5458/make_hostingorder_readable
5458/make hostingorder readable
This commit is contained in:
commit
f1cc3c5892
1 changed files with 10 additions and 4 deletions
|
@ -53,10 +53,12 @@ class OrderDetail(AssignPermissionsMixin, models.Model):
|
||||||
ssd_size = models.IntegerField(default=0)
|
ssd_size = models.IntegerField(default=0)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "%s - %s, %s cores, %s GB RAM, %s GB SSD" % (
|
return "Not available" if self.vm_template is None else (
|
||||||
|
"%s - %s, %s cores, %s GB RAM, %s GB SSD" % (
|
||||||
self.vm_template.name, self.vm_template.vm_type, self.cores,
|
self.vm_template.name, self.vm_template.vm_type, self.cores,
|
||||||
self.memory, self.ssd_size
|
self.memory, self.ssd_size
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class HostingOrder(AssignPermissionsMixin, models.Model):
|
class HostingOrder(AssignPermissionsMixin, models.Model):
|
||||||
|
@ -87,7 +89,11 @@ class HostingOrder(AssignPermissionsMixin, models.Model):
|
||||||
)
|
)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "%s" % (self.id)
|
return ("Order Nr: #{} - VM_ID: {} - {} - {} - "
|
||||||
|
"Specs: {} - Price: {}").format(
|
||||||
|
self.id, self.vm_id, self.customer.user.email, self.created_at,
|
||||||
|
self.order_detail, self.price
|
||||||
|
)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def status(self):
|
def status(self):
|
||||||
|
|
Loading…
Reference in a new issue