[Zope3-Users] Re: Why IField.default type is Field ? IField.default is value of Field then it can't to be the field

2006-09-29 Thread KLEIN Stéphane

2006/9/29, Philipp von Weitershausen [EMAIL PROTECTED]:



KLEIN Stéphane wrote:
 I don't understand why Field.default type is Field ?

What else do you suggest?




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


[Zope3-Users] Re: Why IField.default type is Field ? IField.default is value of Field then it can't to be the field

2006-09-29 Thread Philipp von Weitershausen

KLEIN Stéphane wrote:

2006/9/29, Philipp von Weitershausen [EMAIL PROTECTED]:



KLEIN Stéphane wrote:
 I don't understand why Field.default type is Field ?

What else do you suggest?



NoneType


To express what?


or Object


Object requires an interface that the object should provide. Default 
values don't necessarily have to conform to an interface.


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


[Zope3-Users] Re: Why IField.default type is Field ? IField.default is value of Field then it can't to be the field

2006-09-29 Thread KLEIN Stéphane

2006/9/29, Philipp von Weitershausen [EMAIL PROTECTED]:

KLEIN Stéphane wrote:
 2006/9/29, Philipp von Weitershausen [EMAIL PROTECTED]:


 KLEIN Stéphane wrote:
  I don't understand why Field.default type is Field ?

 What else do you suggest?


 NoneType

To express what?

 or Object

Object requires an interface that the object should provide. Default
values don't necessarily have to conform to an interface.




Simply, if I do :

myfield.default = ufoobar

ufoobar isn't Field type but String. Then I don't understand why
default type is Field. Well, I know, Python isn't typed language...
therefore it's working.
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: There aren't IDict widget ?

2006-09-29 Thread FB
Hi,

On Fri, Sep 29, 2006 at 10:20:01AM +0200, KLEIN Stéphane wrote:
 2006/9/29, KLEIN Stéphane [EMAIL PROTECTED]:
 2006/9/29, KLEIN Stéphane [EMAIL PROTECTED]:
  Hello,
 
  in one content component I've switch from IList to IDict schema and I
  note than IDict widget don't exist. It's normal ? if yes, why ?
 
 I see that : http://mail.zope.org/pipermail/zope3-users/2006-June/003720.html
 
 
 In mail http://mail.zope.org/pipermail/zope3-users/2006-June/003720.html
 I don't know where put the last part :

This was just a fix of the (formerly?) buggy Dict schema object.

Just copy it into a seperate python file and instead of defining

 class MySchema(Interface):
Dict(...)

use

 class MySchema(Interface):
FixedDict(...)

Regards,

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


[Zope3-Users] Re: Versionitis with psycopgda Again

2006-09-29 Thread Jeff Rush

Philipp von Weitershausen wrote:


Jeff Rush wrote:


Studying the psycopgda repository for branches/tags I figured there 
was a tag set to match psycopgda with each Zope version released, but 
no luck.  There are no tags at all in several years.


The package has obviously been poorly maintained. Are you a contributor 
yet, Jeff? :)


A good question considering what I'm wrestling with at the moment.  I would 
very much like to get involved.  At PyCon I filled out the contributor form, 
got write access and got too busy to use it (plus it was during the quiet time 
before the 3.3.0 release).  Now my ssh key isn't working, so I need to see 
someone about resetting it.  But with the Zope Foundation situation, I may 
very well need to sign a new contributor form to do that, but I'm not sure.


I also would like to create a new project on svn.zope.org, to contain the 
various Zope3 components I'm creating for the Python advocacy effort.  However 
I'm not sure whether I can just create another z3c.advocacy namespace or 
myname.advocacy.  Is there a requirement that everything on svn.zope.org be 
licensed under the ZPL?  The PSF would like what I produce to be under either 
the Apache or Artistic license.  If the license is a problem I can use 
svn.python.org instead I suppose, but the components are of a general nature 
and I'd like to contribute them to the Zope community.


Poking around svn.zope.org, I've got a question regarding how you avoid 
overwrite conflicts on the file z3c/__init__.py file.  I see different 
projects using different such files, some with code in them (extfile).  If 
several z3c components are installed in a site, it seems that file is a 
hotspot of contention.



