diff --git a/mentoring/pairing/admin.py b/mentoring/pairing/admin.py index 6f82711..637f680 100644 --- a/mentoring/pairing/admin.py +++ b/mentoring/pairing/admin.py @@ -2,5 +2,12 @@ from django.contrib import admin from .models import Pair, HistoricalPair -admin.site.register(Pair) -admin.site.register(HistoricalPair) +class PairAdmin(admin.ModelAdmin): + list_display = ('mentor', 'learner', 'pair_id') + +admin.site.register(Pair, PairAdmin) + +class HistoricalPairAdmin(admin.ModelAdmin): + list_display = ('pair_id',) + +admin.site.register(HistoricalPair, HistoricalPairAdmin) diff --git a/mentoring/pairing/models.py b/mentoring/pairing/models.py index 4c07c79..4c76711 100644 --- a/mentoring/pairing/models.py +++ b/mentoring/pairing/models.py @@ -53,6 +53,9 @@ class HistoricalPair(models.Model): indefinitely. """ + def __str__(self): + return self.pair_id + @classmethod def record_pairing(cls, pair): """Record that a pairing has been made."""