Added human readable representations of hosting order models to better manage order from the admin interface.

Related ticket:
https://redmine.ungleich.ch/issues/1715
This commit is contained in:
Efstratios Goudelis 2016-05-11 13:02:35 +03:00
commit 849c5a2270
6 changed files with 34 additions and 4 deletions

View file

@ -1,3 +1,4 @@
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)
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)