Compare commits

...

6 commits

Author SHA1 Message Date
tmslav
1ec01f9b57 Merge pull request #64 from sgoudelis/feature/orders_admin
Added human readable representations of hosting order models to bette…
2016-05-17 01:39:44 +02:00
Efstratios Goudelis
849c5a2270 Added human readable representations of hosting order models to better manage order from the admin interface.
Related ticket:
https://redmine.ungleich.ch/issues/1715
2016-05-11 13:02:35 +03:00
Levi Velázquez
37e75ec355 Merge pull request #60 from levivm/feature/vm_pricing
Added Hosting Pages Tests
2016-05-05 01:08:19 -05:00
Levi Velázquez
ffb0b6b6fb Merge pull request #58 from levivm/feature/vm_pricing
Added booked VM detail page
2016-05-04 00:20:59 -05:00
Levi Velázquez
7455668161 Merge pull request #57 from levivm/feature/vm_pricing
Changed redirect url after login
2016-05-03 01:07:16 -05:00
Levi Velázquez
ec5cecb7c3 Merge pull request #56 from levivm/feature/vm_pricing
Added pagination to orders view, Created, Virtual machines booked view
2016-05-03 01:03:17 -05:00
6 changed files with 34 additions and 4 deletions

View file

@ -1,6 +1,8 @@
from django.contrib import admin from django.contrib import admin
from .models import RailsBetaUser, VirtualMachineType from .models import RailsBetaUser, VirtualMachineType, HostingOrder, VirtualMachinePlan
admin.site.register(RailsBetaUser) admin.site.register(RailsBetaUser)
admin.site.register(VirtualMachineType) admin.site.register(VirtualMachineType)
admin.site.register(HostingOrder)
admin.site.register(VirtualMachinePlan)

View file

@ -100,6 +100,12 @@ class VirtualMachinePlan(models.Model):
instance = cls.objects.create(**data) instance = cls.objects.create(**data)
return instance 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): class HostingOrder(models.Model):
@ -135,6 +141,11 @@ class HostingOrder(models.Model):
self.cc_brand = stripe_charge.source.brand self.cc_brand = stripe_charge.source.brand
self.save() 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)

View file

@ -1,3 +1,4 @@
from django.contrib import admin from django.contrib import admin
from .models import StripeCustomer
# Register your models here. admin.site.register(StripeCustomer)

View file

@ -151,6 +151,13 @@ class StripeCustomer(models.Model):
return stripe_customer 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): class CreditCards(models.Model):
name = models.CharField(max_length=50) name = models.CharField(max_length=50)

View file

@ -1,3 +1,4 @@
from django.contrib import admin from django.contrib import admin
from utils.models import BillingAddress
# Register your models here. admin.site.register(BillingAddress)

View file

@ -11,6 +11,11 @@ class BillingAddress(models.Model):
postal_code = models.CharField(max_length=50) postal_code = models.CharField(max_length=50)
country = CountryField() 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): class ContactMessage(models.Model):
@ -21,4 +26,7 @@ class ContactMessage(models.Model):
received_date = models.DateTimeField(auto_now_add=True) received_date = models.DateTimeField(auto_now_add=True)
def __str__(self): def __str__(self):
"""
str cast with a friendly representation of the ContactMessage object
"""
return "%s - %s - %s" % (self.name, self.email, self.received_date) return "%s - %s - %s" % (self.name, self.email, self.received_date)