Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TAlone
memopol
Commits
bf3d5b31
Commit
bf3d5b31
authored
Jun 29, 2016
by
Nicolas Joyard
Browse files
Add settings app with Setting model
parent
a36fe829
Changes
6
Hide whitespace changes
Inline
Side-by-side
memopol/settings.py
View file @
bf3d5b31
...
...
@@ -90,6 +90,7 @@ INSTALLED_APPS = (
# ---
'core'
,
'memopol'
,
'memopol_settings'
,
'representatives'
,
'representatives_votes'
,
'representatives_recommendations'
,
...
...
memopol_settings/__init__.py
0 → 100644
View file @
bf3d5b31
memopol_settings/admin.py
0 → 100644
View file @
bf3d5b31
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
)
memopol_settings/migrations/0001_initial.py
0 → 100644
View file @
bf3d5b31
# -*- 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
()),
],
),
]
memopol_settings/migrations/__init__.py
0 → 100644
View file @
bf3d5b31
memopol_settings/models.py
0 → 100644
View file @
bf3d5b31
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
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment