Commit 2eea7606 by Clinton Blackburn Committed by Clinton Blackburn

Exposed ExperimentKeyValue model in Django admin

The model data can now be viewed/managed via Django admin. Additionally, the verbose name of the model has been corrected.
parent eadc0995
from django.contrib import admin
from .models import ExperimentData
from .models import ExperimentData, ExperimentKeyValue
@admin.register(ExperimentData)
......@@ -11,3 +11,12 @@ class ExperimentDataAdmin(admin.ModelAdmin):
raw_id_fields = ('user',)
readonly_fields = ('created', 'modified',)
search_fields = ('experiment_id', 'user', 'key',)
@admin.register(ExperimentKeyValue)
class ExperimentKeyValueAdmin(admin.ModelAdmin):
list_display = ('experiment_id', 'key',)
list_filter = ('experiment_id',)
ordering = ('experiment_id', 'key',)
readonly_fields = ('created', 'modified',)
search_fields = ('experiment_id', 'key',)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('experiments', '0002_auto_20170627_1402'),
]
operations = [
migrations.AlterModelOptions(
name='experimentkeyvalue',
options={'verbose_name': 'Experiment Key-Value Pair', 'verbose_name_plural': 'Experiment Key-Value Pairs'},
),
]
......@@ -30,8 +30,8 @@ class ExperimentKeyValue(TimeStampedModel):
value = models.TextField()
class Meta(object):
verbose_name = 'Experiment Data'
verbose_name_plural = 'Experiment Data'
verbose_name = 'Experiment Key-Value Pair'
verbose_name_plural = 'Experiment Key-Value Pairs'
unique_together = (
('experiment_id', 'key'),
)
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