From d5638b6ffd1d397e26027431abdba08af36ce602 Mon Sep 17 00:00:00 2001
From: Flavio Tarsetti <flavio.tarsetti@idiap.ch>
Date: Fri, 10 Mar 2017 14:03:16 +0100
Subject: [PATCH] [plotters] sample data in admin

---
 beat/web/plotters/admin.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/beat/web/plotters/admin.py b/beat/web/plotters/admin.py
index 8673113a5..8ec74eab6 100644
--- a/beat/web/plotters/admin.py
+++ b/beat/web/plotters/admin.py
@@ -90,6 +90,11 @@ class PlotterModelForm(forms.ModelForm):
             required=False,
             )
 
+    sample_data = CodeMirrorJSONCharField(
+            readonly=True,
+            required=False,
+            )
+
     class Meta:
         model = Plotter
         exclude = []
@@ -137,7 +142,7 @@ class PlotterModelForm(forms.ModelForm):
 
 class PlotterAdmin(admin.ModelAdmin):
 
-    list_display        = ('id', 'author', 'name', 'version', 'language', 'dataformat', 'short_description', 'sample_data')
+    list_display        = ('id', 'author', 'name', 'version', 'language', 'dataformat', 'short_description')
     search_fields       = [
                             'name',
                             'dataformat__name',
@@ -153,7 +158,8 @@ class PlotterAdmin(admin.ModelAdmin):
     list_display_links  = ('id', 'name')
 
     list_filter         = ('author',)
-    readonly_fields    = ('hash', 'short_description', 'dataformat', 'referenced_libraries')
+    readonly_fields    = ('hash', 'short_description', 'dataformat',
+        'referenced_libraries')
 
     actions = [
         rehash_plotter,
@@ -194,7 +200,8 @@ class PlotterAdmin(admin.ModelAdmin):
         ('Cached Information (read-only)',
           dict(
             classes=('collapse',),
-            fields=('dataformat', 'parameters', 'referenced_libraries'),
+            fields=('dataformat', 'parameters', 'referenced_libraries',
+              'sample_data'),
             ),
           ),
         ('Definition',
-- 
GitLab