Discussion:
[Erp5-dev] resolveCategory and category 'format'
Mikolaj Antoszkiewicz
2008-06-02 14:34:35 UTC
Permalink
Hi All,

I noticed that portal_categories when asked to resolve 'format' category
throws an Exception when that category is not present.
I also found that:
portal.restrictedTraverse*('portal_categories/format') = 'text/html'
I guess that's acquisition working.

Of course, when such category exists everything is all right.

That would probably require a patch on CategoryTool, but I cannot supply
one right now. If anybody has any idea how to nicely 'resolve' that I'd
be happy to hear.

Mikolaj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3229 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20080602/61831ee9/attachment.bin>
Yoshinori Okuji
2008-06-06 12:22:10 UTC
Permalink
Post by Mikolaj Antoszkiewicz
Hi All,
I noticed that portal_categories when asked to resolve 'format' category
throws an Exception when that category is not present.
portal.restrictedTraverse*('portal_categories/format') = 'text/html'
I guess that's acquisition working.
Of course, when such category exists everything is all right.
That would probably require a patch on CategoryTool, but I cannot supply
one right now. If anybody has any idea how to nicely 'resolve' that I'd
be happy to hear.
When a category is not present, how do you want to resolve it?

YO
--
Yoshinori Okuji, Nexedi CTO
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org
bartek
2008-06-06 12:31:57 UTC
Permalink
Post by Yoshinori Okuji
Post by Mikolaj Antoszkiewicz
Hi All,
I noticed that portal_categories when asked to resolve 'format' category
throws an Exception when that category is not present.
portal.restrictedTraverse*('portal_categories/format') = 'text/html'
I guess that's acquisition working.
Of course, when such category exists everything is all right.
That would probably require a patch on CategoryTool, but I cannot supply
one right now. If anybody has any idea how to nicely 'resolve' that I'd
be happy to hear.
When a category is not present, how do you want to resolve it?
If I get it right, the issue is not that the non-existent category can
not be resolved - this is quite all right. The issue is the
restrictedTraverse returns a string when it should raise an exception.

Bartek
Post by Yoshinori Okuji
YO
--
"feelings affect productivity. (...) unhappy people write worse
software, and less of it."
Karl Fogel, "Producing Open Source Software"
Mikolaj Antoszkiewicz
2008-06-06 12:35:06 UTC
Permalink
Post by Yoshinori Okuji
Post by Mikolaj Antoszkiewicz
Hi All,
I noticed that portal_categories when asked to resolve 'format' category
throws an Exception when that category is not present.
portal.restrictedTraverse*('portal_categories/format') = 'text/html'
I guess that's acquisition working.
Of course, when such category exists everything is all right.
That would probably require a patch on CategoryTool, but I cannot supply
one right now. If anybody has any idea how to nicely 'resolve' that I'd
be happy to hear.
When a category is not present, how do you want to resolve it?
Let me put it this way, for many other categories (I haven't checked
all), when they're not present portal_catalog returns None. For the
'format' category it throws an Exception.

I thought that strange and seemed to find out why, that's why I posted.

Mikolaj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3229 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20080606/5051ae62/attachment.bin>
Yoshinori Okuji
2008-06-06 12:51:33 UTC
Permalink
Post by Mikolaj Antoszkiewicz
Post by Yoshinori Okuji
Post by Mikolaj Antoszkiewicz
Hi All,
I noticed that portal_categories when asked to resolve 'format' category
throws an Exception when that category is not present.
portal.restrictedTraverse*('portal_categories/format') = 'text/html'
I guess that's acquisition working.
Of course, when such category exists everything is all right.
That would probably require a patch on CategoryTool, but I cannot supply
one right now. If anybody has any idea how to nicely 'resolve' that I'd
be happy to hear.
When a category is not present, how do you want to resolve it?
Let me put it this way, for many other categories (I haven't checked
all), when they're not present portal_catalog returns None. For the
'format' category it throws an Exception.
I thought that strange and seemed to find out why, that's why I posted.
I think this is normal, because "format" is a property defined DublinCore.
Where is "format" defined as a base category?

YO
--
Yoshinori Okuji, Nexedi CTO
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org
Loading...