Support nillable fields.
This commit is contained in:
parent
7ff1e3f9d2
commit
b8d8184bda
2 changed files with 2 additions and 9 deletions
|
|
@ -65,7 +65,8 @@ func fieldIsPointer(f *gen.Field) bool {
|
||||||
case f.Type.Type == field.TypeBool:
|
case f.Type.Type == field.TypeBool:
|
||||||
return false
|
return false
|
||||||
case f.Optional,
|
case f.Optional,
|
||||||
f.Default:
|
f.Default,
|
||||||
|
f.Nillable:
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
@ -79,9 +80,3 @@ func upperFirst(s string) string {
|
||||||
out[0] = unicode.ToUpper(out[0])
|
out[0] = unicode.ToUpper(out[0])
|
||||||
return string(out)
|
return string(out)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
TODO:
|
|
||||||
1) How to handle fields like password that need to be transformed or omitted, etc?
|
|
||||||
2) Should we use the HTML datetime format and string fields rather than time.Time?
|
|
||||||
*/
|
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,6 @@ func AdminEntityForm(ctx echo.Context, schema *load.Schema, values url.Values) e
|
||||||
|
|
||||||
for _, f := range schema.Fields {
|
for _, f := range schema.Fields {
|
||||||
// TODO cardinality?
|
// TODO cardinality?
|
||||||
// TODO optional fields?
|
|
||||||
// TODO password?
|
|
||||||
switch f.Info.Type {
|
switch f.Info.Type {
|
||||||
case field.TypeString:
|
case field.TypeString:
|
||||||
inputType := "text"
|
inputType := "text"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue