Skip to content
Extraits de code Groupes Projets
Valider bf3d5b31 rédigé par Nicolas Joyard's avatar Nicolas Joyard
Parcourir les fichiers

Add settings app with Setting model

parent a36fe829
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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()
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter