[Zope3-Users] Interface tests: NotImplemented or NotImplementedError

2005-10-18 Thread Lorenzo Gil Sanchez
book. Or, Am I missing something? Regards Lorenzo Gil Sanchez ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users

[Zope3-Users] newbie problems with new content-type

2006-02-06 Thread Lorenzo Gil Sanchez
Hi, I'm trying to get my first content-type working and I have some problems. For the record, I'm following Stephan great book and I'm running Zope 3.2.0 on Windows. My content-type represents a Provider and is quite simple. The first problem I have is when I try to run the tests with the fo

Re: [Zope3-Users] newbie problems with new content-type

2006-02-06 Thread Lorenzo Gil Sanchez
Christoph Frick wrote: On Mon, Feb 06, 2006 at 06:48:30PM +0100, Lorenzo Gil Sanchez wrote: c:\path\to\my\instance\bin\test -vpu --dir z:\my_root_app_dir [ traceback ] ImportError: No module named z:.my_root_app_dir dunnonothing about windows - but either the test-environment can not handle

Re: [Zope3-Users] newbie problems with new content-type

2006-02-08 Thread Lorenzo Gil Sanchez
Chris Withers wrote: Lorenzo Gil Sanchez wrote: c:\path\to\my\instance\bin\test -vpu --dir z:\my_root_app_dir [ traceback ] ImportError: No module named z:.my_root_app_dir Is my_root_app_dir on your PYTHON_PATH? Yes it is also, do you have __init__.py files in \tests? Yes I do If you

Re: [Zope3-Users] newbie problems with new content-type

2006-02-09 Thread Lorenzo Gil Sanchez
[EMAIL PROTECTED] wrote: 'test' command searches only packages under "instance_lib". and "instance_lib" is 'c:\path\to\your\instance\lib\python' Ok, that's my problem. My package was outside the instance lib directory. I think I have read in the Zope Developers Book that you could put your

[Zope3-Users] default values in Choice fields

2006-02-09 Thread Lorenzo Gil Sanchez
Hi I have a field in my schema like this: fruit = Choice(title=u'Fruit', description=u'An example choice field', default=None, required=True, values=('Apple', 'Orange', 'Banana', 'Strawberry')) I want to specify a default value for thi

[Zope3-Users] updating objects in ZODB

2006-02-10 Thread Lorenzo Gil Sanchez
Hi, I have a question about updating the objects in a ZODB. Suppose I already have 100 objects of class A and then I modify class A adding a new attribute. Then I craete a new object of the class A and now I have two kind of instances of my class A, the old ones and the new one. How do I upd

Re: [Zope3-Users] updating objects in ZODB

2006-02-10 Thread Lorenzo Gil Sanchez
Thierry FLORAC wrote: On Fri, 2006-02-10 at 11:15 +0100, Lorenzo Gil Sanchez wrote: How do I update the old objects and add the new attribute to them? I can provide a default value for this attribute if that helps. I know this is a common issue with application updates. I also know that during

Re: [Zope3-Users] Trying to use browser:form -> 404

2006-02-10 Thread Lorenzo Gil Sanchez
El vie, 10-02-2006 a las 22:18 +0100, Florian Lindner escribió: > Am Freitag, 10. Februar 2006 20:10 schrieb Garanin Michael: > And I try to call it with: > > /++skin++centershock/cs/registerForm.html whereas cs is a ICentershock object. > > It still gives a 404. > > Any guess what's wrong? >

[Zope3-Users] breadcumbs in new skin

2006-02-13 Thread Lorenzo Gil Sanchez
Hi, I'm working on a new skin and I want to use the breadcumbs functionality in it. I have just one layer and the skin is defined like this: Inside my template.pt I have tried to use the macro breadcumbs without luck: This macro is defined in the template.pt file of the Rotterdam

[Zope3-Users] how to make static pages

2006-03-16 Thread Lorenzo Gil Sanchez
Hi, I'd like to ask what's the best way to create static html pages inside my application. For example, the intro page, a help page or a legal conditions page. I have a skin inside a browser package but if I understand them correctly the provide views for content objects. Do I need to create a co

Re: [Zope3-Users] Re: how to make static pages

