Re: Not Really SOLVED! Re: [Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Tim Cook
On Mon, 2008-07-07 at 13:34 -0400, Benji York wrote: > On Mon, Jul 7, 2008 at 1:28 PM, Tim Cook <[EMAIL PROTECTED]> wrote: > > > > Okay, the problem is defined but it really isn't a solution for me. > > It seems that Zope has defined 'description' as a keyword not allowed in > > schema definitions

Re: Not Really SOLVED! Re: [Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Fred Drake
On Mon, Jul 7, 2008 at 2:25 PM, Tim Cook <[EMAIL PROTECTED]> wrote: > Okay. But before I do that. Is my approach to initializing an instance > correct or is the problem the way I handled the keywords? ... >for n,v in kw.items(): >setattr(self,n,v) There are people who like th

Re: Not Really SOLVED! Re: [Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Tim Cook
On Mon, 2008-07-07 at 13:34 -0400, Benji York wrote: > On Mon, Jul 7, 2008 at 1:28 PM, Tim Cook <[EMAIL PROTECTED]> wrote: > > > > Okay, the problem is defined but it really isn't a solution for me. > > It seems that Zope has defined 'description' as a keyword not allowed in > > schema definitions

Re: Not Really SOLVED! Re: [Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Benji York
On Mon, Jul 7, 2008 at 1:28 PM, Tim Cook <[EMAIL PROTECTED]> wrote: > > Okay, the problem is defined but it really isn't a solution for me. > It seems that Zope has defined 'description' as a keyword not allowed in > schema definitions. That's rather odd. Can you construct a small example (say, a

Re: Not Really SOLVED! Re: [Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Tim Cook
Okay, the problem is defined but it really isn't a solution for me. It seems that Zope has defined 'description' as a keyword not allowed in schema definitions. The WrongType error occurs in validation because Zope thinks it is the 'description' of the attribute and not the attribute itself. T

Not Really SOLVED! Re: [Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Tim Cook
On Mon, 2008-07-07 at 13:58 -0300, Tim Cook wrote: > ... and I've learned a lot thanks to you patience. > > On Mon, 2008-07-07 at 12:41 -0300, Tim Cook wrote: > > I've been Googling for a script I can run against all of my source to > > test characters for unicode just in case there are more of t

SOLVED! Re: [Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Tim Cook
... and I've learned a lot thanks to you patience. On Mon, 2008-07-07 at 12:41 -0300, Tim Cook wrote: > I've been Googling for a script I can run against all of my source to > test characters for unicode just in case there are more of those that I > copied into title or description fields. If you

Re: [Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Tim Cook
On Mon, 2008-07-07 at 16:55 +0200, Philipp von Weitershausen wrote: > What does ItemTree.items field have to do with Activity.description > field? I thought we're talking about the Object(schema=IItemTree) field > inside IActivity here? An ItemTree instance is what is being assigned to Activit

[Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Philipp von Weitershausen
Tim Cook wrote: On Mon, 2008-07-07 at 07:07 -0300, Tim Cook wrote: So once I remove all those characters I can get back to the task at hand. H, well those characters were a problem. However, I still get the File "/home/tim/buildout-eggs/zope.schema-3.4.0-py2.4.egg/zope/schema/_boo

Re: [Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Tim Cook
Answering my own questions: On Mon, 2008-07-07 at 10:20 -0300, Tim Cook wrote: > All of my source files have the unicode declaration: > # -*- coding: utf-8 -*- as the first line. > > Do those strings inside the list have to be marked as unicode? for > example: > [([u'include', ([([u'archetype

Re: [Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Tim Cook
On Mon, 2008-07-07 at 07:07 -0300, Tim Cook wrote: > So once I remove all those characters I can get back to the task at > hand. H, well those characters were a problem. However, I still get the File "/home/tim/buildout-eggs/zope.schema-3.4.0-py2.4.egg/zope/schema/_bootstrapfields.py"

Re: [Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Philipp von Weitershausen
El 7 Jul 2008, a las 12:06 , Tim Cook escribió: Am I correct in thinking that the above definition of Activity.description will constrain the possible types to the classes implementing IItemStructure or a subclass of it? Yes, it constraints the value of the 'description' attribute to any obje

Re: [Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Tim Cook
On Mon, 2008-07-07 at 09:56 +0200, Philipp von Weitershausen wrote: > > Now I want to allow description to be any descendant of ItemStructure. > > So I had hoped that: > > > >description=Object( > >schema=IItemStructure, > >title=_(u"Description"), > >description=_(u"

Re: [Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Philipp von Weitershausen
El 7 Jul 2008, a las 09:20 , Tim Cook escribió: On Mon, 2008-07-07 at 00:46 +0200, Philipp von Weitershausen wrote: description=Object( schema=IFoo, ... ) So the zope.schema.Object field is really about specifying objects that provide a certain schema. It's not for *arb

Re: [Zope3-Users] Re: zope.schema Question

2008-07-07 Thread Tim Cook
On Mon, 2008-07-07 at 00:46 +0200, Philipp von Weitershausen wrote: > >description=Object( >schema=IFoo, >... >) > > So the zope.schema.Object field is really about specifying objects that > provide a certain schema. It's not for *arbitrary* objects (use > zope.sch

[Zope3-Users] Re: zope.schema Question

2008-07-06 Thread Philipp von Weitershausen
Tim Cook wrote: I have a class attribute defined in an interface as such: description=Object( title=_(u"Description"), description=_(u"Description of the activity."), required=True, ) I used Object because this attribute can be one of several different class inst