Missing migration, add dbsetting template tag

This commit is contained in:
Kumi 2020-01-18 22:48:10 +01:00
parent 99f0ccaf72
commit 47c7a84781
3 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,23 @@
# Generated by Django 2.2.6 on 2020-01-17 15:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dbsettings', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='setting',
name='key',
field=models.CharField(max_length=255, primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='setting',
name='value',
field=models.CharField(max_length=255),
),
]

0
templatetags/__init__.py Normal file
View file

View file

@ -0,0 +1,8 @@
from django import template
from dbsettings.models import Setting
register = template.Library()
@register.simple_tag
def dbsetting(key):
return Setting.objects.get(key=key).value # pylint: disable=no-member