mirror of
https://github.com/ansible/awx.git
synced 2026-06-30 02:48:03 -02:30
Initial Database Configuration bootstrap
* Settings manifest, mapping internal settings to what can be used in the database along with type information etc. * Initial Database model * Helper object that overlays database settings on django settings
This commit is contained in:
42
awx/main/models/configuration.py
Normal file
42
awx/main/models/configuration.py
Normal file
@@ -0,0 +1,42 @@
|
||||
# Copyright (c) 2015 Ansible, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
# Python
|
||||
|
||||
# Django
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
|
||||
# Tower
|
||||
from awx.main.models.base import CreatedModifiedModel
|
||||
|
||||
class TowerSettings(CreatedModifiedModel):
|
||||
|
||||
SETTINGS_TYPE_CHOICES = [
|
||||
('string', "String"),
|
||||
('int', 'Integer'),
|
||||
('float', 'Decimal'),
|
||||
('json', 'JSON'),
|
||||
('password', 'Password'),
|
||||
('list', 'List')
|
||||
]
|
||||
|
||||
key = models.CharField(
|
||||
max_length=255,
|
||||
unique=True
|
||||
)
|
||||
description = models.TextField()
|
||||
category = models.CharField(max_length=128)
|
||||
value = models.TextField()
|
||||
value_type = models.CharField(
|
||||
max_length=12,
|
||||
choices=SETTINGS_TYPE_CHOICES
|
||||
)
|
||||
user = models.ForeignKey(
|
||||
'auth.User',
|
||||
related_name='settings',
|
||||
default=None,
|
||||
null=True,
|
||||
editable=False,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user