Re: [Zope3-Users] Calling createAndAdd with different object id

2005-09-11 Thread Florian Lindner
Am Sonntag, 11. September 2005 03:52 schrieb Alen Stanisic: I don't think you would do it in AddView. You need to implement an adapter for your container providing zope.app.container.interfaces.INameChooser where chooseName() method will return name for you objects. A INameChooser adapter

Re[2]: [Zope3-Users] Calling createAndAdd with different object id

2005-09-11 Thread Adam Groszer
Hello Florian, No clue. Next hint is to override the add method of AddView. The default is: return self.context.add(content) Try something like this: self.context[my_id]=content Another hint: self.context.contentName = my_id return self.context.add(content) Have a look at

Re: [Zope3-Users] Object Name field on addforms

2005-09-11 Thread Florian Lindner
Am Sonntag, 11. September 2005 15:04 schrieb Florian Lindner: Hello the auto generated add forms sometimes dispaly a field for the Object Name. add.pt in src/zope/app/form/browser span tal:condition=context/nameAllowed|nothing tal:omit-tag= nbsp;nbsp;b i18n:translate=Object

Re: [Zope3-Users] Patterns in Zope3

2005-09-11 Thread Stephan Richter
On Thursday 01 September 2005 14:44, Antonio Beamud Montero wrote: If I create a Component Client and a component Invoice, - it's better put all the instances inside se same folder or create two folders, a folder clients and a folder invoices? There are different approaches: 1. Create Client

Re: [Zope3-Users] Object Name field on addforms

2005-09-11 Thread Stephan Richter
On Sunday 11 September 2005 09:04, Florian Lindner wrote: I have a Container (implementing IContainer, Interface (via Interface inheritance) and via ZCML IAttributeAnnotatable and IContentContainer. On the auto-generated addform in my layer the Object Name is not shown. Why? Because your

Re: [Zope3-Users] Object Name field on addforms

2005-09-11 Thread Stephan Richter
On Sunday 11 September 2005 10:07, Florian Lindner wrote: The field is displayed when the addform is called with folder/+/AddCSLink.html. In this case AddCSLink.html is a view for IAdding. When folder/AddCSLink.html is is not displayed. Here AddCSLink.html is a view of IContainer. What is

Re: [Zope3-Users] Calling createAndAdd with different object id

2005-09-11 Thread Stephan Richter
On Saturday 10 September 2005 11:05, Florian Lindner wrote: I want to override the createAndAdd method mothed in a view class. Since I don't want to do all the work I want to derive my class from the AddView class from /home/florian/Zope3/src/zope/app/form/browser/add.py. The only thing I do

Re: [Zope3-Users] Using building blocks for forms

2005-09-11 Thread Stephan Richter
On Friday 02 September 2005 10:56, Florian Lindner wrote: It would be nice if I can reuse parts of the auto generated form. For example the error reporting of the fields. Is that possible? Or do I need to redo everything when using a template? For more pythonic and flexible forms use

[Zope3-Users] Problem connecting to MySQL

2005-09-11 Thread Stephen Day
Hello, I'm trying to access a MySQL database through Zope3 but I keep getting an error about encoding: LookupError: unknown encoding: latin1_swedish_ci I've tried changing the encoding of the database and the Zope connection object to utf8, among other things, but nothing seems to work. I'm

Re: [Zope3-Users] Calling createAndAdd with different object id

2005-09-11 Thread Alen Stanisic
In INameChooser chooseName(self, name, object) method takes default object name and the object you are adding. Thru this object I would expect you to have access to attributes of your object entered in the objects add form. Unless the fields in your form you need access to are not in your