[Zope3-Users] Overriding cssClass on all input widgets
I'm trying to make a skin for my program, but am having trouble getting the input forms converted over. I have a skin created by a graphic artist, my problem now is figuring out how to change the cssClass attribute for all my widgets. Currently my forms are registered like this: browser:page for=zope.app.container.interfaces.IAdding name=ship.IncidentReport class=.incidentreport.IncidentReportAddForm permission=zope.View / where .incidentreport.IncidentReportAddForm specifies the template for the form. I plan to register all the forms like this. Any ideas as to how I can do this? Greg ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Rendering subobjects in pages
How can I specify a template to render a sub-object within one of my content objects? For example, pretend I have a Contact object which contains a Person object. I am rendering the Contact object through a page template. class Contact: person = Person() In all the examples I see, rendering the person would be done using many tal expressions like span tal:content=context/person/name / or something similar. Is it possible to render the person object using a single tal expression, div tal:content=context/person /, having the rendering handled by a template somewhere? The reason I want to do this is because the person object will be used in many different classes and for a consistent look and feel I would like to render the object the same on all pages without having to maintain 10 different page templates. Hope this makes sense. Greg ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Sorry about that last email
Hrm, it appears that ctrl-enter in kmail actually sends emails... Sorry about that last one.. Anyway, my question: interfaces.py: -- class IReport(Interface): containers(IReportContainer) class IReportContainer(IContainer): contains(IReport) the above two classes reside in the same module, interfaces.py... Since they both depend on each other, I am having the problem of a circular dependency. How can I resolve this? Greg ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Circular dependency issue
How do I resolve the following: ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Still stuck without views.
On May 7, 2007 01:07:52 pm Robert Norman wrote: Hi again, I'm trying to learn Zope through the Web Component Development book and find myself stuck implementing simple views. This was posted earlier but and I've worked on it since but feel totally unable to proceed. I'm working on WinXP. I can manipulate simple persistant objects using debugzope. The objects are listed in the ZMI. However I can't do anything with the views supplied as part of the example code. For example, under debugzope , following the instructions in the text, if I try to examine the supplied view with: view = getMultiAdapter((lasagne, request), name=u'index.html') I get a lookup error. Both lasagne, and request are valid objects. Also, from my browser even though the ZMI shows my objects, any attempt to view them fails. Apparently my view is not being registered. A line does exists in the configuration file that points to the folder containing the view... include package=.browser / This is all code supplied by the book pasted in from the web site -- I don't have the depth of knowledge of Zope yet to figure this out. I've tried re-installing Zope. I did a clean install of Zope with a new instance on a different machine (also WinXP) and get the same result. The browser folder contains a configuration file pointing to the supplied view with name=index.html. Where do I go from here? I'd like to know what's wrong, but more importantly, I'd like to know how to go about finding out what's wrong without having to resort to this list. Thanks in advance... Robert Does the zope server spit out any errors when you try to view these objects from a browser? If so, paste them here, they may help. Greg ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Problem with @@absolute_url
I have no idea how to get the absolute url of an adapted object, or even if its possible. If you can, please bear with me and I'll try to explain myself clearly. Consider this example (simple object and adapter): class IStudent: Simple student object studentNumber = StudentNumber( title = _(Student Number), description = _(The student's ID number.), required = True) class IStudentPhoto: Adapts Student to IImage The unit tests for my class and adapter passes fine, so I know that doing something like the following works... photo = StudentPhoto(Student(123456789)) My problem is that I want to display the photo in a browser but can't figure out how. I created a browser view helper in python, and it seems to work for the most part: class StudentDetails: Helper to return a student photo. def getPhoto(self): student = self.context return StudentPhoto(student) In my page template, I can see that the IImage object is being created correctly.. div tal:define=photo view/getPhoto span tal:content=photo#/span /div gives me zope.app.file.image.Image object at 0xb75c6c6c. But to turn this object into a URL so that I can put it in an img tag is beyond me. When I try to do an @@absolute_url on the photo object I get the error saying there's not enough context. Am I going about this the wrong way? Is there some other thing I need to be doing in order for there to be enough context? Thanks for any help, Greg ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Problem with @@absolute_url
On Monday 30 April 2007 17:46, Christophe Combelles wrote: You should probably try to set the __parent__ of the adapter to the __parent__ of the adapted object (or to the object itself) Thanks for the advice, Christophe. I tried both ways but neither worked for me. Still getting the 'not enough context' error. Guess I will try using Maciej's way. Hopefully that will work for me. Greg Christophe Greg Baker a écrit : I have no idea how to get the absolute url of an adapted object, or even if its possible. If you can, please bear with me and I'll try to explain myself clearly. Consider this example (simple object and adapter): class IStudent: Simple student object studentNumber = StudentNumber( title = _(Student Number), description = _(The student's ID number.), required = True) class IStudentPhoto: Adapts Student to IImage The unit tests for my class and adapter passes fine, so I know that doing something like the following works... photo = StudentPhoto(Student(123456789)) My problem is that I want to display the photo in a browser but can't figure out how. I created a browser view helper in python, and it seems to work for the most part: class StudentDetails: Helper to return a student photo. def getPhoto(self): student = self.context return StudentPhoto(student) In my page template, I can see that the IImage object is being created correctly.. div tal:define=photo view/getPhoto span tal:content=photo#/span /div gives me zope.app.file.image.Image object at 0xb75c6c6c. But to turn this object into a URL so that I can put it in an img tag is beyond me. When I try to do an @@absolute_url on the photo object I get the error saying there's not enough context. Am I going about this the wrong way? Is there some other thing I need to be doing in order for there to be enough context? Thanks for any help, Greg ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users