Commit 1ec01f9b authored by tmslav's avatar tmslav

Merge pull request #64 from sgoudelis/feature/orders_admin

Added human readable representations of hosting order models to bette…
parents 37e75ec3 849c5a22
from django.contrib import admin
from .models import RailsBetaUser, VirtualMachineType
from .models import RailsBetaUser, VirtualMachineType, HostingOrder, VirtualMachinePlan
admin.site.register(RailsBetaUser)
admin.site.register(VirtualMachineType)
admin.site.register(HostingOrder)
admin.site.register(VirtualMachinePlan)
......@@ -100,6 +100,12 @@ class VirtualMachinePlan(models.Model):
instance = cls.objects.create(**data)
return instance
def __str__(self):
"""
str cast with a friendly representation of the ContactMessage object
"""
return "Cores: %s, mem: %s, type: %s" % (self.cores, self.memory, self.vm_type)
class HostingOrder(models.Model):
......@@ -135,6 +141,11 @@ class HostingOrder(models.Model):
self.cc_brand = stripe_charge.source.brand
self.save()
def __str__(self):
"""
str cast with a friendly representation of the ContactMessage object
"""
return "Plan: %s, customer: %s, approved: %s" % (self.VMPlan, self.customer, self.approved)
......
from django.contrib import admin
from .models import StripeCustomer
# Register your models here.
admin.site.register(StripeCustomer)
......@@ -151,6 +151,13 @@ class StripeCustomer(models.Model):
return stripe_customer
def __str__(self):
"""
str cast with a friendly representation of the ContactMessage object
"""
return "User: %s, Stripe_id: %s" % (self.user, self.stripe_id)
class CreditCards(models.Model):
name = models.CharField(max_length=50)
......
from django.contrib import admin
from utils.models import BillingAddress
# Register your models here.
admin.site.register(BillingAddress)
......@@ -11,6 +11,11 @@ class BillingAddress(models.Model):
postal_code = models.CharField(max_length=50)
country = CountryField()
def __str__(self):
"""
str cast with a friendly representation of the BillingAddress object
"""
return "%s %s %s %s" % (self.street_address, self.city, self.postal_code, self.country)
class ContactMessage(models.Model):
......@@ -21,4 +26,7 @@ class ContactMessage(models.Model):
received_date = models.DateTimeField(auto_now_add=True)
def __str__(self):
"""
str cast with a friendly representation of the ContactMessage object
"""
return "%s - %s - %s" % (self.name, self.email, self.received_date)
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 to comment