Re: [Zope3-Users] Direct ZODB access in a Zope3 instance

2005-12-01 Thread Johan Carlsson
Brad Allen wrote: At 11:48 AM +0100 12/1/05, Johan Carlsson wrote: To access an object in the ZODB you need to have a context (that is a pointer to a object stored in ZODB, it almost alway is but in some situations it's not! I've learned that the hard way). If your in a browser class you

Re: [Zope3-Users] Direct ZODB access in a Zope3 instance

2005-12-01 Thread Johan Carlsson
Brad Allen wrote: At 11:48 AM +0100 12/1/05, Johan Carlsson wrote: The ZAPI interface gives you several ways to traverse object from a context: For instance getParent, (getParents,) getRoot, traverse, (traverseName) On my first reading of your posting, I missed getRoot. That sounds

Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?

2005-11-21 Thread Johan Carlsson
Dominik Huber wrote: Johan Carlsson wrote: Right after that I do this: catalog = Catalog() for index_name, index_attribute, idx_if, attr_call, index_type in indexes: idx = index_type(index_attribute, idx_if, attr_call) catalog[index_name

Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?

2005-11-18 Thread Johan Carlsson
, catalog) rm.addRegistration(catalog_reg) catalog_reg.status = ActiveStatus This is all called from an event handler, like Dominik pointed out I should do it. -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72

Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?

2005-11-18 Thread Johan Carlsson
Johan Carlsson wrote: Hi again, The ComponentLookupError have re appeared! Error type: zope.component.interfaces.ComponentLookupError Error object: (InterfaceClass zope.app.intid.interfaces.IIntIds, '') What happend was that I had a IntId utitlity in the root site (renamed

Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?

2005-11-18 Thread Johan Carlsson
Johan Carlsson wrote: Dominik Huber wrote: Johan Carlsson wrote: I've tried this, it doesn't remove the NotYet problem though!?? Our framework relies on that concept and it is still working ;) Did you assert to add the catalog to the sitemanagement folder before adding its indexes? I

[Zope3-Users] Anyone had any success with ZCatalog in Zope 3?

2005-11-17 Thread Johan Carlsson
utility, what I've done so far is just add one and give it an random name. Regards, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM

Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?

2005-11-17 Thread Johan Carlsson
Johan Carlsson wrote: Anyone had any success with ZCatalog in Zope 3? I'm trying to add indexes to the catalog but I get an ComponentLookupError: Error type: zope.component.interfaces.ComponentLookupError Error object: (InterfaceClass zope.app.intid.interfaces.IIntIds, '') I'm not sure how

Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?

2005-11-17 Thread Johan Carlsson
Ivo van der Wijk wrote: On 11/17/05, Johan Carlsson [EMAIL PROTECTED] wrote: Anyone had any success with ZCatalog in Zope 3? I'm trying to add indexes to the catalog but I get an ComponentLookupError: Error type: zope.component.interfaces.ComponentLookupError Error object: (InterfaceClass

Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?

2005-11-17 Thread Johan Carlsson
And thanks both of you for really fast replies :-) Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list

Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?

2005-11-17 Thread Johan Carlsson
the code that does this because the traceback is Zope 3 cryptic and I don't have a debugger setup either. (I was hoping not having to care about the innerworks of the catalog, but that maybe is too much too hope for ;-) Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty

Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?

2005-11-17 Thread Johan Carlsson
, 'XY', ICatalog, catalog) catalog[name] = Index(name, IAnyInterface) Ok, that's by the way how Ivo does it (I've just read). Thanks, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37

Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?

2005-11-17 Thread Johan Carlsson
, 'XY', ICatalog, catalog) catalog[name] = Index(name, IAnyInterface) I've tried this, it doesn't remove the NotYet problem though!?? Regards, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED

Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?

2005-11-17 Thread Johan Carlsson
Dominik Huber wrote: Johan Carlsson wrote: I've tried this, it doesn't remove the NotYet problem though!?? Our framework relies on that concept and it is still working ;) Did you assert to add the catalog to the sitemanagement folder before adding its indexes? I found the error

[Fwd: Re: [Zope3-Users] Getting the content object from a widget]

2005-11-14 Thread Johan Carlsson
Original Message Subject: Re: [Zope3-Users] Getting the content object from a widget Date: Mon, 14 Nov 2005 14:14:02 +0100 From: Johan Carlsson [EMAIL PROTECTED] To: Johan Carlsson [EMAIL PROTECTED] References: [EMAIL PROTECTED] Johan Carlsson wrote: Well, I extended

[Zope3-Users] Getting the content object from a widget

2005-11-14 Thread Johan Carlsson
know). Fields normaly lack the Location interfaces so one needs to figure out the location manually. Also fields need special traversers to be traversable from the web, it's a consequence of the explicit nature of Z3 I guess.) -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty

Re: [Zope3-Users] View with template

2005-10-28 Thread Johan Carlsson
index (e.g. the template). Now if you override the __call__ in your view class this behavior is replace (because the view class comes before the simple class) so you must implement the behaviour your self (e.g. your call needs to call index). Regards, Johan -- Johan Carlsson Tel: + 46 8

[Zope3-Users] Traversing a Tuple Field