2006-03-16 Thread Lorenzo Gil Sanchez
El vie, 17-03-2006 a las 06:11 +1100, Tom Dossis escribió: > Lorenzo Gil Sanchez wrote: > > Hi, > > > > I'd like to ask what's the best way to create static html pages inside > > my application. For example, the intro page, a help page or a legal > > con

[Zope3-Users] skin concepts

2006-03-16 Thread Lorenzo Gil Sanchez
Hi all, When trying to make my own skin I run into some problems. I have read Stephan chapter of his book about creating a skin and it is quite useful but still too simple for my needs. I want to understand some concepts involved in skin development and I haven't found any resource to read about

[Zope3-Users] problems with contains and containers

2006-03-21 Thread Lorenzo Gil Sanchez
Hi, I have a custom container and a custom content type and I want to make some simple restrictions: - Only objects that implement IMyContent can be added to objects that implement IMyContainer - Only objects that implement IMyContainer can contain objects that implement IMyContent Looks like t

Re: [Zope3-Users] problems with contains and containers

2006-03-21 Thread Lorenzo Gil Sanchez
): implements(IMyContent, IMyContentContained) class MyContainer(BTreeContainer): implements(IMyContainer) El mar, 21-03-2006 a las 19:10 +0100, Lorenzo Gil Sanchez escribió: > Hi, > > I have a custom container and a custom content type and I want to make > some simple restrictions: > &

Re: [Zope3-Users] problems with contains and containers

2006-03-23 Thread Lorenzo Gil Sanchez
Hi Katsutoshi, your explanations make things much clearer. Thanks a lot for sharing them with us! Lorenzo El jue, 23-03-2006 a las 17:30 +0900, [EMAIL PROTECTED] escribió: > Hi, Lorenzo. > > Today, I suffered the same problem as you met. > > This is what I figured out. > > > 'containers'

[Zope3-Users] maybe a bug in formlib?

2006-04-12 Thread Lorenzo Gil Sanchez
Hi list, I'm trying to use formlib and while looking at the source code of this package for a better understanding I realized that the form.Action class has two methods with the same name: 'submitted'. You can see it at: http://svn.zope.org/Zope3/trunk/src/zope/formlib/form.py?rev=66255&view=auto

[Zope3-Users] Generation's install script

2006-04-27 Thread Lorenzo Gil Sanchez
Hi list, I'm trying to use zope3 generations for the first time and I managed to get a schema manager working that support the IInstallableSchemaManager interface (it is just a subclass of SchemaManager). So I have an install.py module with an evolve function and it is getting called at zope star

Re: [Zope3-Users] Generation's install script

2006-04-30 Thread Lorenzo Gil Sanchez
is in the real root ZODB object. So this fixes my problem: root = context.connection.root() app = root['Application'] app['my_folder'] = Folder() transaction.commit() Hope it helps Lorenzo El jue, 27-04-2006 a las 09:09 +0200, Lorenzo Gil Sanchez escribió: > Hi list, >

Re: [Zope3-Users] Zope 3.3.0 beta 1 released!

2006-05-08 Thread Lorenzo Gil Sanchez
Hi El lun, 08-05-2006 a las 15:13 -0400, Stephan Richter escribió: > Hello everyone, > > The Zope 3 development team is proud to announce Zope 3.3.0 beta 1. > Great :) > - The 'browser:layer' directive and the 'ILayer' interface > has been deprecated. Registering layers has become obsole

[Zope3-Users] Master-slave forms with formlib

2006-07-10 Thread Lorenzo Gil Sanchez
Hi, I want to write a form using the common pattern Master-Slave where there are some fields related to a master object and then a subform (the slave) with a tabular view of the children of that objet. Something similar to: Personal Information - Name: [___] Age:

[Zope3-Users] license of z3c.multiform

2006-07-14 Thread Lorenzo Gil Sanchez
Hi everybody, in my quest of looking for a Master/Slave forms solution (as I talked in a previous message) I have found the z3c.multiform[1] package in the Zope subversion repository[2] I think it's pretty close to what I'm trying to do so I was very happy to find it. My next (inmediate) que

Re: [Zope3-Users] license of z3c.multiform