Any suggestions?  With the popularity of psycopg + Zope3, any chance 
we could get psycopgda added into the Zope3 distribution to mitigate 
this chasing?


I don't think that can happen. We're thinking about making the core 
smaller, not bigger :). Also, not everyone has or needs psycopg, so the 
testing would become a burden.


Understandable.  By the way, revision 40054 is the one that works with Zope 
3.2.1 and I'd like to put a meaningful tag on that when I get access.  I've 
also got a simple patch to psycopgda that lets it use psycopg2 and fallback to 
psycopg1 if not found.  It's been working great here for almost a year, with 
psycopg2.


-Jeff


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


[Zope3-Users] Why in apidoc, I don't found the interface must be implemented to be register by IntIds ?

2006-09-29 Thread KLEIN Stéphane

I read IntIds apidoc, I see :

#  register(ob)
Interface : zope.app.intid.interfaces.IIntIdsSet
Permissions : zope.ManageContent (lecture), non disponible (écriture)

in lib/python/zope/app/intid/tests.py I see :

class P(Persistent):
   implements(ILocation)

and too far :

   u = IntIds()
   obj = P()

   uid = u.register(obj)

When, in debugzope I test :

   u = IntIds()
   obj = object()

   uid = u.register(obj)

this don't work.

Where can I found documentation about IntIds ?

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


[Zope3-Users] Re: Re: So you've just downloaded Zope 3.3....

2006-09-29 Thread Jeff Shell

On 9/28/06, Philipp von Weitershausen [EMAIL PROTECTED] wrote:

Jeff Shell wrote:
 One blow-up instance was on something that was marked deprecated (a
 vocabulary that used `zope.app.utility.vocabulary.UtilityVocabulary`
 as its factory).

How? can you provide a traceback? Like Jim said, we tried having 3.3 be
backward compatible.


It's a reference that was marked as deprecated, and that it would go
away in 3.3. Now it's 3.3, and it's gone! It's just something that I
wish I had caught sooner, but it was an easy fix.


 Strangely, I never saw that deprecation warning, or I
 would have fixed it a long time ago. It looks like deprecated items
 referenced in ZCML wouldn't trigger the warnings in Zope 3.2, whereas
 Python based importing/referencing would.

Hmmm. Weird. Can you reproduce this? If so, please file a bug.


I'll submit one if I can make an easily re-producable case. I'm a bit
swamped right now.


 That said, I still don't really know much about what's new and
 special.

Ugh, that's bad. I'm sorry if we've been unclear. Does
http://kpug.zwiki.org/WhatIsNewInZope33 help?


Yes. Why isn't that linked off of any sensible page or place in the
Zope 3 wiki? Releas page? I was pretty sure someone had been working
on such a document. But I couldn't find it at all, which is why I
asked here.


 I see a lot of things in the Wiki in proposals, but the
 proposals don't always mirror final implementations, so sometimes it's
 a bit of a guessing game if one even has that to go on. Only a few of
 the proposed ZCML reductions went into play, correct?

I just checked and the Implementation status section is correct
regarding Zope 3 (trunk refers to 3.3 though).

I admit, though, I coudl've done a better job updating the proposals
after having implemented them. Without moving the blame elsewhere, I
think we should consider a more formal proposal process again, like I
suggested once. Python PEPs and Plone PLIPs seem to work very well.


I agree. The Wiki is perhaps a good place to collaborate or brainstorm
initially. But there's just not enough data ever available to maintain
pages like this:

http://plone.org/products/plone/roadmap

without a lot of human intervention (manually creating the tables,
status information, owner information, etc, in multiple places).


 It would be nice if there was at least a small document that went
 through deprecated items and covered how to migrate away from them -
 separate from the change log or proposals.

I've tried to emit helpful deprecation warnigns that dont' just say
this is deprecated but also say use XYZ instead. The proposals
should also document this. What is it that you're particularly
struggling with?


I saw those messages! Those made me happy. And that kpug.zwiki.org
page looks like it'd be very helpful too.

