Skip to content

Commit

Permalink
Registering ComputingFacility class with Django admin.. Addresses #38.…
Browse files Browse the repository at this point in the history
… Also sets the search_fields on TrainingMaterialAdmin thus addresses #49.
  • Loading branch information
joncison committed Aug 12, 2020
1 parent 575ab1f commit d174d4c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ifbcatsandbox_api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,18 @@ class TrainingMaterialLicenseAdmin(ViewInApiModelAdmin):

@admin.register(models.TrainingMaterial)
class TrainingMaterialAdmin(ViewInApiModelAdmin):
search_fields = (
'doi',
'fileName',
'topics__topic',
'keywords__keyword',
'audienceTypes__audienceType',
'audienceRoles__audienceRole',
'difficultyLevel',
# 'providedBy__name',
'license__name',
)

autocomplete_fields = (
'communities',
'elixirPlatforms',
Expand All @@ -215,6 +227,15 @@ class TrainingMaterialAdmin(ViewInApiModelAdmin):
)


@admin.register(models.ComputingFacility)
class ComputingFacilityAdmin(ViewInApiModelAdmin):
autocomplete_fields = (
# 'providedBy',
# 'team',
'trainingMaterials',
)


# register all models that are not registered yet
from django.apps import apps

Expand Down

0 comments on commit d174d4c

Please sign in to comment.