updated CollectionsImport and CollectionUpsert forms

This commit is contained in:
Gani Georgiev
2022-08-06 18:15:18 +03:00
parent 4e58e7ad6a
commit 5fb45a1864
10 changed files with 224 additions and 93 deletions
+4 -1
View File
@@ -9,6 +9,9 @@ import (
"golang.org/x/crypto/bcrypt"
)
// DefaultIdLength is the default length of the generated model id.
const DefaultIdLength = 15
// ColumnValueMapper defines an interface for custom db model data serialization.
type ColumnValueMapper interface {
// ColumnValueMap returns the data to be used when persisting the model.
@@ -96,7 +99,7 @@ func (m *BaseModel) GetUpdated() types.DateTime {
//
// The generated id is a cryptographically random 15 characters length string.
func (m *BaseModel) RefreshId() {
m.Id = security.RandomString(15)
m.Id = security.RandomString(DefaultIdLength)
}
// RefreshCreated updates the model's Created field with the current datetime.