constructors.go 446 B

1234567891011121314
  1. package form
  2. /* Generate new CharField field with type text */
  3. func NewCharField(Name string, Value *string, Validators *ValidatorsList) FormField {
  4. if Value == nil {
  5. return FormField{Name, "", nil, Validators}
  6. }
  7. return FormField{Name, *Value, nil, Validators}
  8. }
  9. /* Generate new CharField field with type password */
  10. func NewPasswordField(Name string, Validators *ValidatorsList) FormField {
  11. return FormField{Name, "", nil, Validators}
  12. }