diff --git a/datacenterlight/admin.py b/datacenterlight/admin.py index 5a1fc8a2..334a6c06 100644 --- a/datacenterlight/admin.py +++ b/datacenterlight/admin.py @@ -3,6 +3,7 @@ from cms.admin.placeholderadmin import PlaceholderAdminMixin from cms.extensions import PageExtensionAdmin from .cms_models import CMSIntegration, CMSFaviconExtension from .models import VMPricing, VMTemplate +from hosting.models import UserHostingKey class CMSIntegrationAdmin(PlaceholderAdminMixin, admin.ModelAdmin): @@ -17,3 +18,4 @@ admin.site.register(CMSIntegration, CMSIntegrationAdmin) admin.site.register(CMSFaviconExtension, CMSFaviconExtensionAdmin) admin.site.register(VMPricing) admin.site.register(VMTemplate) +admin.site.register(UserHostingKey) diff --git a/hosting/models.py b/hosting/models.py index 48238afe..b7175af5 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -208,6 +208,16 @@ class UserHostingKey(models.Model): created_at = models.DateTimeField(auto_now_add=True) name = models.CharField(max_length=100) + def __str__(self): + display_str = '%s - %s - %s - %s - %s' % ( + self.user.username, + self.user.email, + self.name, + self.created_at, + self.public_key + ) + return display_str + @staticmethod def generate_RSA(bits=2048): '''