grano
grano copied to clipboard
Attribute validation
Something along these lines:
- name: organizacion
label: Una organizacion
obj: entity
hidden: no
attributes:
- name: nombre
label: Nombre
required: true
- name: date
label: Date
pattern: \d\d\d\d-\d\d-\d\d
So the new aspect in this is required and pattern? What do you think the pros and cons of regexes vs. pre-defined types (URL, Email, ...) are?
Pros of regexes: I can validate whatever I need — Cons: having to look up a working email address-matching regex every time I do it :)
Cons of pre-defined types: How do I add a type? Why not just use regexes?