diff pkg/imports/sec.go @ 4798:ca6a5f722471

Added Description method to most imports. Only for imports where information relevant to the administrator is relevant.
author Sascha Wilde <wilde@intevation.de>
date Fri, 25 Oct 2019 18:25:38 +0200
parents 2336f75637d1
children f32d086b5dbf
line wrap: on
line diff
--- a/pkg/imports/sec.go	Fri Oct 25 17:48:33 2019 +0200
+++ b/pkg/imports/sec.go	Fri Oct 25 18:25:38 2019 +0200
@@ -16,6 +16,7 @@
 import (
 	"context"
 	"database/sql"
+	"strings"
 	"time"
 
 	"gemma.intevation.de/gemma/pkg/models"
@@ -33,6 +34,17 @@
 	Date      models.Date `json:"date-info"`
 }
 
+func (sec *Section) Description() (string, error) {
+
+	var descs []string
+
+	descs = append(descs, sec.Name)
+	descs = append(descs, sec.ObjNam)
+	descs = append(descs, sec.From.String())
+	descs = append(descs, sec.To.String())
+	return strings.Join(descs, "|"), nil
+}
+
 // SECJobKind is the import queue type identifier.
 const SECJobKind JobKind = "sec"