From c4154e6a026e2320278514cbe405cee0d1831b97 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Sat, 6 Feb 2021 11:41:57 +0000 Subject: [PATCH] Remove bundled dbsettings, add to requirements --- dbsettings/__init__.py | 1 - dbsettings/admin.py | 6 ------ dbsettings/apps.py | 6 ------ dbsettings/migrations/0001_initial.py | 21 --------------------- dbsettings/migrations/__init__.py | 0 dbsettings/models.py | 10 ---------- dbsettings/tests.py | 3 --- dbsettings/views.py | 14 -------------- requirements.txt | 4 +++- 9 files changed, 3 insertions(+), 62 deletions(-) delete mode 100644 dbsettings/__init__.py delete mode 100644 dbsettings/admin.py delete mode 100644 dbsettings/apps.py delete mode 100644 dbsettings/migrations/0001_initial.py delete mode 100644 dbsettings/migrations/__init__.py delete mode 100644 dbsettings/models.py delete mode 100644 dbsettings/tests.py delete mode 100644 dbsettings/views.py diff --git a/dbsettings/__init__.py b/dbsettings/__init__.py deleted file mode 100644 index 8a9d1b7..0000000 --- a/dbsettings/__init__.py +++ /dev/null @@ -1 +0,0 @@ -default_app_config = 'dbsettings.apps.SettingsConfig' \ No newline at end of file diff --git a/dbsettings/admin.py b/dbsettings/admin.py deleted file mode 100644 index 4a7793a..0000000 --- a/dbsettings/admin.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.contrib import admin -from dbsettings.models import Setting - -# Register your models here. - -admin.site.register(Setting) \ No newline at end of file diff --git a/dbsettings/apps.py b/dbsettings/apps.py deleted file mode 100644 index 9f3e70f..0000000 --- a/dbsettings/apps.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.apps import AppConfig - - -class SettingsConfig(AppConfig): - name = 'dbsettings' - verbose_name = "Application Settings" \ No newline at end of file diff --git a/dbsettings/migrations/0001_initial.py b/dbsettings/migrations/0001_initial.py deleted file mode 100644 index 7db4b1e..0000000 --- a/dbsettings/migrations/0001_initial.py +++ /dev/null @@ -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)), - ], - ), - ] diff --git a/dbsettings/migrations/__init__.py b/dbsettings/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dbsettings/models.py b/dbsettings/models.py deleted file mode 100644 index 7fa8887..0000000 --- a/dbsettings/models.py +++ /dev/null @@ -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 \ No newline at end of file diff --git a/dbsettings/tests.py b/dbsettings/tests.py deleted file mode 100644 index 7ce503c..0000000 --- a/dbsettings/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/dbsettings/views.py b/dbsettings/views.py deleted file mode 100644 index 5c3bf28..0000000 --- a/dbsettings/views.py +++ /dev/null @@ -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 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index def624a..4ea4e86 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,6 @@ django-bulk-admin django django-storages boto3 -kumisms \ No newline at end of file +kumisms +python-telegram-bot +git+https://kumig.it/kumisystems/django-dbsettings.git \ No newline at end of file