Commit bf3d5b31 authored by Nicolas Joyard's avatar Nicolas Joyard

Add settings app with Setting model

parent a36fe829
......@@ -90,6 +90,7 @@ INSTALLED_APPS = (
# ---
'core',
'memopol',
'memopol_settings',
'representatives',
'representatives_votes',
'representatives_recommendations',
......
from django.contrib import admin
from .models import Setting
class SettingAdmin(admin.ModelAdmin):
list_display = ('key', 'value', 'comment')
list_editable = ('key', 'value', 'comment')
list_filter = ('key',)
admin.site.register(Setting, SettingAdmin)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Setting',
fields=[
('key', models.CharField(max_length=255, serialize=False, primary_key=True)),
('value', models.CharField(max_length=255)),
('comment', models.TextField()),
],
),
]
from django.db import models
class Setting(models.Model):
key = models.CharField(max_length=255, primary_key=True)
value = models.CharField(max_length=255)
comment = models.TextField()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment