From 3d1b04bb263b596930274db171168e0b683c8471 Mon Sep 17 00:00:00 2001 From: altf4arnold Date: Mon, 12 Feb 2024 13:15:42 +0100 Subject: [PATCH] models and admin working for basic information --- tldtester/admin.py | 6 ++++++ tldtester/models.py | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tldtester/admin.py b/tldtester/admin.py index 8c38f3f..7d7042b 100644 --- a/tldtester/admin.py +++ b/tldtester/admin.py @@ -1,3 +1,9 @@ from django.contrib import admin +from .models import TLD +class tlds(admin.ModelAdmin): + list_display = ('tld', 'inet', 'dnssec', 'lastEdition') + + +admin.site.register(TLD, tlds) # Register your models here. diff --git a/tldtester/models.py b/tldtester/models.py index fb6c0c8..5ec1676 100644 --- a/tldtester/models.py +++ b/tldtester/models.py @@ -29,12 +29,12 @@ class TLD(models.Model): ) tld = models.CharField(max_length=30) - dnssec = models.CharField(max_length=5, default=300, choices=DNSSECALGOS) - inet = models.CharField(max_length=1, default=0, choices=INET) + dnssec = models.IntegerField(default=300, choices=DNSSECALGOS) + inet = models.IntegerField(default=0, choices=INET) lastEdition = models.DateTimeField(auto_now=True) def __str__(self): - return self.TLD + return self.tld class Meta: indexes = [