2005-10-26 Thread Johan Carlsson
to the Traverser? Any advice on this problem? (I just realized that using a volatile attribute on the context might work, but it just feels to darn un-zope3-ish) -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE

Re: [Zope3-Users] Traversing a Tuple Field

2005-10-26 Thread Johan Carlsson
Johan Carlsson wrote: Hi all, I have a schema that defines a tuple field that holds object field of a specific type. Now I want to be able to traverse each object in the tuple by using ./field_name/index. From the Zope3 book I've learn how to create a Traverser (by subclassing

Re: [Zope3-Users] Fields for file and images

2005-10-25 Thread Johan Carlsson
changes fw = CustomWidgetFactory(FileWidget, File ) -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3

Re: [Zope3-Users] Fields for file and images

2005-10-25 Thread Johan Carlsson
Johan Carlsson wrote: James Allwyn wrote: I too have been getting UnpickleableError while playing with ObjectWidgets. But I'm now suspecting the real problem is due to a misconfiguration in ZCML. I'll let you know what I find out. Didn't find anything ZCML related, my hunch was wrong

[Zope3-Users] Fields for file and images

2005-10-20 Thread Johan Carlsson
class=.browser.PollEditView label=Change a Poll name=edit.html menu=zmi_views title=Edit permission=zope.ManageContent / /configure -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED

Re: [Zope3-Users] Fields for file and images

2005-10-20 Thread Johan Carlsson
Johan Carlsson wrote: Hi all, I'm trying to figure out the easiest way to get fields holding Files or Images in my content type class. I've tried the following: I've tried using the Object field specifying the zope.app.file.interfaces.IFile as the schema and then implement

Re: [Zope3-Users] Fields for file and images

2005-10-20 Thread Johan Carlsson
Johan Carlsson wrote: For anyone that might be interested in the update to my code (still only parsely working): Here is my code (which uses the Poll as base, that stuff has been removed though): interfaces.py: from zope.interface import Interface from zope.schema import Object from

[Zope3-Users] Zope3 equivalent to Zope 2 filestream_iterator?

2005-10-12 Thread Johan Carlsson
Hi all, Is there a Zope3 equivalent to the Zope 2 filestream_iterator? A quick search in the source turned up nil! Regards, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM

Re: [Zope3-Users] Zope3 equivalent to Zope 2 filestream_iterator?

2005-10-12 Thread Johan Carlsson
Stephan Richter wrote: On Wednesday 12 October 2005 09:38, Johan Carlsson wrote: Is there a Zope3 equivalent to the Zope 2 filestream_iterator? A quick search in the source turned up nil! Well, for 3.2 we changed the publisher interface. You can now return IResult objects. The output

Re: [Zope3-Users] Zope3 equivalent to Zope 2 filestream_iterator?

2005-10-12 Thread Johan Carlsson
Stephan Richter wrote: On Wednesday 12 October 2005 10:02, Johan Carlsson wrote: How far has the development of 3.2 come? That question does not make much sense, We are switching to timely releases with 3.2. You can see the implemented features in CHANGES.txt. I don't entirely understand

[Zope3-Users] Override a browser class

2005-10-03 Thread Johan Carlsson
override returns False if the paste action is unknown. Any core developer that has any opinion on this? Can it be changed in the core or is there a specific reason for the raise? Regards, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24

Re: [Zope3-Users] Making site skins

2005-08-17 Thread Johan Carlsson
= traverser.traverse(name, ()) return resource() Cheers, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3

Re: [Zope3-Users] Making site skins

2005-08-17 Thread Johan Carlsson
Roger Ineichen wrote: Take a look at: src\zope\app\demo\skinpref It's a demo how you can use preferences for to switch the skin. Probably you can use some parts from there. Regards Roger Ineichen Thanks Roger, Sound like something right up my alley :-) /Johan -- Johan Carlsson Tel

Re: [Zope3-Users] Making site skins

2005-08-16 Thread Johan Carlsson
? Regards, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org

[Zope3-Users] Importing resource directory hierarchy

2005-07-19 Thread Johan Carlsson
Hi all, Is the anyway to importing a hierarchy of folders as a resource, with the folder hierarchy intact. For instance the file tiny_mce/themes/advanced/editor_template.js should be accessed as @@/tiny_mce/themes/advanced/editor_template.js Regards, Johan -- Johan Carlsson Tel: + 46

[Zope3-Users] How do I get the Interfaces in right order?

2005-07-18 Thread Johan Carlsson
to be implemented everywhere? For instance not all ZCML directives that implement the menu (MenuField) implemets the order field? Regards, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37

Re: [Zope3-Users] browser:form

2005-07-18 Thread Johan Carlsson
browser:page built from .pt file? Thanks for any help, John Hi John, For the auto generate form from a schema I think: http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3Book/schema.html is the pointer you need? Regards, Johan -- Johan Carlsson Tel: + 46 8 31 24 94

Re: [Zope3-Users] Ordered list of sub objects

2005-07-16 Thread Johan Carlsson
, bottom) - User views all of the content items. - User changes some or all content items and saves changes. - Plus the use cases for IFolder From that I realized that the items are unnamed, I other words need to get a name assigned to it when added. Regards, Johan -- Johan Carlsson Tel