Skip to content
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

Circulation: invenio-circulation integration #146

Merged
merged 1 commit into from
Dec 11, 2018

Conversation

BadrAly
Copy link

@BadrAly BadrAly commented Nov 19, 2018

NEW: circulation apis refactoring

Co-Authored-by: Aly Badr [email protected]
Co-Authored-by: Gianni Pante [email protected]

To Test:

  • get the PR branch
  • ./scripts/bootstrap
  • ./scripts/setup
  • ./run_tests.sh

application_test:
Go through all the functionalities you can on the localhost:5000 except the circulation_ui.

@BadrAly BadrAly force-pushed the baa-#-711-ils-refactoring branch 8 times, most recently from 591831f to c0def98 Compare November 20, 2018 10:11
@BadrAly BadrAly force-pushed the baa-#-711-ils-refactoring branch 9 times, most recently from e7ba5ba to 43a5150 Compare November 27, 2018 12:06
@BadrAly BadrAly force-pushed the baa-#-711-ils-refactoring branch 7 times, most recently from 3ae52bc to a80b55e Compare December 4, 2018 16:07
@BadrAly BadrAly changed the title Circualtion: invenio-circulation integration Circulation: invenio-circulation integration Dec 5, 2018
@BadrAly BadrAly force-pushed the baa-#-711-ils-refactoring branch 7 times, most recently from 6d2e591 to 21b6bbf Compare December 10, 2018 06:51
'term',
**{"patron_type_pid": self.pid}
).source().scan()))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be rewritten as:

return PatronsSearch().filter('term', **{'patron_type_pid': self.pid}).count() == 0

'term',
**{"organisation_pid": organisation_pid}
).source().scan()
patron_type = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be rewritten as:

return next(PatronTypeSearch()
            .filter('term', **{'patron_type_name': name})
            .filter('term', **{'organisation_pid': organisation_pid}).scan())

@@ -65,6 +65,16 @@ def i18n_to_str(language):
def resolve_function(function_name):
"""Execute resolve function."""
result = []
if function_name == 'libraries_pids_names':
from rero_ils.modules.libraries_locations.api import Library
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import at the top

@@ -65,6 +65,16 @@ def i18n_to_str(language):
def resolve_function(function_name):
"""Execute resolve function."""
result = []
if function_name == 'libraries_pids_names':
from rero_ils.modules.libraries_locations.api import Library
for id in Library.get_all_ids():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use _id instead of id as it is a reserved word in python

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not library_id

@@ -65,6 +65,16 @@ def i18n_to_str(language):
def resolve_function(function_name):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad name

rerowep
rerowep previously approved these changes Dec 10, 2018
@rerowep rerowep dismissed their stale review December 10, 2018 15:49

a lot of changes

@rerowep rerowep self-requested a review December 10, 2018 15:50
NEW: circulation apis refactoring

Co-Authored-by: Aly Badr [email protected]
Co-Authored-by: Gianni Pante [email protected]
@BadrAly BadrAly force-pushed the baa-#-711-ils-refactoring branch from 21b6bbf to 1732ff1 Compare December 11, 2018 09:16
@jma jma merged commit d8a2107 into rero:master Dec 11, 2018
@BadrAly BadrAly deleted the baa-#-711-ils-refactoring branch January 10, 2019 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants