deployments.py 581 Bytes
Newer Older
Lukas Burgey's avatar
Lukas Burgey committed
1
2
3

from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin

4
from feudal.backend.models.deployments import Deployment, VODeployment, ServiceDeployment
Lukas Burgey's avatar
Lukas Burgey committed
5
6
7
8
9
10
11
12
13
14
15


class VODeploymentAdmin(PolymorphicChildModelAdmin):
    show_in_index = True


class ServiceDeploymentAdmin(PolymorphicChildModelAdmin):
    show_in_index = True


class DeploymentAdmin(PolymorphicParentModelAdmin):
16
    base_model = Deployment  # Explicitly set here!
Lukas Burgey's avatar
Lukas Burgey committed
17
    show_in_index = True  # makes child model admin visible in main admin site
18
    child_models = (VODeployment, ServiceDeployment)