-
Notifications
You must be signed in to change notification settings - Fork 11
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
project: add collection
resource
#566
Conversation
* Creates a new `collections` resource. * Enables files management for this new resource. Co-Authored-by: Sébastien Délèze <[email protected]>
* Links collections to documents. * Creates a collection and links it to document when a deposit is validated. * Creates a collection when a collection is found in RERO DOC publication. Co-Authored-by: Sébastien Délèze <[email protected]>
@classmethod | ||
def create(cls, data, id_=None, dbcommit=False, with_bucket=True, | ||
**kwargs): | ||
"""Create record. | ||
|
||
:param dict data: Metadata of the new record | ||
:param str id_: UUID to use if not generated | ||
:param bool dbcommit: Wether to commit into DB during creation | ||
:param bool with_bucket: Wether to create a bucket for record | ||
:return: New record instance | ||
:rtype: Record | ||
""" | ||
return super().create(data, | ||
id_=id_, | ||
dbcommit=dbcommit, | ||
with_bucket=with_bucket, | ||
**kwargs) |
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.
is this necessary if your create
method did nothing more than class parent ?
Into RERO-ILS project, we skip this declaration into children classes if there are no specific process.
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.
Yes it's mandatory because I need to set the default value for with_bucket
to True
.
schema = f'{RESOURCE_NAME}/{JSON_SCHEMA_NAME}-v1.0.0.json' | ||
pid_type = PID_TYPE | ||
resolver_url = f'/api/{RESOURCE_NAME}/<pid>' | ||
rest_endpoint = { |
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.
I don't like PEP-8 80 characters line limit. Not easy to read :-)
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.
Completely agree with you, we should increase this limit.
* Adds a view to list the collections for an organisation. * Adds a block containing the collection information in the search view in the collection context. * Filters records corresponding to the collection in the collection context. * Hides collection aggregation in the collection context. Co-Authored-by: Sébastien Délèze <[email protected]>
Co-Authored-by: Sébastien Délèze [email protected]