func NewNote(id string, model *Model) (*Note, error) {
	if model == nil {
		return nil, errors.New("model required")
	}
	n := &Note{
		ID:          id,
		ThemeID:     model.Theme.ID,
		ModelID:     model.ID,
		Created:     now().UTC(),
		Modified:    now().UTC(),
		FieldValues: make([]*FieldValue, len(model.Fields)),
		Attachments: NewFileCollection(),
		Model:       model,
	}
	if err := n.Validate(); err != nil {
		return nil, err
	}
	return n, nil
}
// NewNote creates a new, empty note with the provided ID and Model.
NewNote creates a new, empty note with the provided ID and Model.
// NewNote creates a new empty note with the provided ID and Model .
func NewNote(id string, model *Model) (*Note, error) {
	if model == nil {
		return nil, errors.New("model required")
	}
	n := &Note{
		ID:          id,
		ThemeID:     model.Theme.ID,
		ModelID:     model.ID,
		Created:     now().UTC(),
		Modified:    now().UTC(),
		FieldValues: make([]*FieldValue, len(model.Fields)),
		Attachments: NewFileCollection(),
		Model:       model,
	}
	if err := n.Validate(); err != nil {
		return nil, err
	}
	return n, nil
}
func NewNote ( id string , model * Model ) ( * Note , error ) { if model == nil { return nil , errors . New ( " " ) } n := & Note { ID : id , ThemeID : model . Theme . ID , ModelID : model . ID , Created : now ( ) . UTC ( ) , Modified : now ( ) . UTC ( ) , FieldValues : make ( [ ] * FieldValue , len ( model . Fields ) ) , Attachments : NewFileCollection ( ) , Model : model , } if err := n . Validate ( ) ; err != nil { return nil , err } return n , nil }
NewNote creates a new, empty note with the provided ID and Model.
NewNote creates a new empty note with the provided ID and Model .