grano icon indicating copy to clipboard operation
grano copied to clipboard

Attribute validation

Open jazzido opened this issue 11 years ago • 2 comments

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

jazzido avatar Mar 10 '14 21:03 jazzido

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?

pudo avatar Mar 14 '14 12:03 pudo

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?

jazzido avatar Mar 14 '14 12:03 jazzido