-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kees Hink wrote: > > On 09/09/2010 01:14 PM, Wichert Akkerman wrote: >> On 9/9/10 13:03 , Kees Hink wrote: >>> I'm subclassing an AT content type, minus one field which i remove in this >>> way: >>> >>> MyClass(ParentClass): >>> (...) >>> my_schema = parent_schema.copy() >>> my_schema.delField('unusedField') >>> (...) >>> >>> This works. However, the catalog tries to index this field [1]: >>> >>> <index name="getUnusedField" >>> meta_type="FieldIndex"> >>> <indexed_attr value="getUnusedField"/> >>> </index> >>> >>> Calling the "getUnusedField" on ParentClass works. It also works on all >>> other >>> classes. Only MyClass still has a generated accessor for the removed field, >>> calls it, and can't find the attribute. For more details on the setup, see >>> below. [2] >> Isn't that expected behaviour? AT adds the accessor to your base class, >> which makes it accessible from your class as well. That is how class >> inheritance work. >> >> Wichert. > > I guess so, I was probably being too simplistic in assuming that delField() > would also remove the accessor.
Deleting from a Schema instance is something completely different than getting rid of an inherited method (which is only possible with trickery in Python). - -aj -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQGUBAEBAgAGBQJMiOooAAoJEADcfz7u4AZjr9ALwKzy1uexQ8v9cGDinbugdt9C YfmJioCFOGR5HCydiC4QTMw2JIT41K9TP+ZLl0WrBdRl2gmMP6PIt+9hneHnW9Ni rKC7vlztSAj+KB4dL1GB+7uwREH4Z454IfUaspjpjmAQmPTTJPQaMsixyOoO26Jj lDh9hyNVAXbEDR/ngEdRGVQS6e7DYmis1fxZaTrF3iktXTbjQifNRFUf79cTkCFA mLLBlBcyhC2Kt/cjZpeuUBd7uY6bqPK2zrYvfI4DXLgvyUK9X+w+qWBV+c0Ec35S FH8orAk1CBH0P1XaHulhGHE/kz1WNkhFMu/s1T+pI3LTXs3m+R1qw85Hqn/FDwz5 V/o5y5A9sTvHA4gB8CF+7jUJdOot6+zAT7KJQrePSjO2HjBxDGXi+fcIJ/jbkdPM NdqR0bBpHocYa8abVY2jCYMxVc1N6c4VvB1w5+GNYLbMD9mi0XoQzivgWAUXIk9a 5EcUMjmcWavMzXfyPVWwCR3wVGQpmR4= =3YoJ -----END PGP SIGNATURE-----
<<attachment: lists.vcf>>
_______________________________________________ Product-Developers mailing list Product-Developers@lists.plone.org http://lists.plone.org/mailman/listinfo/product-developers