-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relationship between categories in fields and groups #71
Comments
@atiro Maybe I am not clearly understand your request, but I think your requirement can be expressed. Let's see this schema: fields:
- name: title
- name: description
- name: image
categories: [optional]
- name: link
- name: license
groups:
- fields: [title, description]
categories: [mandatory]
- fields: [link, license]
categories: [optional] There are in total 2 categories. One (optional) is bound to a field and a field group, the other (mandatory) is bound to a field group. I guess that is what you need.
|
Hi @pkiraly I think I follow that, but now I wonder if have got the whole use of categories wrong! I have been using it to group fields together with conceptual names, e.g.
which works with categories scoring at the field level, but do categories have to be one of the enum types such as OPTIONAL, MANDATORY ? (which then works as I would like and as you illustrate in the second table) or can they be configured by the schema ? |
I think @mielvds but happy to be proved wrong, that that's only for categories at the field level (as they are now handled as Strings rather than Category as per #59). But FieldGroup is still using the Category class so restricted to the enum. Will experiment a bit to see if that can be changed to a String as well to handle any category name, although this may be against @pkiraly plans! |
OK have added PR #73 which I think enables this, but it's very much hacked in! I'm not sure what happens if you set the same category name at both the field level or the fieldgroup level, I suspect it's going to clash. |
I was looking to implement the support for the yaml config loading up fields groups but I've got a bit confused between categories in field groups and categories in fields. I don't think they have any connection, if I'm reading the code right ?
That works for me in one way as I would like to be able to say "if any field in this group exists, the category completeness is 1" so I can handle that entirely with a category in a field group, but ideally I would have also liked to be able to say something like "treat just these 3 fields as a group" within a set of 10 fields which would need to be a combination of both, I don't think that's possible though?
The text was updated successfully, but these errors were encountered: