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 object's schema.  If this is
the case not sure if you could maybe extend your persistent schema
interface with another interface containing your non-persistent fields
and somehow have access to those in chooseName().  Haven't tried this
though :)

Alen

On 9/11/05, Florian Lindner <[EMAIL PROTECTED]> wrote:
> A INameChooser adapter would really be perfect for me. But I need access to
> the form data of the add form. And AFAIK I don't have this using the
> NameChooser. You now a way to get the form data in the NameChooser?
> 
> Thanks,
> 
> Florian
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


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 in my class is to change the name (object id) of the object to
> be created. In the arguments of the createAndAdd method I have not found
> any information about the id. How can I alter the name?

Use INameChooser or implement an alternate __setitem__ method in your 
container code.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


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 would really be perfect for me. But I need access to 
the form data of the add form. And AFAIK I don't have this using the 
NameChooser. You now a way to get the form data in the NameChooser?

Thanks,

Florian


> Alen
>
> On Sat, 2005-09-10 at 17:05 +0200, Florian Lindner wrote:
> > Hello,
> > 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 in my class is to change the name (object id) of the
> > object to be created. In the arguments of the createAndAdd method I have
> > not found any information about the id. How can I alter the name?
> >
> > Thanks,
> >
> > Florian
> > ___
> > 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


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

2005-09-11 Thread Florian Lindner
Am Samstag, 10. September 2005 18:53 schrieb Adam Groszer:
> Hello Florian,
>
> I suggest you download the examples for Philipp's book from
> http://worldcookery.com/files/examples-1.0.tgz
> Have a look at \examples-1.0\14containers\folder.py.

A INameChooser adapter would really be perfect for me. But I need access to 
the form data of the add form. And AFAIK I don't have this using the 
NameChooser. You now a way to get the form data in the NameChooser?

Thanks,

Florian

>
> Saturday, September 10, 2005, 5:05:26 PM, you wrote:
> > Hello,
> > 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 in my class is to change the name (object id) of the
> > object to be created. In the arguments of the createAndAdd method I have
> > not found any information about the id. How can I alter the name?
> >
> > Thanks,
> >
> > Florian
> > ___
> > 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


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

2005-09-10 Thread 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.

Alen

On Sat, 2005-09-10 at 17:05 +0200, Florian Lindner wrote:
> Hello,
> 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 in my class is to change the name (object id) of the object to be 
> created. In the arguments of the createAndAdd method I have not found any 
> information about the id. How can I alter the name?
> 
> Thanks,
> 
> Florian
> ___
> 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


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

2005-09-10 Thread Adam Groszer
Hello Florian,

I suggest you download the examples for Philipp's book from
http://worldcookery.com/files/examples-1.0.tgz
Have a look at \examples-1.0\14containers\folder.py.

Saturday, September 10, 2005, 5:05:26 PM, you wrote:

> Hello,
> 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 in my class is to change the name (object id) of the object to be
> created. In the arguments of the createAndAdd method I have not found any
> information about the id. How can I alter the name?

> Thanks,

> Florian
> ___
> Zope3-users mailing list
> Zope3-users@zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users 



-- 
Best regards,
 Adammailto:[EMAIL PROTECTED]
--
Quote of the day:
Chance is a word devoid of sense; nothing can exist without a cause. 
- Voltaire 

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users