Files @ 70b8aa07aee4
Branch filter:

Location: website/conservancy/usethesource/admin.py

bsturmfels
Simplify settings and move some standard settings into settings.py

These were previously in djangocommonsettings.py, but don't ever vary between
development and production environments.
from django.contrib import admin

from .models import Candidate, Comment


class CommentInline(admin.TabularInline):
    model = Comment
    fields = ['user', 'message']
    extra = 0


@admin.register(Candidate)
class CandidateAdmin(admin.ModelAdmin):
    list_display = ['name', 'vendor', 'device', 'release_date']
    fields = [
        'name',
        'slug',
        'vendor',
        'device',
        'release_date',
        'source_url',
        'binary_url',
        'description',
    ]
    inlines = [CommentInline]
    prepopulated_fields = {'slug': ['name']}