I'm struggling with the migrate by hitting ./runzope over and over
again until the thing starts up Having some better information
before I even download a Zope release would help - including reminders
that certain features that had been marked for removal in 3.3 have
actually been removed. I have some old Zope 3.1 era code that I'm
trying to update right now. It was made to work comfortably with Zope
3.2, but we had one customer continue along with that installation and
we've just forgot about it and never got around to the change this
when everything is running on Zope 3.2 comments we had lying around.


 Now, here's the strange one:

 What happened to Tools? `zope.app.component.browser.tools`? I'm not
 even sure what tools were,

We weren't either ;) so we got rid of them.


I was able to get rid of our references with no change in expected
behavior, so I think we're good. Like I said, I think we just used
those directives because we saw someone / something else doing it. We
certainly weren't getting any special behavior out of them that I know
of, I just wanted to be sure I could kill them off completely.

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


[Zope3-Users] Re: Why in apidoc, I don't found the interface must be implemented to be register by IntIds ?

2006-09-29 Thread Philipp von Weitershausen

KLEIN Stéphane wrote:

I read IntIds apidoc, I see :

#  register(ob)
Interface : zope.app.intid.interfaces.IIntIdsSet
Permissions : zope.ManageContent (lecture), non disponible (écriture)


When quoting things from the Zope ZMI, I suggest switching to English 
first. Not everyone understands French.



in lib/python/zope/app/intid/tests.py I see :

class P(Persistent):
   implements(ILocation)

and too far :


?


   u = IntIds()
   obj = P()

   uid = u.register(obj)

When, in debugzope I test :

   u = IntIds()
   obj = object()

   uid = u.register(obj)

this don't work.


it doesn't work is not a proper error description. We can't help you 
without knowing *what's* going wrong on your side.



By the way, it probably doesn't work because you're missing an adapter 
for 'obj' to IKeyReference. This is necessary to make it work and 
required by intid utilities as documented in one of the zope.app.intid 
interfaces:


  class IIntIdsSet(Interface):

  def register(ob):
  Register an object and returns a unique id generated for it.

  The object *must* be adaptable to IKeyReference.

  If the object is already registered, its id is returned anyway.
  

So, you first need to register an IKeyReference adapter for your 'P()' 
object.




Where can I found documentation about IntIds ?


My new book :)

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


[Zope3-Users] Unicode and vocabularies

2006-09-29 Thread Darryl Cousins
Hi,

I'm having some trouble with unicode and vocabularies.

I've a utility with a List field:

class MyUtility(Interface):

mylist = List(title=_(My List),
  value_type = TextLine(_(list item)),
  default = [],
  required = False)

When the utility is created the list is populated from a unicode text
file:

datadir = os.path.join(os.path.dirname(__file__),'data')
source_file = os.path.join(datadir, 'medium.dat')
fp = codecs.open(source_file,r,'utf-8')
options = []
for line in fp.readlines():
options.append(line.strip())
util.medium = options
fp.close()

The file contains é (e-acute). I came to the above routine to fix a
'Wrong Type' error for the list.

Now when I come to create a vocabulary from the list:

class MyVocabulary(object):

def __call__(self, context):
utility = zapi.getUtility(IMyUtility)
items = [item for item in utility.medium]
return SimpleVocabulary.fromValues(items)

It raises error

...
File /opt/zope/zope3/src/zope/schema/vocabulary.py, line 41, in
__init__
self.token = str(token)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
position 13: ordinal not in range(128)with vocabulary code:

I can't figure out how to get the correct unicode value into the utility
list and yet still have str(u'é') work when vocabulary factory is
called.

Best regards,
Darryl

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


Re: [Zope3-Users] Re: Re: So you've just downloaded Zope 3.3....

2006-09-29 Thread Baiju M

On 9/30/06, Jeff Shell [EMAIL PROTECTED] wrote:

snip


  That said, I still don't really know much about what's new and
  special.

 Ugh, that's bad. I'm sorry if we've been unclear. Does
 http://kpug.zwiki.org/WhatIsNewInZope33 help?

Yes. Why isn't that linked off of any sensible page or place in the
Zope 3 wiki? Releas page? I was pretty sure someone had been working
on such a document. But I couldn't find it at all, which is why I
asked here.


Thanks, this is now added to :
http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope330

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