erp5_catalog: Refactor _catalogObject List to remove the need to copy and patch
Create FilterDict and Filter class which would be used to imitate the behaviour of filter_dict for Catalog. /suggested by @jm
-
To squash in the commit wich did the code duplication to begin with.
Also, I'm not sure about the changes in ZSQLCatalog: this kind of make it depend on the product only being used in ERP5, which I think we avoided so far, and is the reason we have it separate from ERP5Catalog (the product) at all. If we decide we do not care about non-ERP5 uses, then more could be factorised. I do not know if we can decide not to care. @jm: ideas ?
-
Maintainer
Squashing this in the commit where code duplication began with will end up adding all changes regarding
FilterDict
to the commit where we create ERP5Catalog hence making one commit where we will have multiple changes like ERP5ifying catalog, change tests accordingly, change Business Template accordingly. I wanted to keep the changes made regardingFilterDict
as it is more independent and some changes made due to FilterDict don't concern ERP5Catalog. -
If one does not work without the other, I believe they belong to the same commit.
Or, if it is possible to do all FilterDict changes before ERP5-ing catalog, that is fine for me too: then you can put all edits needed for that change in a commit before the catalog ERP5-ification one.
Keeping commits small is good. But commits must be small because code changes needed to achive each desired feature change are small. When many changes are too interconnected, the a large commit makes more sense.
Also, I think
_catalogObjectList
removal does not belong to filter evolution, so anyway this commit needs a bit of rework.