mirror of
https://github.com/ansible/awx.git
synced 2026-06-24 16:17:51 -02:30
Add a new ExecutionEnvironment model
This commit is contained in:
committed by
Shane McDonald
parent
0af7f046f0
commit
41613ff544
37
awx/main/models/execution_environments.py
Normal file
37
awx/main/models/execution_environments.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from awx.main.models.base import PrimordialModel
|
||||
|
||||
|
||||
__all__ = ['ExecutionEnvironment']
|
||||
|
||||
|
||||
class ExecutionEnvironment(PrimordialModel):
|
||||
class Meta:
|
||||
unique_together = ('organization', 'image')
|
||||
ordering = (models.F('organization_id').asc(nulls_first=True), 'image')
|
||||
|
||||
organization = models.ForeignKey(
|
||||
'Organization',
|
||||
null=True,
|
||||
default=None,
|
||||
blank=True,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
help_text=_('The organization used to determine access to this execution environment.'),
|
||||
)
|
||||
image = models.CharField(
|
||||
max_length=1024,
|
||||
verbose_name=_('image location'),
|
||||
help_text=_("The registry location where the container is stored."),
|
||||
)
|
||||
managed_by_tower = models.BooleanField(default=False, editable=False)
|
||||
credential = models.ForeignKey(
|
||||
'Credential',
|
||||
related_name='%(class)ss',
|
||||
blank=True,
|
||||
null=True,
|
||||
default=None,
|
||||
on_delete=models.SET_NULL,
|
||||
)
|
||||
Reference in New Issue
Block a user