Remove bundled dbsettings, add to requirements
This commit is contained in:
parent
169199e765
commit
c4154e6a02
9 changed files with 3 additions and 62 deletions
|
@ -1 +0,0 @@
|
||||||
default_app_config = 'dbsettings.apps.SettingsConfig'
|
|
|
@ -1,6 +0,0 @@
|
||||||
from django.contrib import admin
|
|
||||||
from dbsettings.models import Setting
|
|
||||||
|
|
||||||
# Register your models here.
|
|
||||||
|
|
||||||
admin.site.register(Setting)
|
|
|
@ -1,6 +0,0 @@
|
||||||
from django.apps import AppConfig
|
|
||||||
|
|
||||||
|
|
||||||
class SettingsConfig(AppConfig):
|
|
||||||
name = 'dbsettings'
|
|
||||||
verbose_name = "Application Settings"
|
|
|
@ -1,21 +0,0 @@
|
||||||
# Generated by Django 2.2.6 on 2019-10-26 15:21
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
initial = True
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Setting',
|
|
||||||
fields=[
|
|
||||||
('key', models.CharField(max_length=512, primary_key=True, serialize=False)),
|
|
||||||
('value', models.CharField(max_length=512)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,10 +0,0 @@
|
||||||
from django.db import models
|
|
||||||
|
|
||||||
# Create your models here.
|
|
||||||
|
|
||||||
class Setting(models.Model):
|
|
||||||
key = models.CharField(primary_key=True, max_length=512)
|
|
||||||
value = models.CharField(max_length=512)
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.key
|
|
|
@ -1,3 +0,0 @@
|
||||||
from django.test import TestCase
|
|
||||||
|
|
||||||
# Create your tests here.
|
|
|
@ -1,14 +0,0 @@
|
||||||
from django.shortcuts import render
|
|
||||||
from dbsettings.models import Setting
|
|
||||||
|
|
||||||
def getValue(key):
|
|
||||||
try:
|
|
||||||
return Setting.objects.get(key=key).value
|
|
||||||
except:
|
|
||||||
raise KeyError("No such setting: %s" % key)
|
|
||||||
|
|
||||||
def setValue(key, value):
|
|
||||||
obj = Setting.objects.get_or_create(key=key)[0] # pylint: disable=E1101
|
|
||||||
obj.value = value
|
|
||||||
obj.save()
|
|
||||||
return True
|
|
|
@ -5,3 +5,5 @@ django
|
||||||
django-storages
|
django-storages
|
||||||
boto3
|
boto3
|
||||||
kumisms
|
kumisms
|
||||||
|
python-telegram-bot
|
||||||
|
git+https://kumig.it/kumisystems/django-dbsettings.git
|
Loading…
Reference in a new issue