2006-07-14 Thread Lorenzo Gil Sanchez
Bernd Dorn wrote: On 14.07.2006, at 10:01, Lorenzo Gil Sanchez wrote: Hi everybody, in my quest of looking for a Master/Slave forms solution (as I talked in a previous message) I have found the z3c.multiform[1] package in the Zope subversion repository[2] I think it's pretty clo

[Zope3-Users] small bug in z3c.multiform package

2006-07-17 Thread Lorenzo Gil Sanchez
Hi, I found a bug in FilterMapping class of the z3c.multiform package. Basically the problem is due to the way the __len__ method is computed. Attached is a tiny patch for this bug. Feel free to use any copyright ownership you want for it. Regards Lorenzo Index: multiform/gridform.py =

[Zope3-Users] formlib, action decorators and inheritance

2006-07-17 Thread Lorenzo Gil Sanchez
Hi, I have an add form which a subclass of form.AddForm. It just adds a 'cancel' action. This is my code: class AddView(form.AddForm): form_fields = form.Fields(IDocument).omit('__name__') def create(self, data): return Document(**data) def nextURL(self): url =

Re: [Zope3-Users] Re: formlib, action decorators and inheritance

2006-07-17 Thread Lorenzo Gil Sanchez
Hi Jürgen, I did what you say and it's a little bit better. Thanks Lorenzo Jürgen Kartnaller wrote: Hi Lorenzo. Lorenzo Gil Sanchez wrote: Hi, I have an add form which a subclass of form.AddForm. It just adds a 'cancel' action. This is my code: class AddView(form.AddF

[Zope3-Users] patch for z3c.multiform

2006-07-19 Thread Lorenzo Gil Sanchez
Hi, Attached is a patch to add a small function to z3c.multiform. The function is called 'hasChildrenAndAllSubFormsDisplayMode' and is useful as a condition for an action. The use case is this: There is a 'remove' button that deletes lines from a multiform form. I don't want this button to s

[Zope3-Users] searching and relations

2006-07-21 Thread Lorenzo Gil Sanchez
Hi, I've been following recent discussion about relations in Zope. Both intrinsic and extrinsic relationships. For the following question lets assume we have a IClient and an IOrder content types and the IOrder schema has a IClient attribute called 'client'. Reading previous messages to thi

Re: [Zope3-Users] searching and relations

2006-07-22 Thread Lorenzo Gil Sanchez
lationship > in question... > > let me know if you'd like a copy. if not, then i'd suggest going > through at least the containers.txt in zc.relationship. > > as far as the catalog goes, i'd get into using hurry.query as fast as > possible ;) > > On 7/2

[Zope3-Users] adding indexes in a __init__ method

