-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial configuration for admin-panel * Remove duplicated configuration * Allow empty values in dependencies M2M field * Refactor urls * Fix tests for permissions * Added new migration * Changed url name * Original migration file recovered * Create a new migration file * Changed url name
- Loading branch information
Showing
8 changed files
with
74 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,49 @@ | ||
"""Admin module.""" | ||
|
||
from django.contrib import admin | ||
from .models import Job, Program, ComputeResource | ||
from api.models import JobConfig, Provider, Program, ComputeResource, Job, RuntimeJob | ||
|
||
|
||
@admin.register(JobConfig) | ||
class JobConfigAdmin(admin.ModelAdmin): | ||
"""JobConfigAdmin.""" | ||
|
||
|
||
@admin.register(Provider) | ||
class ProviderAdmin(admin.ModelAdmin): | ||
"""ProviderAdmin.""" | ||
|
||
search_fields = ["name"] | ||
|
||
|
||
@admin.register(Program) | ||
class ProgramAdmin(admin.ModelAdmin): | ||
"""ProgramAdmin.""" | ||
|
||
search_fields = ["title", "author__username"] | ||
list_filter = ["provider", "type"] | ||
exclude = ["env_vars"] | ||
|
||
|
||
@admin.register(ComputeResource) | ||
class ComputeResourceAdmin(admin.ModelAdmin): | ||
"""ComputeResourceAdmin.""" | ||
|
||
search_fields = ["title", "owner__username"] | ||
list_filter = ["active"] | ||
|
||
|
||
@admin.register(Job) | ||
class JobAdmin(admin.ModelAdmin): | ||
"""JobAdmin.""" | ||
|
||
search_fields = ["author__username", "program__title"] | ||
list_filter = ["status"] | ||
exclude = ["arguments", "env_vars", "logs"] | ||
|
||
@admin.register(ComputeResource) | ||
class ComputeResourceAdmin(admin.ModelAdmin): | ||
"""ComputeResourceAdmin.""" | ||
|
||
@admin.register(RuntimeJob) | ||
class RuntimeJobAdmin(admin.ModelAdmin): | ||
"""RuntimeJobAdmin.""" | ||
|
||
search_fields = ["job__id"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 5.1 on 2024-08-21 18:24 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("api", "0029_program_additional_info_program_documentation_url_and_more"), | ||
("auth", "0012_alter_user_first_name_max_length"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="program", | ||
name="instances", | ||
field=models.ManyToManyField(blank=True, to="auth.group"), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters