erp5_catalog: Use getattr to get catalog attributes
One of the difference between SQL and ERP5 Catalog is how they handle their properties. For ERP5Catalog, we use property_sheets which generate setters and getters, for SQLCatalog, properties just act as attributes(as one can expect from a property set on a class). This creates a difference on how we use them, especially for list_type properties, which have accessors like get<PropertyName>List to get the list of objects. For SQLCatalog, there is no such thing. This creates problem whereever 'get<PropertyName>' or getProperty(<name>) was being used to get multiple property types. So, we changed this to rely on getattr for the Python Scripts in this commit. Note that, getattr isn't good if we care about performance, but given that its used only twice, this can be better than adding extra function overhead.
Showing
Please register or sign in to comment