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:
|
||||
return false
|
||||
case f.Optional,
|
||||
f.Default:
|
||||
f.Default,
|
||||
f.Nillable:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
|
@ -79,9 +80,3 @@ func upperFirst(s string) string {
|
|||
out[0] = unicode.ToUpper(out[0])
|
||||
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 {
|
||||
// TODO cardinality?
|
||||
// TODO optional fields?
|
||||
// TODO password?
|
||||
switch f.Info.Type {
|
||||
case field.TypeString:
|
||||
inputType := "text"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue