Commit a122ba2f authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

create admin module for organization

parent d4cb92b0
from .gene import GeneAdmin
from .function import FunctionAdmin, KeggOrthologyAdmin
from django.contrib import admin
from .models import Gene, Function, KeggOrthology
from metagenedb.apps.catalog.models import Gene, Function, KeggOrthology
@admin.register(Gene)
......
from django.contrib import admin
from metagenedb.apps.catalog.models import Function, KeggOrthology
@admin.register(KeggOrthology)
class KeggOrthologyAdmin(admin.ModelAdmin):
list_display = ('function_id', 'name', 'long_name', 'ec_number', 'source')
search_fields = ('function_id',)
@admin.register(Function)
class FunctionAdmin(admin.ModelAdmin):
list_display = ('function_id', 'name', 'source')
search_fields = ('function_id',)
from django.contrib import admin
from metagenedb.apps.catalog.models import Gene
@admin.register(Gene)
class GeneAdmin(admin.ModelAdmin):
list_display = ('gene_id', 'gene_length', 'get_functions')
search_fields = ('gene_id',)
def get_functions(self, obj):
return ",".join([str(f) for f in obj.functions.all()])
get_functions.short_description = 'Functions'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment