ccdb-api/ccdb/species/admin.py
Matthew Dillon 983ce6f021 TST: Travis/Coveralls setup (#10)
- add travis.yml
- linting
- coveralls
- readme
2016-08-28 16:34:57 -07:00

36 lines
1.3 KiB
Python

from django.contrib import admin
from .models import Species, TrapSpecies, CollectionSpecies
class SpeciesAdmin(admin.ModelAdmin):
list_display = ('common_name', 'genus', 'species', 'parasite',
'sort_order')
list_display_links = ('common_name',)
search_fields = ('common_name', 'genus', 'species', 'parasite')
list_per_page = 25
fields = ('common_name', 'genus', 'species', 'parasite', 'sort_order')
class TrapSpeciesAdmin(admin.ModelAdmin):
list_display = ('collection_trap', 'species', 'sex', 'count',
'count_estimated')
list_display_links = ('count',)
search_fields = ('collection_trap', 'species', 'sex', 'count',
'count_estimated')
list_per_page = 25
fields = ('collection_trap', 'species', 'sex', 'count', 'count_estimated')
class CollectionSpeciesAdmin(admin.ModelAdmin):
list_display = ('collection', 'species', 'sex', 'count', 'count_estimated')
list_display_links = ('count',)
search_fields = ('collection', 'species', 'sex', 'count',
'count_estimated')
list_per_page = 25
fields = ('collection', 'species', 'sex', 'count', 'count_estimated')
admin.site.register(Species, SpeciesAdmin)
admin.site.register(TrapSpecies, TrapSpeciesAdmin)
admin.site.register(CollectionSpecies, CollectionSpeciesAdmin)