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

library_borrow: Fix proposition for is_available searchers and getters in Book and Exemplary #23

Open
wants to merge 2 commits into
base: 5.0/step10_completed
Choose a base branch
from

Conversation

ThomasMossaz
Copy link

Fix proposition #CCOOG-1198

where=(checkout.return_date != Null) | (checkout.id == Null))
return [('id', 'in' if value else 'not in', query)]
Book = Pool().get('library.book')
books = Book.search([])
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you are right, there may be a problem in this because an existing returned checkout will always match.
However, a search like this, while working, is not scalable in the real world, because you end up loading your whole database in a Python process.

@ThomasMossaz
Copy link
Author

Thanks a lot @JCavallo for your last comment ! So here is a new solution proposal for the 'searcher' and 'getter' taking in account your point.
Let me know what you think about it ! :)

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.

2 participants