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
Use fields mask #451
Use fields mask #451
Conversation
VisibleDatasetFactory, DatasetDiscussionFactory, LicenseFactory | ||
) | ||
from udata.core.reuse.factories import VisibleReuseFactory | ||
from udata.core.dataset.factories import VisibleDatasetFactory, LicenseFactory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bewarn that it may conflict with #444
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already rebased and fixed in last commit ;)
@@ -92,7 +92,11 @@ import DatasetFilters from 'components/dataset/filters'; | |||
import placeholders from 'helpers/placeholders'; | |||
import config from 'config'; | |||
|
|||
const MASK = 'id,title,description,spatial{zones,granularity},metrics,organization,frequency,temporal_coverage'; | |||
const MASK = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed – and this is subjective – I know that mask
actually refers to X-Fields
in the API meta. I would therefore have called it XFIELDS or FIELDS to make it more uniform.
An extra opinion would be welcome.
Massively impressive PR. 😮 |
@@ -64,7 +64,18 @@ import placeholders from 'helpers/placeholders'; | |||
import moment from 'moment'; | |||
import config from 'config'; | |||
|
|||
const MASK = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistency? ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Different day, different mood, different solution :)
Which one do you prefer: single line or joined array ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arrays, joined when necessary, not during the definition otherwise we'll have to split if again if we need to merge/modify it later.
r+wc |
This PR make use of fields Mask and GenericModelFields.
Extracted from #380 (so requires #380 )