2006-07-25 Thread Lorenzo Gil Sanchez
Hi, I have a special Folder content. When an instance of this class is created I want to create a catalog and an index in its __init__ method. Something like: class FilterableContainer(BTreeContainer): implements(IFilterableContainer) def __init__(self): super(FilterableContaine

Re: [Zope3-Users] adding indexes in a __init__ method

2006-07-25 Thread Lorenzo Gil Sanchez
t; > # whatever needs to be done > > # self._catalog ... > > > > This handler is configured:: > > > > > >> for=".IFilterableContainer > > zope.app.container.interfaces.IObjectAddedEvent" > > hand

Re: [Zope3-Users] adding indexes in a __init__ method

2006-07-25 Thread Lorenzo Gil Sanchez
ld mean that if you created the FieldIndex in __init__ and the > catalog[key] part in the initialization handler then it should work. > > I put the del(self.field) bit in as a test in case you don't want that > attribute unecessarily hanging around. > > Hope **that** helps. >

Re: [Zope3-Users] adding indexes in a __init__ method

2006-07-25 Thread Lorenzo Gil Sanchez
Hi Darryl El mié, 26-07-2006 a las 00:48 +1200, Darryl Cousins escribió: > Hi Lorenzo, > > Cool. Where is the `contained` imported from? There is some magic there > because I couldn't get the test to work when creating the FieldIndex in > your createIndexes method without it. from zope.app.conta

[Zope3-Users] how to know if a principal has the right permissions

2006-08-27 Thread Lorenzo Gil Sanchez
Hello, I have a INewsItem content type that anonynmous users can see but only editors can create/edit/remove. I have a view which list all my news items. I want to show links from this view to the add, edit and remove views for every news item but only if the principal is an editor. So, from my L

Re: [Zope3-Users] Re: how to know if a principal has the right permissions

2006-08-28 Thread Lorenzo Gil Sanchez
El dom, 27-08-2006 a las 23:53 +0200, Philipp von Weitershausen escribió: > zope.security.canAccess > zope.security.canWrite Nice, I didn't know about those and I ended writing my own solution: def canAdd(self): interaction = ZopeSecurityPolicy() interaction.add(Participation

Re: [Zope3-Users] Re: how to know if a principal has the right permissions

2006-08-28 Thread Lorenzo Gil Sanchez
El lun, 28-08-2006 a las 20:35 +0200, Philipp von Weitershausen escribió: > Ack. Just get the current interaction with > zope.security.management.getInteraction(). With this code you're > hard-wiring yourself to the security policy in zope.app.securitypolicy. > Thanks, that's good to know. > Ri

Re: [Zope3-Users] Re: how to know if a principal has the right permissions

2006-08-28 Thread Lorenzo Gil Sanchez
El lun, 28-08-2006 a las 20:49 +0200, Philipp von Weitershausen escribió: > Lorenzo Gil Sanchez wrote: > >> Right. Because you're not supposed to poke at __data. The two > >> underscores should scare you off! > >> > >> By the way, this is

[Zope3-Users] Virtual hosting problem

2006-08-30 Thread Lorenzo Gil Sanchez
Hi, I know Zope3 has great support for virtual hosting and you can easily set it up using the Rewrite module of Apache as described here: http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3Book/virtualhosting.html My problem is that my hosting provider does not allow me to cre

[Zope3-Users] IAdding behaviour changed from 3.2 to 3.3

2006-10-14 Thread Lorenzo Gil Sanchez
Hi, I'm having problems with my Add Forms views (based in formlib.form.AddForm) in my transition from Zope 3.2 to Zope 3.3. In Zope 3.2 I registered my views like this: And my container implemented the marker interface zope.app.container.interfaces.IContentContainer. The default view for my c

Re: [Zope3-Users] IAdding behaviour changed from 3.2 to 3.3

2006-10-30 Thread Lorenzo Gil Sanchez
Thanks a lot, Stephan. Removing the 'menu' and 'title' attributes of the directive solved my problem!! Best regards Lorenzo El lun, 30-10-2006 a las 13:07 -0400, Stephan Richter escribió: > On Saturday 14 October 2006 06:50, Lorenzo Gil Sanchez wrote: > > Hi, >

[Zope3-Users] keeping GET data in a formlib based form

2007-03-13 Thread Lorenzo Gil Sanchez
Hi everybody, I have a formlib based form. It is not accesible from an application menu because it is part of a wizard like process. The first time it gets called the url looks something like this: http://localhost:8080/myapp/mycontent/myform?myarg=23 So in the update() method of the form I rea

[Zope3-Users] Views for adapted components

2007-03-26 Thread Lorenzo Gil Sanchez
Hi everybody, I have several components and now I want to add ImportExport funcionality to some of them. So I created a simple interface called IImportExport: class IImportExport(Interface): def importFromFile(filename): pass def exportToFile(filename): pass Now, all I have to do

[Zope3-Users] fine grained subscriber

2007-03-28 Thread Lorenzo Gil Sanchez
Hi, I'm writing an event subscriber to the IIntIdRemoveEvent event type. It looks like this: def intIdRemovedSubscriber(event): if IMyInterface.providedBy(event.object): # do some stuff with event.object and the zcml: But I'd like to avoid the if clause inside my subscriber function by

Re: [Zope3-Users] fine grained subscriber

2007-03-28 Thread Lorenzo Gil Sanchez
El mié, 28-03-2007 a las 12:50 +0200, FB escribió: > > You need a dispatcher - a quite common concept in zope3: > > [events.py, not tested] > from zope.event import notify > > def removeIntId(event): > notify(event.object,event) > I think the notify call should be like notify((event.obje

Re: [Zope3-Users] fine grained subscriber

2007-03-28 Thread Lorenzo Gil Sanchez
El mié, 28-03-2007 a las 13:39 +0200, Lorenzo Gil Sanchez escribió: > El mié, 28-03-2007 a las 12:50 +0200, FB escribió: > > > > You need a dispatcher - a quite common concept in zope3: > > > > [events.py, not tested] > > from zope.event import noti

[Zope3-Users] factories for an object

2007-06-01 Thread Lorenzo Gil Sanchez
Hi, after looking the zope.component API I realized that there is a function to get all the factories for an interface but there is no such thing for an object. Usually an object provides one or more interfaces, and one interface can have a lot of factories registered for it. Merging this informa

[Zope3-Users] zopeproject and debugging zope

2007-09-08 Thread Lorenzo Gil Sanchez
Hi, I recently switched to use zope3 as a library instead as a big application where you hook your webapp. Thanks to Philipp for his great zopeproject! Now I miss something from the old 'bin/runzope' days. I liked how you could run an interactive debug session using zope.app.debug.Debugger and th

Re: [Zope3-Users] zopeproject and debugging zope

2007-09-09 Thread Lorenzo Gil Sanchez
El sáb, 08-09-2007 a las 16:27 -0400, Benji York escribió: > Lorenzo Gil Sanchez wrote: > > Now I miss something from the old 'bin/runzope' days. I liked how you > > could run an interactive debug session using zope.app.debug.Debugger and > > the command 'bin

Re: [Zope3-Users] zopeproject and debugging zope

2007-09-10 Thread Lorenzo Gil Sanchez
s) if __name__ == '__main__': debug() It is based on zc.zope3recipes.debugzope, which I couldn't make to work. Best regards Lorenzo Gil El sáb, 08-09-2007 a las 20:27 +0200, Lorenzo Gil Sanchez escribió: > Hi, > > I recently switched to use zope3 as a library inste

Re: [Zope3-Users] Announcing zopeproject 0.4

2007-09-16 Thread Lorenzo Gil Sanchez
Hi Philipp, thanks a lot for adding a debug script to the bin directory. It's one of the few things I missed from this great package! I may suggest you could add the changes of the 0.4 version to this announce email. Just a minor issue :-) Thanks, really! Lorenzo Gil El dom, 16-09-2007 a las 1

[Zope3-Users] lack of security declaration: bug or feature?

2007-11-02 Thread Lorenzo Gil Sanchez
Hi, I'm using zope.app.container.ordered.OrderedContainer in my application and I got this error: ForbiddenAttribute: ('__getitem__', ) I added this lines to my configure.zcml: and that fixed the error. It's totally ok when it's adding security declarations to my classes but I feel

Re: [Zope3-Users] Re: lack of security declaration: bug or feature?

2007-11-05 Thread Lorenzo Gil Sanchez
El vie, 02-11-2007 a las 22:32 +0100, Philipp von Weitersehausen escribió: > I think OrderedContainer is a base class for your own container types. I > don't see a problem if it doesn't have security declarations. > I understand. Thanks for the aclaration. > By the way, you probably want to sp

Re: [Zope3-Users] Re: lack of security declaration: bug or feature?

2007-11-07 Thread Lorenzo Gil Sanchez
2007 à 12:35 +0100, Lorenzo Gil Sanchez a écrit : > > Oh, that's true indeed. It's a shame IOrderedContainer is defined as > > inheriting from IContainer because I can't declare a permission for the > > updateOrder method in an independent way. Something like: I want

[Zope3-Users] public view on a private object

2007-12-19 Thread Lorenzo Gil Sanchez
Hi zopers, I got a security problem today and I finally fix it but I still wanted to share it with the rest of you to ask for advice and to help others to avoid my problem. My problem was that I have a content type whose class was configured with: And I have a default view for this class that

Re: [Zope3-Users] buildout recipe for ReportLab

2008-07-11 Thread Lorenzo Gil Sanchez
El vie, 11-07-2008 a las 10:35 +0200, Christian Theune escribió: > On Thu, 2008-07-10 at 21:21 +0200, Lorenzo Gil Sánchez wrote: > > Hi, > > > > I'd like to ask if anybody is using a buildout recipe to install > > ReportLab in the buildout. > > I only declare 'ReportLab' as a dependency. Whats th