From 0e0016382c8da2095e7589eda60c495fc8279a63 Mon Sep 17 00:00:00 2001 From: flifloo Date: Fri, 3 Dec 2021 03:40:41 +0100 Subject: [PATCH] Register model to admin panel --- crew/admin.py | 5 ++++- crew/models.py | 3 +++ error/admin.py | 5 ++++- error/models.py | 3 +++ people/admin.py | 4 +++- rescue/admin.py | 5 ++++- rescue/models.py | 3 +++ 7 files changed, 24 insertions(+), 4 deletions(-) diff --git a/crew/admin.py b/crew/admin.py index 8c38f3f..0cce81d 100644 --- a/crew/admin.py +++ b/crew/admin.py @@ -1,3 +1,6 @@ from django.contrib import admin -# Register your models here. +from crew.models import Crew + + +admin.site.register(Crew) diff --git a/crew/models.py b/crew/models.py index c5f6578..8bff808 100644 --- a/crew/models.py +++ b/crew/models.py @@ -8,3 +8,6 @@ class Crew(Model): members = ManyToManyField(People) description = TextField() + + def __str__(self): + return self.name diff --git a/error/admin.py b/error/admin.py index 8c38f3f..29df94f 100644 --- a/error/admin.py +++ b/error/admin.py @@ -1,3 +1,6 @@ from django.contrib import admin -# Register your models here. +from error.models import ThomasPesquetQuotes + + +admin.site.register(ThomasPesquetQuotes) diff --git a/error/models.py b/error/models.py index 2d34d62..cfe505b 100644 --- a/error/models.py +++ b/error/models.py @@ -3,3 +3,6 @@ from django.db.models import Model, TextField class ThomasPesquetQuotes(Model): text = TextField() + + def __str__(self): + return self.text diff --git a/people/admin.py b/people/admin.py index 8c38f3f..695f420 100644 --- a/people/admin.py +++ b/people/admin.py @@ -1,3 +1,5 @@ from django.contrib import admin -# Register your models here. +from people.models import People + +admin.site.register(People) diff --git a/rescue/admin.py b/rescue/admin.py index 8c38f3f..a091270 100644 --- a/rescue/admin.py +++ b/rescue/admin.py @@ -1,3 +1,6 @@ from django.contrib import admin -# Register your models here. +from rescue.models import Rescue + + +admin.site.register(Rescue) diff --git a/rescue/models.py b/rescue/models.py index 5089e3b..3b0e67a 100644 --- a/rescue/models.py +++ b/rescue/models.py @@ -19,3 +19,6 @@ class Rescue(Model): description = QuillField() sources = QuillField() + + def __str__(self): + return self.name