Files
@ 70b8aa07aee4
Branch filter:
Location: website/conservancy/usethesource/admin.py - annotation
70b8aa07aee4
572 B
text/x-python
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.
These were previously in djangocommonsettings.py, but don't ever vary between
development and production environments.
cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd cc3224bb60dd | 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']}
|