Adding admin for rideshare.Ride

This commit is contained in:
Víðir Valberg Guðmundsson 2018-08-10 18:37:27 +02:00
parent 3229838d0a
commit c83ebfed08
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,8 @@
from django.contrib import admin
# Register your models here.
from .models import Ride
@admin.register(Ride)
class RideModelAdmin(admin.ModelAdmin):
list_filter = ('camp', 'user')

View file

@ -20,3 +20,11 @@ class Ride(UUIDModel, CampRelatedModel):
'camp_slug': self.camp.slug
}
)
def __str__(self):
return "{} seats from {} at {} by {}".format(
self.seats,
self.location,
self.when,
self.user
)