Re: [Zope3-Users] local search engine

2013-08-14 Thread Michael Howitz
Am 01.08.2013 um 14:10 schrieb christophe petit christophe.peti...@gmail.com:
[…]
 @adapter(ISearchz, IObjectAddedEvent)
 def creationCatalog(event):
[…]
 Could you see what's wrong at first sight ?

You define two arguments in the adapter decorator, but your function accepts 
only one.

Yours sincerely,
-- 
Michael Howitz · m...@gocept.com · software developer
gocept gmbh  co. kg · Forsterstraße 29 · 06112 Halle (Saale) · Germany
http://gocept.com · Tel +49 345 1229889-8
Python, Pyramid, Plone, Zope · consulting, development, hosting, operations



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Unable to start ZEO server

2011-06-15 Thread Michael Howitz

Am 15.06.2011 um 00:33 schrieb George Wright:

 Michael
 Thanks for the reply
 I tried again to start ZEO with python2.4 instead of 2.6 - now have a 
 different problem:
 
 georgewr$ python2.4 /usr/local/Zope-3.4.0c1/lib/python/ZEO/runzeo.py -a 
 /tmp/zeosocket -f /tmp/test.fs
 Traceback (most recent call last):
  File /usr/local/Zope-3.4.0c1/lib/python/ZEO/runzeo.py, line 43, in ?
import ZConfig, ZConfig.datatypes
 ImportError: No module named ZConfig
 
 I do have python 2.4 and the ZConfig.datatypes is present - although it is 
 within Zope Dependencies
 
 /Users/georgewr/Zope-3.4.0c1/Dependencies/ZConfig-Zope-3.4.0c1/ZConfig/datatypes.py
 
 Should it be there?

Don't know.

 Is it findable there?

It seems that it is not. I think it is not the right way to start the ZEO 
server. There needs to be a wrapper script somewhere (maybe in `bin`) which 
sets the path correctly and knows the parameters like the path to the Data.fs.


Yours sincerely,
-- 
Michael Howitz · m...@gocept.com · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


Re: [Zope3-Users] Referencing objects

2011-02-21 Thread Michael Seifert
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Am 04.02.2011 17:04, schrieb Thierry Florac:
 Hi,
 
 
 Le vendredi  4 février 2011,
   Michael Seifert michael.seif...@gmx.net a écrit :
 ==
 Hello everyone,
 
 I recently started a Zope3 project, but I am stuck at the very
 beginning. Although I have some experience with Zope2, the more
 flexible approach to developing web applications was giving me a
 really hard start. Let me point out my situation:
 I created a container hierarchy which is stored in ZODB. Say I have a
 set of object types A, B, C, D, whose relationships look like the
 following (edges represent containment, i.e. A contains B,... where B
 and D are in subcontainers of A):
 
 A
/ \
   B   D
   |
   C
 
 C has an attribute referencing an object of type D. As this attribute
 is mandatory on creation, I created a vocabulary, which ascends the
 hierarchy from the current context until it reaches A and returns all
 objects of type D.
 Now the part that doesn't work:
 While ascending from C to B and from B to A works fine, descending
 from A to D returns a security proxied object and since these objects
 cannot be pickled, I cannot store it's reference in the attribute of
 C.
 
 1. Is this the way it's meant to be done? :) What is your opinion of
 storing B and D objects in subcontainers of A?
 
 That shouldn't be a problem, it's not different when you use a basic
 folder-like container which, internally, stores sub-objects in an
 internal b-tree container ; the only difference here is that you own
 two internal containment attributes.
 
 
 2. Are there any means to turn the vocabulary into trusted code, so it
 will not be encapsulated in a proxy (without deactivating the security
 proxy)?
 
 Perhaps can you use the removeSecurityProxy function ?
 
 
 3. How do you reference objects like you do with foreign keys in
 relational databases? I want to do this to prevent objects from being
 saved multiple times.
 
 If the targetted object is persistent (and so a subclass of
 Persistent class), it should be stored only once in the database
 (just try to alter properties of an object and check if the other one
 is also modified or not to check !)
 Another way I commonly use to store references is to store only an
 IIntIds utility reference, which is an integer ; the benefit of this
 is that this value can easilly be indexed.
 
 Regards,
 Thierry

Thanks Thierry, your answer helped a lot.

I solved the issue with:
from zope.security.proxy import removeSecurityProxy
def vocab(context):
...
return SimpleVocabulary.fromValues([removeSecurityProxy(elem) for elem
in context.values()]))


Still, I have some questions regarding the security.

1.
When creating the vocabulary with
return SimpleVocabulary.fromValues([elem.someFunc() for elem in
context.values()]))
I noticed that elem in context.values() are not proxied yet, so the
actual wrapping must take place before the values are passed to the ZMI.
How does calling the removeSecurityProxy function prevent the objects
from being wrapped, since the wrapping takes place AFTER the function call?
(I had a look at the sources, but the implementation resides in
zope.security._proxy which is a binary .so file)


2.
The vocabularies are registered as utilities in the .zcml file(s).
Since access to objects from these vocabularies is not checked by a
security proxy: Is it therefore possible that any user can access the
vocabulary data?
If so, is there a way to restrict access to the utility vocabularies?

Regards,
Michael
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1iWlAACgkQnzX+Jf4GTUxO2gCeIoKh8l+6QaGsDo07WKUT2Y94
BDQAn16rtkPVIIPo5N8a2K7A/SsOdoQU
=dHUQ
-END PGP SIGNATURE-
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Referencing objects

2011-02-04 Thread Michael Seifert
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello everyone,

I recently started a Zope3 project, but I am stuck at the very
beginning. Although I have some experience with Zope2, the more flexible
approach to developing web applications was giving me a really hard
start. Let me point out my situation:
I created a container hierarchy which is stored in ZODB. Say I have a
set of object types A, B, C, D, whose relationships look like the
following (edges represent containment, i.e. A contains B,... where B
and D are in subcontainers of A):

A
   / \
  B   D
  |
  C

C has an attribute referencing an object of type D. As this attribute is
mandatory on creation, I created a vocabulary, which ascends the
hierarchy from the current context until it reaches A and returns all
objects of type D.
Now the part that doesn't work:
While ascending from C to B and from B to A works fine, descending from
A to D returns a security proxied object and since these objects cannot
be pickled, I cannot store it's reference in the attribute of C.

1. Is this the way it's meant to be done? :) What is your opinion of
storing B and D objects in subcontainers of A?
2. Are there any means to turn the vocabulary into trusted code, so it
will not be encapsulated in a proxy (without deactivating the security
proxy)?
3. How do you reference objects like you do with foreign keys in
relational databases? I want to do this to prevent objects from being
saved multiple times.


Thanks in advance and best regards
Michael
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1MD0wACgkQnzX+Jf4GTUx3BQCggto6AFnXLiyl6JRaYY634KXG
0SAAoKm+/jug8BNYhpZaOa6weroZmsg+
=IQ4T
-END PGP SIGNATURE-
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Zope3-users Digest, Vol 71, Issue 6

2010-10-22 Thread Michael Howitz
Am 22.10.2010 um 13:47 schrieb david ally:
 Hi All,
 
 Eventually, I was able to build the project, however, because of the speed of 
 my Internet link, it was constantly timing out, but fortunately, when i 
 restarted the build operation, it continued from where it stopped.
 
 It got to a point where the build was still going but it gave this errors and 
 continued the build operation. Please find below;
 
 Got zope.tal 3.5.2.
 Getting distribution for 'RestrictedPython==3.6.0'.
 SyntaxError: ('invalid syntax', 
 ('build/bdist.linux-i686/egg/RestrictedPython/tests/before_and_after27.py', 
 30, 17, 'x = {y: y for y in whatever if y}\n'))
 
 SyntaxError: ('invalid syntax', 
 ('build/bdist.linux-i686/egg/RestrictedPython/tests/security_in_syntax27.py', 
 6, 13, '{y: y for _restricted_name in x}\n'))
 
 SyntaxError: ('invalid syntax', 
 ('/home/david/sampleproject/eggs/tmpwTJ7tk/RestrictedPython-3.6.0-py2.6.egg/RestrictedPython/tests/before_and_after27.py',
  30, 17, 'x = {y: y for y in whatever if y}\n'))
 
 SyntaxError: ('invalid syntax', 
 ('/home/david/sampleproject/eggs/tmpwTJ7tk/RestrictedPython-3.6.0-py2.6.egg/RestrictedPython/tests/security_in_syntax27.py',
  6, 13, '{y: y for _restricted_name in x}\n'))

These errors only occur because there are tests for Python 2.7 syntax 
constructs which are not yet exising in the Python 2.6 you used. You can safely 
ignore this errors.

Mit freundlichen Grüßen
-- 
Michael Howitz · m...@gocept.com · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


Re: [Zope3-Users] Question about z3c:layout

2009-07-15 Thread Michael Howitz
Am 15.07.2009 um 16:10 schrieb Simon Elbaz:
 Hi,
 the question I have is:
 when a z3c.form is rendered, how can I tell to zope3 to use  
 z3c.pagelet.browser.BrowserPagelet.__call__ and not  
 z3c.form.form.Form.__call__ in order to use the layout defined by a  
 global z3c:layout in zcml ?

Did you look at z3c.formui.form.Form? This is the pagelet integration  
package for z3c.form.

Yours sincerely,
-- 
Michael Howitz · m...@gocept.com · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


Re: [Zope3-Users] z3c.form in the apidoc code browser

2009-05-18 Thread Michael Howitz
Am 18.05.2009 um 17:05 schrieb John:
 thanks michael.  i did as you suggested, but buildout said:
[snipped some error messages]

 i dont really need to see z3c in apidoc, but if my general approach  
 of adding versions to resolve conflicts is wrong, i'd like to know  
 what i should do instead.

There where several new versions of the zope packages which are not  
backwards compatible. Your approach is correct there are way too many  
new versions.
If you did this:

 After running bin/zopeproject, edit proj/buildout.cfg, comment out  
 the following line:
  extends = http://download.zope.org/zope3.4/3.4.0/versions.cfg

Then this is wrong:

 Run bin/buildout to install the new packages.


You should run:

bin/buildout -n

to get all the new packages. Sorry, my fault.


Yours sincerely,
-- 
Michael Howitz · m...@gocept.com · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


Re: [Zope3-Users] Module zope has no global viewlet

2009-04-14 Thread Michael Howitz

Am 12.04.2009 um 12:56 schrieb Chetan Kumar:

 Hi all
 I am using  virtualenv and zopeproject with the following output [1].
 This is attached for reference and I am not sure if this output should
 bother me at this stage.

 As, I would like to use viewlet managers and viewlets, following
 http://apidoc.zope.org/++apidoc++/Book/viewlet/directives/show.html I
 tried this [2].

 The pristine buildout.cfg [3] is attached for reference in case that  
 is useful.

 Hope I have been able to express my situation and requirement  
 clearly enough.

 I wish to find out my mistake, correct it and move on.

Did you declare zope.viewlet as an install requirement in the setup.py  
of your project? Maybe zopeproject does not do this automatically.

Yours sincerely,
-- 
Michael Howitz · m...@gocept.com · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


Re: [Zope3-Users] Module zope has no global viewlet

2009-04-14 Thread Michael Howitz
Am 14.04.2009 um 10:14 schrieb Chetan Kumar:
[...]
 I would happily declare this if that is the way to go.
 My expectation (however misinformed/inaccurate/stupid) has been that
 when I use zopeproject all will be well.
 zope.viewlet is present in the KGS listing of packages but does not
 appear in the bin/paster and other scripts.

KGS only defines the versions of packages which can be used together.  
This does not mean that all these packages get installed.
To use one package (aka install it) you have to declare it as install  
dependency in setup.py.

Yours sincerely,
-- 
Michael Howitz · m...@gocept.com · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


Re: [Zope3-Users] Best way to represent a foreign key in ZODB

2009-03-04 Thread Michael Howitz

Am 03.03.2009 um 21:53 schrieb Massimiliano della Rovere:
What is the best way to represent a foreign key? a  
persistent.wref? an intid number?


Suppose I have a persistent class representing an art object author  
(A) and another persistent class representing an art object (B).


If I want to create links from one instance of one A to instances of  
class B (and vice versa) what do you recommend me?



It would be great having the possibility of referring attributes and  
methods of the object:
is w is a reference to an instance of A, w.name and w.surname for  
example...


You might have a look at http://pypi.python.org/pypi/gocept.reference

Yours sincerely,
--
Michael Howitz · m...@gocept.com · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


Re: [Zope3-Users] Best way to represent a foreign key in ZODB

2009-03-04 Thread Michael Howitz
Am 04.03.2009 um 14:09 schrieb Massimiliano della Rovere:
 I have problems installing the package (I never did it before,  
 probably i do something wrong).
 I downloaded the package, decompressed it and run:
 sudo python setup.py build
   - ok
 sudo python setup.py install
   - error

You should use buildout to install dependencies for your application.  
As you already use Zope, there should be already a ZODB, so it needs  
not to be built at install of gocept.reference.

See http://pypi.python.org/pypi/zc.buildout or maybe
http://redomino.com/it/labs/documentazione/tutorial/gestire-progetti-con-zc-buildout/

 When installing, it tries to download an updated package about ZODB  
 but then it fails compiling it:

 python2.4 setup.py build
[...]
 src/BTrees/BTreeModuleTemplate.c:15:20: error: Python.h: Nessun file  
 o directory

Google finds this: 
http://www.mail-archive.com/plone...@lists.plone.org/msg02411.html 
  (sounds a bit similar especially because I do not understand  
Italian :)


Yours sincerely,
-- 
Michael Howitz · m...@gocept.com · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


Re: [Zope3-Users] Why does schema validation not work in this example?

2009-01-18 Thread Michael Howitz
Am 18.01.2009 um 09:26 schrieb Sebastian Bartos:
 Hello folks,
 I just played around with the validation of the schemata and created  
 the
 example listed below. According to the book by Philip it should rase a
 validation exception at the end. That's what the FieldProperty is
 supposed to do, but it does not do it here. (Tested in the zope debug
 console) Why?

 from zope.interface import Interface, implements
 from zope.schema import Int
 from zope.schema.fieldproperty import FieldProperty

 class ITest(Interface):
number = Int( title = u'A number' )

 class test(object):
implements(ITest)
number = FieldProperty(ITest['number'])

 test_class = test()
 print test.number  # get zope.schema.fieldproperty.FieldProperty  
 object at 0x27537d0

 test.number = 20  # this is ok

This overwrites the field property, as 'test' is your class, you  
called the instance 'test_class'.

test_class.number = 'asdf' results in the exception you expect.

Yours sincerely,
-- 
Michael Howitz · m...@gocept.com · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


[Zope3-Users] z3c.menu.ready2go release request

2008-12-13 Thread Michael Howitz
Hi,

some weeks ago a bug in z3c.menu.ready2go was fixed but there was no  
new release since then.
I'd like to use this bug-fixed version as the bug has also bitten me,  
so I'd like to request a new release of the package.

Thanks in advance.

Yours sincerely,
-- 
Michael Howitz · m...@gocept.com · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


Re: [Zope3-Users] Windows Vista, Buildout python-cjson

2008-09-19 Thread Michael Howitz
Am 18.09.2008 um 12:20 schrieb Tim Cook:
[...]
 First of all I do not know what is causing python-cjson to be loaded  
 as
 a dependency.  Maybe we can eliminate it for now.  Any guesses?


You can run bin/buildout with -vv as option to see which package  
requires python-cjson.


Yours sincerely,
-- 
Michael Howitz · [EMAIL PROTECTED] · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


[Zope3-Users] z3c.menu vs. z3c.menu.simple

2008-09-17 Thread Michael Howitz
Hi,

there are two z3c.menu packages on pypi:
z3c.menu and z3c.menu.simple

They mostly differ in the change log (the rest of the long description  
is quite the same).
Which one should be used?
Why is the other not marked as deprecated? Or are both packages still  
actively developed/supported?


Yours sincerely,
-- 
Michael Howitz · [EMAIL PROTECTED] · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


Re: [Zope3-Users] zc.async in Zope2/Plone

2008-09-11 Thread Michael Dunstan
On Fri, Sep 12, 2008 at 5:02 AM, Santiago Videla
[EMAIL PROTECTED] wrote:
 Hi guys,


 z3c.recipe.fakezope2eggs lets you tame these kind of dependencies. See
 http://pypi.python.org/pypi/z3c.recipe.fakezope2eggs

 plone.recipe.zope2install includes a couple of options for making use
 of that too. See http://pypi.python.org/pypi/plone.recipe.zope2install


 Nice, I will try those.

 But I have another issue... :(
 I need to use repoze.plone and I don't have any zope2 section in my
 buildout.cfg (needed to use fakezope2eggs). I need to find a way to tell to
 fakezope2eggs where is the python/lib/zope directory

I think you should be able to do that by declaring a zope2-location
for the z3c.recipe.fakezope2eggs part.

[fakezope2eggs]
recipe = z3c.recipe.fakezope2eggs
zope2-location = ...

where ... points to your python directory of python/lib/zope

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


Re: [Zope3-Users] zc.async in Zope2/Plone

2008-09-10 Thread Michael Dunstan
On Thu, Sep 11, 2008 at 6:55 AM, Santiago Videla
[EMAIL PROTECTED] wrote:

 * How can I solve this problem?? There is any way to say in the
 buildout.cfg: Ignore the zope.testing package
I guess that I won't be able to run the tests for zc.async, but I can
 live with that...

z3c.recipe.fakezope2eggs lets you tame these kind of dependencies. See
http://pypi.python.org/pypi/z3c.recipe.fakezope2eggs

plone.recipe.zope2install includes a couple of options for making use
of that too. See http://pypi.python.org/pypi/plone.recipe.zope2install

It would be great to have an example buildout of a Zope2 instance
configured with zc.async.

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


[Zope3-Users] New release of zc.recipe.egg needed

2008-05-28 Thread Michael Howitz

Hello,

some month ago Christian Zagrodnick added the environment option to  
zc.recipe.egg. The change is on the trunk but there was no release  
made since then.
For a customer project it would be nice to have this feature in an egg  
on pypi.


Anyone (who has write access on pypi for this package) here to  
volunteer for a release?



Yours sincerely,
--
Michael Howitz · [EMAIL PROTECTED] · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


Re: [Zope3-Users] How do I find out references to objects in ZODB

2008-05-13 Thread Michael Howitz

Am 02.05.2008 um 16:17 schrieb Yuan HOng:


Hi,

Is it possible to find out what other objects are referencing a
particular object in ZODB?

In particular, I want to prevent some content objects, like images,
from being removed from the folder if they are used in some other
content object, like a news article.

Do I have to keep track of object referencing in ZODB myself through
events or there are some built-in mechanism in ZODB to take care of
this for me?



Hi,

maybe gocept.reference[1] can help you.


[1] http://pypi.python.org/pypi/gocept.reference/0.2

--
Yours sincerely,
Michael Howitz

gocept gmbh  co. kg · forsterstrasse 29 · 06112 halle/saale
www.gocept.com · fon: +49 345 12298898 · fax: +49 345 12298891

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


RE: [Zope3-Users] z3c-form meta.zcml error

2008-01-24 Thread Gross,Thomas Michael
Hi all,

  I'm using setuptools-0.6c7-py2.4.egg on a Mac OS X 10.5.1 and I have the same 
issue with zope.viewlet 3.4.1.

-Tom

From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Roger Ineichen [EMAIL 
PROTECTED]
Sent: Thursday, January 24, 2008 10:02 AM
To: [EMAIL PROTECTED]; zope3-users@zope.org
Cc: 'Philipp von Weitershausen'; 'Martijn Pieters'
Subject: AW: [Zope3-Users] z3c-form meta.zcml error

Hi all

 Cc: Philipp von Weitershausen; Martijn Pieters
 Betreff: Re: [Zope3-Users] z3c-form meta.zcml error

[...]

  Btw, Windows users can generate standard tarballs using the
 --formats
  switch:

 Yep, that worked. Roger forgot those options. I am going to
 release real tarballs today.

No I defently didn't forgot this option. I released 1.7.1
as tar.gz with the option --format=gztar and 1.7.2 as zip
because of the report form malthe that the egg misses the
zcml file.

All the *.zcml files where in every release included.

I think that's a setuptools issue, The files do not get
extracted, that's it. I have no idea if this only happens
because the computer which extracts the eggs does not have
the newest setuptools installed.

I used the newest version of setuptools whihc is available
e.g. version: setuptools-0.6c7-py2.4.egg. If this is a
issue on build eggs, then it's defently not fixed.

Many thanks Stephan

Regards
Roger Ineichen

 Regards,
 Stephan

___
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] XMLRPC Method with **kwargs

2007-12-13 Thread Michael Howitz

Am 14.12.2007 um 01:29 schrieb Jeremy Roberts:

Hello zope3 users!

I'm using Zope-3.3.1, and I'm trying to expose a method via xmlrpc  
and I'm having trouble supporting a variable number of kwargs. My  
use case does not know ahead of time how many arguments will be  
passed to the method, hence the use of **kwargs in the method  
signature.


I get the error:
Unexpected Zope exception: TypeError: renderCode() takes at most 1  
argument (2 given).



Hi!

I think this is because XML-RPC does not support (optional) keyword  
arguments, you only may use positional arguments. A solution for  
optional arguments can be a dictionary containing the optional  
arguments for your XML-RPC-View as the last parameter. But this  
parameter is not optional itself.


So your view could look like:

class ToolCodeXMLRPC(MethodPublisher):
   An XMLRPC view for ToolCode objects.

   def renderCode(self, data):
   return self.context.renderCode(**data)


--
Yours sincerely,
Michael Howitz

gocept gmbh  co. kg · forsterstrasse 29 · 06112 halle/saale
www.gocept.com · fon: +49 345 12298898 · fax: +49 345 12298891

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


[Zope3-Users] zope.app.broken subscriber

2007-11-06 Thread Michael Dove
Hi,

I'm in the process of evolving a DB and have come across an issue where
the zope.app.broken classFactory isn't being used, hence broken objects
come back as Pc
PersistentBroken rather than zope.app.broken.Broken.

The installBroken handler takes care of the logistics in monkey patching
the ZODB.DB object's classFactory function when an IDatabaseOpened event
is emitted, however a reference to the original ZODB.DB.classFactory is
held by the ObjectReader created by the ZODB.Connection object when
zope.app.appsetup.bootstrap.bootStrapSubscriber is called upon a
IDatabaseOpened event.

The problem is that zope.app.zcmlfiles includes zope.app.appsetup before
zope.app.broken and so when an IDatabaseOpened event is emitted a
reference to original classFactory is held by the ObjectReader before
the DB.classFactory can be patched with the zope.app.broken classFactory.

Of course modifying zope.app.zcmlfiles.configure.zcml to include
zope.app.broken before zope.app.appsetup fixes the problem.

Seems odd for this to been an oversight so thus the question, I doing
something wrong here?

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


[Zope3-Users] zopeproject auto create instance

2007-09-28 Thread Michael Ang
Hi, I am new to zope3 and zopeproject.
I have a question, how do I create an instance of my (IContainer) class
when initial startup of a zopeproject?

For Plone, I can inject in Extensions/Install.py.

Hope you understand my question, thanks.

:]Michael


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


[Zope3-Users] Re: Grok or raw Zope?

2007-09-28 Thread Michael Ang
You mention

need a bug tracking system, a support platform for our customers, a
knowledge base for our employees and customers, an many other
applications...

very CMS to me.

:]Michael



Matias Surdi wrote:
 We Don't want a CMS. We need a framework to build an application which can
 grow with us, and be adapted to our needs, needs that are very likely to
 change over time.
 
 Thanks for your comments.
 
 
 Michael Ang wrote:
 
 Use Plone, best for Intranet.

 Matias Emanuel Surdi wrote:
 
 I've posted this same message on grok-devel mailing list.
 I'm just looking for comments from the other side
 Thanks a lot in advance.
 

 Hi,
 I'm going to start a new project in a few weeks and I'm evaluating
 possible frameworks to use.
 My best candidate at the momment is Zope 3, since I have a couple of
 years of experience with Python and Zope 3 provides most things I will
 need (such as authentication, templates, database access, workflows,
 etc..).

 We are going to build an intranet portal, where each department of the
 company (a software development one)  has it's own area, and the
 application should provide applications for the needs of everyone, we
 need a bug tracking system, a support platform for our customers, a
 knowledge base for our employees and customers, an many other
 applications...


 So, I've no experience with Zope nor Grok.
 I would like to receive some advice about choosing Grok or Zope. I think
 Grok is more easy to start with, but... ¿will it in the future put any
 limit on a very big intranet application for an entire company?

 Thanks for your comments.

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


[Zope3-Users] Re: Grok or raw Zope?

2007-09-27 Thread Michael Ang
Use Plone, best for Intranet.

Matias Emanuel Surdi wrote:
 
 I've posted this same message on grok-devel mailing list.
 I'm just looking for comments from the other side 
 Thanks a lot in advance.
 
 
 Hi,
 I'm going to start a new project in a few weeks and I'm evaluating possible
 frameworks to use.
 My best candidate at the momment is Zope 3, since I have a couple of years
 of experience with Python and Zope 3 provides most things I will need (such
 as authentication, templates, database access, workflows, etc..).
 
 We are going to build an intranet portal, where each department of the
 company (a software development one)  has it's own area, and the
 application should provide applications for the needs of everyone, we need
 a bug tracking system, a support platform for our customers, a knowledge
 base for our employees and customers, an many other applications...
 
 
 So, I've no experience with Zope nor Grok.
 I would like to receive some advice about choosing Grok or Zope. I think
 Grok is more easy to start with, but... ¿will it in the future put any
 limit on a very big intranet application for an entire company?
 
 Thanks for your comments.

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


Re: [Zope3-Users] how to use invariant/validator? (z3c.form=1.6 and z3c.formui=1.3)

2007-09-21 Thread Michael Howitz


Am 19.09.2007 um 12:49 schrieb [EMAIL PROTECTED]:


Hi,

I want to use an invariant-check in an analogous manner like it is  
described at the end of the message.
There is answered that the bug is fixed, but the same causes are  
still active.

I'm using z3c.form=1.6 and z3c.formui=1.3
What seems to be the trouble now?

my code:
class IAddressSearch(zope.interface.Interface):
...
@zope.interface.invariant
def firstnameOrSurname( search ):
#import pdb; pdb.set_trace()
if search.firstname == None:
search.firstname = u''
if search.surname == None:
search.surname = u''
if len(search.firstname) == 0 and len(search.surname) == 0:
raise zope.interface.Invalid( uEnter firstname and/ 
or surname.)



result of my Code:
TypeError: tuple indices must be integers


Hi, can you please include a complete traceback to see where the  
exception occurres?


--
Yours sincerely,
Michael Howitz

gocept gmbh  co. kg · forsterstrasse 29 · 06112 halle/saale
www.gocept.com · fon: +49 345 12298898 · fax: +49 345 12298891


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


Re: [Zope3-Users] Problem with z3c.form security when rendering error

2007-09-20 Thread Michael Kerrin
Hi Yuan,

I think I am having the same problem, as in all the errors look the same. I 
have just committed a fix for my problem so hopefully it is the same problem.

I did like you said added the widget to the interface and declared that all 
the widgets require the zope.Public permission to access the attribute.

Michael

On Thursday 20 September 2007 17:17:05 Yuan HOng wrote:
 HI, list:

 I am new to z3c.form. In my first AddForm, I encountered the following
 problem:

 When the form is submitted which contains some input error, like
 missing required fields, the rendering of the error message causes an
 system error. The traceback:

 ...
   File
 /usr/lib/python2.5/site-packages/zope.app.pagetemplate-3.4.0b1dev_r75616-p
y2.5.egg/zope/app/pagetemplate/engine.py, line 68, in __call__
 request=request)
   File
 /usr/lib/python2.5/site-packages/zope.traversing-3.5.0a1.dev_r78730-py2.5.
egg/zope/traversing/adapters.py, line 164, in traversePathElement
 return traversable.traverse(nm, further_path)
- __traceback_info__: (ErrorViewSnippet for RequiredMissing, 'widget')
   File
 /usr/lib/python2.5/site-packages/zope.traversing-3.5.0a1.dev_r78730-py2.5.
egg/zope/traversing/adapters.py, line 52, in traverse
 raise TraversalError(subject, name)
- __traceback_info__: (ErrorViewSnippet for RequiredMissing, 'widget',
 []) TraversalError: (ErrorViewSnippet for RequiredMissing, 'widget')

 After a little debugging, I was able to find that the chain leading to
 the error is as follows:

 1. div-form.pt in the z3c.formui package contains the following error
 presentation:

   li tal:repeat=error view/widgets/errors
 tal:block condition=error/widget
   span tal:replace=error/widget/label /:
 /tal:block
 span tal:replace=structure error/renderError Type/span
   /li

 error/widget is accessed here, with error being an ErrorViewSnippet object.

 2. The ErrorViewSnipped is created in field.py using:

   view = zope.component.getMultiAdapter(
   (error, self.request, widget, widget.field,
self.form, self.content), interfaces.IErrorViewSnippet)

 As in my application, self.content is a custom ISite folder, which is
 security proxied, the getMultiAdapter method returns a security
 proxied ErrorViewSnippet object.

 3. Access to ErrorViewSnippet is defined in z3c.form/configure.zcml as:

   adapter
   factory=.error.ErrorViewSnippet
   trusted=True
   permission=zope.Public
   /

 The IErrorViewSnippet interface contains only 3 attributes: error,
 update, render. Those are accessible to everyone. But there is no
 security declaration for the 'widget' attribute, so access to it is
 denied:

 (Pdb) snippet
 ErrorViewSnippet for RequiredMissing
 (Pdb) type(snippet)
 type 'zope.security._proxy._Proxy'
 (Pdb) from zope.security.proxy import getChecker
 (Pdb) getChecker(snippet).get_permissions
 {'update': Global(CheckerPublic,zope.security.checker), 'render':
 Global(CheckerPublic,zope.security.checker), 'error':
 Global(CheckerPublic,zope.security.checker)}
 (Pdb) from zope.security import canAccess
 (Pdb) canAccess(snippet, 'widget')
 *** ForbiddenAttribute: ('widget', ErrorViewSnippet for RequiredMissing)

 So it seems the default z3c.form security declaration only allows
 access to 'update', 'error' and 'render' attributes of an
 ErrorViewSnippet object. I tried to work this around the by adding the
 'widget' attribute to the IErrorViewSnippet interface and the system
 error is no longer raised. However, this time, another exception is
 raised saying the 'label' property of the widget is not accessible.

 How can I setup my security properly to use z3c.form smoothly?
 Shouldn't 'widget'  not be in IErrorViewSnippet since it is evidently
 externally used in the rendering template?

 Thanks for suggestions.


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


[Zope3-Users] Re: Announcing zopeproject 0.4

2007-09-17 Thread Michael Haubenwallner

Philipp von Weitershausen schrieb:

zopeproject makes it easy to get started with a web application based on
Zope eggs, zc.buildout and WSGI/Paste. If you're not familiar with this
world yet, zopeproject is your easy entry to it. If you are, zopeproject
will save you lots of typing up the boilerplate.


Thank you for developing zopeproject, this is very useful.


With zopeproject's approach, *your code* is the application. The web
application, to be precise. And it *happens* to use Zope. As a library::

  ++   +-+  +-+
  |WSGI gateway|  serves   |  your code  |   uses   |  Zope   |
  |  (server)  |  --  |(application)|     |libraries|
  ++   +-+  +-+



Now for that part - one of my use cases would be to allow XML-RPC access 
only throughout the app. How would you setup the application with and 
without security support, disabling all other protocols defined in the 
publisher and the ZMI altogether ?


Michael

--
http://www.zope.org/Members/d2m
http:/planetzope.org

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


Re: [Zope3-Users] Re: Invariants and forms

2007-08-15 Thread Michael Howitz


Am 14.08.2007 um 12:13 schrieb Nylan:


The standard error message is:
There were errors

I'll try your solution, but I would prefer getting the invariants  
to work, like

mentioned in the examples.

They seem to work with zope 3.2(example 1) and zope 3.4 (example 2)


That's what the german description of the examples says.

--
Yours sincerely,
Michael Howitz

gocept gmbh  co. kg · forsterstrasse 29 · 06112 halle/saale
www.gocept.com · fon: +49 345 12298898 · fax: +49 345 12298891


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


[Zope3-Users] How i can get IRequest

2007-04-17 Thread Garanin Michael

Hello!
How i can get IRequest in my event handler (i has only context)?
Thanks!
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] OOBTree instances lose attributes upon restart

2007-04-06 Thread Garanin Michael

Douglas Douglas wrote:

Hi everyone.

I've been fighting with this for a while now. So I mail the list for a
suggestion.

I have a `Variable` class wich I subclass from OOBTree, because I need a
dictionary with the min, max options that OOBTree methods give. My object is
supposed to store datetime.datetime instances as keys and floats numbers as
values. eg: temperature[datetime(2007, 4, 6, 12, 8)] = 25.8

I didn't use BTreeContainer because only takes strings as keys, and I don't
want to map datetime to strings and back.

Here's my class definition:

class Variable(OOBTree, Contained):

implements(IVariable, IAttributeAnnotatable)

name = None
units = None

  

class Variable(Persistent, Contained):
 def __init__(self):
self.__mydata = OOBTree()
   
def keys(self, min, max ):

   return self.__mydata.keys(min, max, )


For example see implementations in  zope/app/container/sample.py
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: Where do people put Zope 3 components that they wish to share?

2007-03-19 Thread Michael Haubenwallner

Mark, Jonathan (Integic) schrieb:

Zope.org has a link for Products but not for Components.

Is there someplace where people can see what third-party Zope3 components are 
available?



Here is a (growing) collection of a zope3 repository links

http://del.icio.us/d2m/repository+zope3

Hth,
Michael

--
http://www.zope.org/Members/d2m
http:/planetzope.org

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


Re: [Zope3-Users] imports cleanup

2007-03-15 Thread Michael Howitz

Am 15.03.2007 um 01:52 schrieb Christophe Combelles:
[...]
Is there a tool or a method to automatically clean or detect unused  
imports ?


In your Zope3-Instance there should be a python script called  
importchecker which can detect unused imports.


hth, mac


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


Re: [Zope3-Users] Design question (object or interface for category implementation?)

2007-03-09 Thread Garanin Michael

Christophe Combelles wrote:

Christophe Combelles a écrit :

Hi,

I'm playing again with the notion of categories of objects.

I have two main goals:
-
1) I must let the user choose the category of an object added to the 
zodb. For this, I must be able to retrieve the list of categories and 
present them in a form field managed by a vocabulary (or in a 
different manner).

2) I must have different behaviours for categorized objects:
objects of different categories would have different views, different 
addMenuItems (if they are containers), etc.


the first requirement would tell me to define categories as objects, 
while the second one would tell me to define them as interfaces.


The possible solutions I see:


1) The simplest solution is to store the categories as text strings 
into the annotations of the object. So categories actually are just 
tags.


2) The second solution is to do the same, but replace text strings 
with category objects, that implement ICategory. And categories can 
be stored separately in a category container, or in a registered 
utility that gives the list of available categories. This is a bit 
better, but this way I don't know how to easily let my categorized 
objects behave differently according to their categories.


3) The third solution is to define categories as interfaces extending 
ICategory. I can retrieve the list of categories with 
ICategory.dependents
But to present them in a form, I must have a pretty name for each 
interface. Should I store them in a Tagged Value?


4) The fourth solution I see, is to define an interface type, 
ICategoryType, extending IInterface just like IContentType. Then my 
categories would be interfaces whose type is ICategoryType. But with 
IContentType, is there a way to retrieve the list of all available 
content types?


I've finally mixed 3) and 4) :

I have defined ICompany(Interface), IClient(ICompany), 
IProvider(ICompany)

And I have an ICompanyType(IInterface) interface type
I've set the type of IClient and IProvider as ICompanyType in zcml.

ICompany has a types attribute, for which I've redefined __getattr__ 
and __setattr_:

__getattr__ retrieve the ICompanyType interfaces from the object
__setattr__ calls noLongerProvides then alsoProvides to change the 
interfaces.
I think that it's not work: alsoProvides and directlyProvides change 
interfaces only in memory, it's not persistent changes (after restart 
Zope yours object will be only basic interface) .

(sorry my honor english).





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


Re: [Zope3-Users] Design question (object or interface for category implementation?)

2007-03-07 Thread Garanin Michael

Christophe Combelles wrote:

.
I want to define objects that represent Companies.
A company can be either a client, or a provider, or both,
or in the future it could be of another type.

When the user creates a company, it must choose client, provider, 
or both.

The choice would assign a different interface to the object:
IClient, or IProvider, and this would lead to different views for 
these objects.


So client and provider are categories of companies.

So I would tend to have:

class ICompany(Interface)

class IClient(ICompany)

class IProvider(ICompany)

This is simple, but now how do I assign a name to these interface, so 
that the user will choose between Client and Provider, and not 
between IClient and IProvider?
Is it feasible with Tagged Value ?  Or with the name attribute in 
the zope:interface ZCML declaration?

simple way:
1) in interfaces.py:
class IMyApplicationSite(Interface):
   pass
class ICompany(Interface):
   pass

class IClientMarker(Interface):
   pass
class IProviderMarker(Interface):
   pass


2): in model.py
class MyApplicationSite(Folder):
def get(self, key, default):
 obj = Folder.get(key, default)
 if ICompany.providedBy(obj):
if 'client' in obj.tags:
directlyProvide(IClientMarker, obj)
elif 'provider' in obj.tags:
directlyProvide(IProviderMarker, obj)
  return obj

class BaseCompany(Persistent):
   implements(ICompany)
tags = client provider  # or provider


3) in configure.zcml
 view
 for=.interfaces.IMyApplicationSite
 type=zope.publisher.interfaces.browser.IBrowserRequest
 provides=zope.publisher.interfaces.browser.IBrowserPublisher
 factory=zope.app.container.traversal.ContainerTraverser
 permission=zope.View
 
allowed_interface=zope.publisher.interfaces.browser.IBrowserPublisher

 /















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


Re: [Zope3-Users] Zope3 with RDBMS (avoiding ZODB)?

2007-02-28 Thread Garanin Michael

Stefan Krumbiegel (Galileo Press) wrote:


3.3 Also there is 'zsqlmap: Zope3 wrapper for SQLObject'
(http://www.zope.org/Members/garanin/zsqlmap). This is not really a
solution for us because the version number is 0.01b and the author says:
'NOTE: i tested only postgres.' Not really a capable product...


i use (but not publish in zope.org) new branch of zsqlmap .
Now zsqlmap is NOT wrapper for SQLObject, it's simple orm (but only for 
zope3 (use Z3 specific)).

Now i tested postgresql and mssql.
https://code.keysolutions.ru/trac/zsqlmap/browser/branches/orm
(or see attach)

my applications not big (i make intrAnet applications for  50 users) 
and i don't know about perfomance problem for big requests.




zsqlmap.tar.gz
Description: application/gzip
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] default page based on roles?

2007-02-28 Thread Garanin Michael

Shailesh Kumar wrote:

Hi,
 
Is it possible to control the default page for a particular object 
based on the roles/permissions that a user has?
 
The browser:defaultPage directive as such doesn't support this.
 
Will I have to write a custom traverser or something like that for this?
 
Thanx in advance.
 
With regards,

-Shailesh
 



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

i think it's not task for zcml.
simple solutions:

class MyIndexView:
   def __call__(self):
  if self.request.principal.id == 'zope.Manager':
   self.request.responce.redirect('page1.html')
   elif:
 self.request.responce.redirect('page2.html')
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] configure access from zcml

2007-02-21 Thread Michael Haubenwallner

The publication requestfactories are available by default.
Is there a way to configure protocol access to the whole site, local 
sites, containers or objects through ZCML ?


How would a sysadmin e.g. enable xmlrpc access to the site or a folder 
only or disable xmlrpc access to a certain object or interface ?


Michael

--
http://zope.org/Members/d2m
http://planetzope.org

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


Re: [Zope3-Users] Re: IContainer as IReadFile in WebDav

2007-02-19 Thread Michael Kerrin
Hi Alek,

Which webdav component are you using. zope.app.dav or zope.webdav?

On Monday 19 February 2007 12:12, Alek Kowalczyk wrote:
  adapter for=.interfaces.plot.IPlot
   provides=zope.filerepresentation.interfaces.IReadFile
   factory=.csv.PlotAsCsvFile permission=zope.Public /

 One small mistake (just here, in my real code it was OK).
 Of course the adapter provides IReadFile, no IReadDirectory).
 I still can't make this to get CSV files instead of folder on WebDAV.
WebDAV doesn't use a IReadFile adapter to access files. WebDAV is just an 
extension to HTTP so you must define the default view for your IPlot object 
to return your CSV file.

In order to tell Excel (I am going to assume this works with Excel but I know 
it works with OpenOffice and other WebDAV clients but I haven't tried it with 
Excel) that your IPlot objects are files - you need to override the 
DAV:resourcetype property and specify a None value for this property. The 
only other WebDAV properties that I think you may also need to change are the 
DAV:getcontenttype and DAV:getcontentlength to their respective values for 
the CSV file.

With zope.webdav it is as easy as writing a multi adapter from (IPlot, 
IHTTPRequest) - zope.webdav.coreproperties.IDAVResourceType to override the 
DAV:resourcetype propertry and for DAV:getcontenttype you write an adapter 
from (IPlot, IHTTPrequest) - zope.webdav.coreproperties.IDAVGetcontenttype.

Hope this helps
Michael

-- 
Michael Kerrin

55 Fitzwilliam Sq.,
Dublin 2.

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


[Zope3-Users] Empty ZCML file

2007-01-15 Thread Michael Bernstein
As I experiment with Zope3 skins, I frequently have various
*-overrides.zcml files I am using to switch the default skin. I tried
today to comment out the only directive I had in one file (ie. like so:
!-- include package=foo file=overrides.zcml /-- ), and this caused
an error.

So, it looks like Zope does not like content-free ZCML files. Bug or
Feature?

Having to move the file isn't a problem, exactly, but it is annoying.

- Michael R. Bernstein
  michaelbernstein.com

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


Re: [Zope3-Users] Re: Empty ZCML file

2007-01-15 Thread Michael Bernstein
On Mon, 2007-01-15 at 22:31 +, Martin Aspeli wrote:
 Michael Bernstein wrote:
  As I experiment with Zope3 skins, I frequently have various
  *-overrides.zcml files I am using to switch the default skin. I tried
  today to comment out the only directive I had in one file (ie. like so:
  !-- include package=foo file=overrides.zcml /-- ), and this caused
  an error.
  
  So, it looks like Zope does not like content-free ZCML files. Bug or
  Feature?
  
  Having to move the file isn't a problem, exactly, but it is annoying.
 
 You should always have the configure .. /configure directive; you 
 can comment out what's in-between.

Ah, OK. Thanks!

I've seen plenty of examples of bare include directives (and they
obviously work). Aside from the issue I had, is this not considered a
good practice?

- Michael R. Bernstein
  michaelbernstein.com

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


Re: [Zope3-Users] traceback on startup from a wsgi server

2007-01-08 Thread Michael Haubenwallner

Stephan Richter wrote:

On Saturday 11 November 2006 07:11, Michael Haubenwallner wrote:

Do you see a way to solve the problem except from commenting the directive
?


Does the problem still occur? I have never seen this issue.



Yes, still reproducable (it has always been the Import error): new 
checkout from trunk, distinct python2.4.4 install from source.


Traceback looks like so:
-
/home/user/Zope3/src/zope/configuration/config.py:690: 
DeprecationWarning: Change the site.zcml Replace: include 
package=zope.app / with: include package=zope.app.zcmlfiles / 
This will go away in Zope 3.6.

  actions = self.handler(context, **args)
Test-module import failures:

Module: zope.testbrowser.tests

Traceback (most recent call last):
  File /home/user/Zope3/src/zope/testbrowser/tests.py, line 27, in ?
from zope.testbrowser import browser
ImportError: cannot import name browser


Running unit tests:
...
-

Hth, do you need the wsgi startup files and setup ?

Michael

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


Re: [Zope3-Users] Registered utility is never found

2006-12-13 Thread Garanin Michael

FB wrote:

Hi,

On Tue, Dec 12, 2006 at 12:39:37PM -0500, Benji York wrote:
  

Tom Gross wrote:

   you are trying to lookup the utility with the name None. If you don't specify a name when registering the 
utility,

omit the second parameter: zapi.getUtility(IInitIndicator)
  

In other words, the name of an unnamed utility isn't None, but the empty string.



That's not the problem. I tried None (but forget to remove it later) because it 
wasn't
working in the first place.

Regards,

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

  
Problem solved or no? If no then traceback please (after call 
zapi.getUtility(IInitIndicator) ).





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


Re: [Zope3-Users] Registered utility is never found

2006-12-12 Thread Garanin Michael

FB wrote:

Hi,

is there any reason why a registered utility which is persistently stored 
inside the site
manager is never found via zapi.getUtility(IMyInterface) ?

More information:

I wrote a package ( fb ) containing some components making the developer's life 
easier. The package
provides a class fb.init.indicator.InitIndicator. A application depending on 
the fb package is
supposed to make an instance of the InitIndicator, put it into the site manager 
and register it.

As soon as the InitIndicator exists, the annoying This site is not
initialized, yet-message provided by the fb package's skin (which just
checks if zapi.getUtility(IInitIndicator) is not None) disappears.

  

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


Re: [Zope3-Users] Registered utility is never found

2006-12-12 Thread Garanin Michael

FB wrote:

On Tue, Dec 12, 2006 at 04:42:56PM +0300, Garanin Michael wrote:
  

traceback, please.



Hmm ... how? It just doesn't return the utility as expected (it returns
None). There is no error shown in any way.

  


from APIDOC:


   * *|getUtility(interface, name='', context=None)| *

 . If one is not found, raises
 ComponentLookupError.    must be EXCEPTION !!!




There are not ComponenLookupError exception? Why you find bug in 
getUtility? ;-)



(sorry my english)

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


[Zope3-Users] Re: SVN

2006-11-25 Thread Michael Haubenwallner

Dennis Schulz wrote:

How to get access to the svn

http://svn.zope.org/zc.datetimewidget/trunk/src

I can't access it neighter with eclipse nor with tortoise svn. (PROBFIND 
REQUEST FAILED)

Where can I get a login?



http://www.zope.org/DevHome/Subversion/FrontPage
and
http://www.zope.org/DevHome/Subversion/ReadOnlyAccess
has detailed info on how to access the repos.

Michael

--
http://zope.org/Members/d2m
http://planetzope.org

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


[Zope3-Users] Re: Zope3-users Digest, Vol 25, Issue 18

2006-11-15 Thread Michael Schwartz

I'm in the process of moving a Zope2 app to Zope3. 

Any experienced Zope3 developers out there interested in a short 
consulting assignment to help develop a template to kickstart the project? 
Contact me at this address or mike_idvault at yahoo (IM also...)

Topics covered will be authentication, testing, internationalization, and 
mysql connectivity (preferably via SQLAlchemy). NO ZODB!: config in 
properties, data in MySQL.

Possibly the work can be contributed back as a tutorial. IMHO, more
sample code is needed for Zope 3.

thx,

Mike Schwartz
Zia Communications

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


[Zope3-Users] traceback on startup from a wsgi server

2006-11-11 Thread Michael Haubenwallner

I run a zope3 checkout from a wsgi server setup.
On a new checkout i recently experienced a problem on startup,
here is a - not very usefull - traceback, but thats all i got ...

console---

[EMAIL PROTECTED]:~/Zope3$ python2.4 start_wsgi.py

Test-module import failures:

Module: zope.testbrowser.tests

Traceback (most recent call last):
  File /home/d2m/Zope3/src/zope/testbrowser/tests.py, line 27, in ?
from zope.testbrowser import browser
ImportError: cannot import name browser

Running unit tests:
...


Basically whats happening is that, while reading
  src/zope/app/apidoc/bookmodule/book.zcml
the Exception is thrown in
  configure package=zope.testbrowser
  ...
  /configure
and for some reason unittests are executed...

Uncommenting the configure directive solves the problem.

This behavior is not observed when starting from bin/runzope though.

For completeness my startup script is detailed here:
http://blog.d2m.at/2006/09/23/zope3-and-wsgi-integration/
and here:
http://trac.d2m.at/d2m/browser/Zope3/zope3wsgi/


Do you see a way to solve the problem except from commenting the directive ?

Michael

--
http://zope.org/Members/d2m
http://planetzope.org

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


[Zope3-Users] zope3, site-packages and easy_install

2006-10-27 Thread Michael Haubenwallner

a short question on using eggs and zope3 dev/checkout together

had a case yesterday: easy_installed zope.schema (and automatically its 
dependencies)


easy_install adds its paths in front of all other paths to sys.path
-- this broke my zope3 svn checkout; first sign:  bin/zopectl debug 
didn't work anymore


what should one suggest for development ?
- using zope3 checkout with its own python interpreter
- or remove site-packages from zope3 sys.path

what to do in deployment environment ?
- using zope3 deploment with its very own python interpreter
- you never now when anyone will add another piece to site-packages

i think this will affect buildouts too as they rely on a common python 
install.


Michael

--
http://zope.org/Members/d2m
http://planetzope.org

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


[Zope3-Users] Re: TAL, TALES, METAL documentation

2006-10-22 Thread Simon Michael
FYI, there might be some links at http://zopewiki.org/PageTemplates 
relevant for PT documentation gardeners.


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


[Zope3-Users] join translations of content-objects

2006-10-20 Thread Michael Töpfl

Hi,

is there a zope3 addon-package, which allows to join translations of 
content-objects with references like Zope2-LinguaPlone does?

I know, that a implementation of a simple approch isn`t quite hard!

I already browsed svn.zope.org, but readme.txt-files are quite minimal, :-)!

Thanks for your answers

Michael


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


[Zope3-Users] MySQL connection timeout problem

2006-09-18 Thread Michael Bernstein
I am running into a problem that seems superficially similar to the one
described here:
http://mail.zope.org/pipermail/zope3-dev/2005-December/thread.html#17052

Was a fix for the problem described in the above thread ever checked in?

Here is my traceback (a Zope restart also makes this go away):

Traceback (most recent call last):
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/transaction/_transaction.py,
 line 507, in abort
rm.abort(self)
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/transaction/_transaction.py,
 line 634, in abort
self._datamanager.abort(transaction)
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/zope/app/rdb/__init__.py,
 line 445, in abort
self._dbconn.rollback()
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/zope/app/rdb/__init__.py,
 line 391, in rollback
self.conn.rollback()
OperationalError: (2006, 'MySQL server has gone away')
Traceback (most recent call last):
  File /usr/local/lib/python2.4/threading.py, line 422, in run
self.__target(*self.__args, **self.__kwargs)
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/twisted/python/threadpool.py,
 line 149, in _worker
context.call(ctx, function, *args, **kwargs)
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/twisted/python/context.py,
 line 59, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/twisted/python/context.py,
 line 37, in callWithContext
return func(*args,**kw)
--- exception caught here ---
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/twisted/web2/wsgi.py,
 line 139, in run
result = self.application(self.environment, self.startWSGIResponse)
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/zope/app/wsgi/__init__.py,
 line 54, in __call__
request = publish(request, handle_errors=handle_errors)
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/zope/publisher/publish.py,
 line 146, in publish
publication.handleException(
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/zope/app/publication/zopepublication.py,
 line 243, in handleException
transaction.abort()
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/transaction/_manager.py,
 line 107, in abort
return self.get().abort(sub, deprecation_wng=False)
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/transaction/_transaction.py,
 line 507, in abort
rm.abort(self)
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/transaction/_transaction.py,
 line 634, in abort
self._datamanager.abort(transaction)
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/zope/app/rdb/__init__.py,
 line 445, in abort
self._dbconn.rollback()
  File
/home2/webmaven2/Zope-3.2.1.source/build/lib.linux-i686-2.4/zope/app/rdb/__init__.py,
 line 391, in rollback
self.conn.rollback()
_mysql_exceptions.OperationalError: (2006, 'MySQL server has gone away')



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


Re: [Zope3-Users] MySQL connection timeout problem

2006-09-18 Thread Michael Bernstein
On Mon, 2006-09-18 at 19:04 +0200, Brian Sutherland wrote:
 On Mon, Sep 18, 2006 at 09:43:01AM -0700, Michael Bernstein wrote:
  I am running into a problem that seems superficially similar to the one
  described here:
  http://mail.zope.org/pipermail/zope3-dev/2005-December/thread.html#17052
 
 Looks the same to me.
 
  Was a fix for the problem described in the above thread ever checked in?
 
 Doesn't look like it. Been meaning fix it as soon as I hit the problem
 again, so I can test it.

Well, the problem requires an eight-hour timeout in order to manifest,
so the only reason I am hitting it is because my prototype app is idle
overnight. Does that help you reproduce it?

- Michael

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


[Zope3-Users] Re: zalchemy integration

2006-08-14 Thread Michael Haubenwallner

Stephan Richter wrote:
Lovely Systems, Roger and I have all been in agreement to publish generic 
components as we go; if you are subscribed to all check-in messages, you 
probably saw already a bunch of packages landing in the z3c and lovely 
namespace. We have tasks setup for this week to open/publish even more 
packages and extensions.


While we are at it, 'lovely' packages do not show up in 
http://mail.zope.org/pipermail/checkins until now.


Michael

--
http://zope.org/Members/d2m
http://planetzope.org

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


Re: [Zope3-Users] problem adding an item to the zmi_views menu

2006-07-12 Thread Garanin Michael

   /
   browser:page
   name=ViewProject.html
   permission=zope.Public
   template=projectview.pt
   for=finance.project.Project
try:
 for=finance.interfaces.IProject 

   menu=zmi_views title=ViewIt
   /



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


Re: Fwd: [Zope3-Users] SFTP , SSL

2006-06-23 Thread Michael Kerrin
Hi David,

On Thursday 22 June 2006 18:58, David Pratt wrote:
 Hi Michael. There is DAV module in twisted in web2. I have not played
 with this yet but it was on my to do list. Are you using this in this
 development?
I have briefly looked at it but no I am not using it. Zope needs manage all 
the WebDAV properties and communicating this data back to Twisted from Zope 
isn't a easy problem to solve. Also I think the WebDAV support in Zope should 
be independent of the actual server being used.

Michael

 Many thanks
 David

 Michael Kerrin wrote:
  I am currently have an ongoing side project to rewrite WebDAV support for
  zope, in order to get around some limitationsin the current
  implementation. This is nearly finsihed, and I will release it once I get
  the time.

-- 
Michael Kerrin

55 Fitzwilliam Sq.,
Dublin 2.

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


Re: [Zope3-Users] export\import content

2006-06-23 Thread Garanin Michael
В Вск, 19/03/2006 в 21:57 +0300, Garanin Michael пишет:
 Hello!
 I have not empty Folder on computer. How can i import Folder to  other
 computer? Where is analog of Zope2 import\export (zexp)? 
 Thanks!
 
How i can make backup my site-folder?


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


[Zope3-Users] I fold. What are ++etc++ and ++resource++ etc?

2006-06-10 Thread Michael Dexter


Hello,

I've tried. I've failed. I've searched for a few hours now trying to 
determine what things like ++etc++, ++resource++, @@contents.html, 
but as with all things Zope, I need to know the answer before I can 
ask the question. The best I can come up with is that they have 
something to do with traversals and views but I cannot find a section 
of the FAQ's or Book to explain them.


Along the way I've also found: zope3-url-notation-styles, redirects, 
namespaces, traversal adapters.


Failing to find a clear explanation, I only see a ways for 
Zope3-based sites to:


1. Be toyed with by the user.
2. Fall out of search engines.
3. Break existing links.
4. Fail the over-the-phone test of URl's...

I intuit that traversal adapters have something to do with behavior 
or perhaps existence of these but not for sure.


I guess it comes down to: is the Zope3 feature something that the 
general public will ever see? (Or can be blocked from seeing?)


Plus, if I can stop worrying, what wonderful things do they do for 
me? I highly suggest someone put something in the FAQ about these.


Thanks,

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


Re: [Zope3-Users] testing using placefulSetUp, zcml and events

2006-06-07 Thread Michael Howitz

Achim Domma wrote:

Hi,

I have a content object I want to set up in a IObjectCreatedEvent event 
handler. I want to use the interactive interpreter to play with this, 
but it looks like my configure.zcml is not parsed and executed if I use 
placefulSetUp.


This is correct, placefulSetUp is used in unittests.

How do I have to setup my environment to test zcml configured events 
from command line? Basically I want to write something like


some_setup_method()
root[ws]=Workspace() # should trigger and handle IObjectCreatedEvent
for key in root[ws).keys():
print key

to check if the object is setup correctly.


What about starting Zope with
bin/zopectl debug
Zope starts like normal, but you get a python prompt.
There app.root() returns the root folder in the ZODB.

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


Re: [Zope3-Users] Problem with containment and @@absolut_url

2006-05-29 Thread Garanin Michael
В Пнд, 29/05/2006 в 20:26 +0200, Achim Domma пишет:
 Hi,
 
 I have implemented ArticleFolder and Article like this:
 
 
 class Article(Persistent,Contained):
  implements(IArticle)
  title=u''
  body=u''
 
 class ArticleFolder(Folder):
  implements(IArticleFolder)
 
 
 Via ZMI I can add, edit and delete articles without problems. I use this 
 TAL statement in a view for the object holding the article folder :
 
 p tal:repeat=article context/articles
  a
 tal:content=article/title
 tal:attributes=href article/@@absolute_urlasdf/a 
 /p
 
 This fails with an There isn't enough context to get URL information. 
 exception. When the exception is thrown, I see in the debugger, that the 
 context of AbsoluteUrl is the id of the first article as unicode string. 
 And this string has of course no __parent__ attribute!?
 
 I argued that context/articles might return ids, not objects, but in 
 that case article/title should fail also. But if I remove 
 tal:attributes, it works fine.
 
What is 'articles'? I can think 'articles' is list of dictionarys, like
[ {'title':'bla-bla', ...} , ..., {'title':'bla-bla'}]. 

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


Re: [Zope3-Users] Dynamic Typing: Are checks on interface compliance possible?

2006-05-18 Thread Michael Howitz

Reinhold Strobl wrote:

Hi,

what I am looking for is something like PyChecker for Zope interfaces. I mean
PyChecker aims to address the benefit of static typed languages and their
compile-time checkings. 


In Zope, there is no forced interface compliance. But is there a possibility or
program, which can check this?


Hi,

you should have a look at zope.interface.verify. With verifyClass and 
verifyObject you can check the interface compliance for classes and objects.


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


[Zope3-Users] zope.thread.local == threading.local ?

2006-05-01 Thread Garanin Michael
Hello!
I use 'zope.thread.local', but Python2.4 has 'threading.local'-class
from Jim Fulton. Where diff? 


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


[Zope3-Users] announce: pure ORM for Zope3

2006-04-26 Thread Garanin Michael
Hello!
In new branch zsqlmap-project i develop light plugable ORM for
Zope3(only!). 
It's NOT wrapper for sqlobject, but i use sqlobject naming style. 
Supported: StringCol and other; ForeignKey  MulitpleJoin; AND\OR
\BETWEEN\...\LIKE-sql conditions for select\selectBy;

Now exist two orm-adapters: for gadfly and postgres, but it's easy
develop new orm-adapters and new column-types without 'monkey patching'.
Doc-test:
https://code.keysolutions.ru/trac/zsqlmap/browser/branches/orm/README.txt




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


Re: [Zope3-Users] Creating PluggableAuthentication problem.

2006-04-18 Thread Michael Howitz

Tobias Weber wrote:

Hello!

I try to add a PluggableAuthentication and a PrincipalFolder automatically.
When I add a principal to the PrincipalFolder it works fine, but the 
authentification of the User fails. When I add one more 
PluggableAuthentication manually and choose the automatically generated 
PrincipalFolder as authenticator plugin, it works.

Here is my code:
[...]
I am sorry for this code, I try to figure out how it works.


Did you have a look at this thread:
http://www.opensubscriber.com/message/zope3-users@zope.org/3786410.html

There I pasted an example how I did it.

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


Re: [Zope3-Users] formlib problem

2006-04-18 Thread Michael Howitz

Stéphane Brault wrote:

Hi,
 I can't use formlib, when I run the example in the form.txt I get this error:
 Traceback (most recent call last):
   File pyshell#29, line 1, in -toplevel-
 print MyForm(None, request)()
   File pyshell#26, line 6, in __call__
 widgets = form.setUpWidgets(self.form_fields, 'form', self.context, 
self.request, ignore_request= ignore_request)
   File C:\Python24\Lib\site-packages\zope\formlib\form.py, line 255, in 
setUpWidgets
 IInputWidget)
   File C:\Python24\Lib\site-packages\zope\component\__init__.py, line 154, 
in getMultiAdapter
 raise ComponentLookupError(objects, interface, name)
 ComponentLookupError: ((, http://127.0.0.1), , u'')


There seems to be something missing before , http... ... did you copy 
it form the browser output?


 
 It happens when setUpWidgets is called in the first example, do I need to import something or to configure a component for formlib to work ?

 Any hint ?


Guess out of the dust: does the interface of the object you want to 
display have a zope.app.container.constraints.containers directive?


This thread seems similar to your problem.
http://mail.zope.org/pipermail/zope3-users/2006-March/002802.html

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


Re: [Zope3-Users] Programatically add plugins to PAU

2006-04-12 Thread Michael Howitz

Florian Lindner wrote:

Hello,
I've a PluggableAuthentication and want to add and register some plugins to 
it.


Adding works fine:

principal_folder = 
zope.app.authentication.principalfolder.PrincipalFolder(prefix = cs)


pau[PrincipalFolder] = principal_folder

and I think I can select it with:

pau.credentialsPlugins = [principal_folder]

but how to register it before?

And how do I select credential plugins?


This is how we did it in a project:
createAuthenticationUtils is called on handling the ObjectAddedEvent for 
the folder (which is programmatically made a site) which should contain 
the PAU.


HTH, mac

---

from zope.app.security.interfaces import IAuthentication
from zope.app.authentication.interfaces import IAuthenticatorPlugin
from zope.app.appsetup.bootstrap import ensureUtility
from zope.app.authentication.authentication import \
PluggableAuthentication
from zope.app.authentication.principalfolder import PrincipalFolder
from zope.app.authentication.groupfolder import \
GroupFolder, GroupInformation
from zope.app import zapi

from myproject import config

def addUtilityToPAU(pau, interface, utility_factory, id, name):
utility = utility_factory()
pau[id] = utility

reg_man = pau.registrationManager
reg = site.UtilityRegistration(name, interface, utility)
reg_man.addRegistration(reg)
reg.status = u'Active'

def _addGroupInformation(group_folder, id, title, description):
group = GroupInformation()
group.title = title
group.description = description
group_folder[id] = group

def createAuthenticationUtils(obj):
ensureUtility(obj, IAuthentication, '', PluggableAuthentication,
  copy_to_zlog=False)
auth = zapi.getUtility(IAuthentication)
auth.credentialsPlugins = (u'Session Credentials',)
addUtilityToPAU(auth, IAuthenticatorPlugin, PrincipalFolder,
'principal_folder', u'Benutzerverwaltung')
addUtilityToPAU(auth, IAuthenticatorPlugin, GroupFolder,
'group_folder', u'Rollenverwaltung')
auth.authenticatorPlugins = (u'Benutzerverwaltung',
 u'Rollenverwaltung',)
group_folder = auth['group_folder']
for group in config.company_groups:
_addGroupInformation(group_folder, group['id'],
 group['title'], group['description'])

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


[Zope3-Users] Re: Search on Z3 collector broken

2006-04-11 Thread Michael Haubenwallner

Andreas Elvers wrote:

Hi,

trying to search the Zope3 collector gives me a 404. This is fixable by 
changing the URL from 
http://www.zope.org/Zope3-dev/collector_contents?searching=yepSearchableText= 
...

to http://collector.zope.org ...
Re-getting the URL gives me the wanted search results.

- Andreas


Hi Andreas,
the issue is already reported and should be fixed soon.

For now please browse to:
http://www.zope.org/Collectors/Zope3-dev/

Searching and links should work from there.

Hth, Michael

--
http://zope.org/Members/d2m
http://planetzope.org

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


Re: [Zope3-Users] Security in Code, example, why does this work?

2006-04-10 Thread Michael Howitz

Reinhold Strobl wrote:

Hi,

(...)


So can code always access everything, or not?


In Zope 3 there is also the concept of trusted and untrusted code like 
in Zope 2


See
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ShortTutorial/short.pdf
pages 88 - 94 (esp. page 94)

In trusted code no permissions are checked. So you may have to check 
manually before entering trusted code.
I think that you call a method of your model-code from with-in the 
view-code. Thats the entrace to trusted code.


Hope that helps a bit,
 mac
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] TAL and Decimals

2006-04-05 Thread Michael Howitz
Am Dienstag, den 04.04.2006, 11:24 -0500 schrieb David Johnson:
 I am reading a decimal field from a database and trying to display it
 in a page template. What is the TAL to do this? 
 Among other things, I’ve tried:
 div tal:replace=python: u'%f' % (item.price) /
 
 Which generates the follow exception:
 ForbiddenAttribute: ('__float__', Decimal(0.00))

 I’ve also tried the simple:
 $div tal:replace=item/price /
 
  Which displays:
 $security proxied decimal.Decimal instance at 0x41d76694

Hi,

in current Zope versions python decimals are security proxied.
(See also http://www.zope.org/Collectors/Zope3-dev/543 )

I think a better solution than the one described in the bug is the
following:

Write an interface IDecimal which includes alle the mehtods you want to
access in views and page tempates.

Put the following into your configure.zcml:

class class=decimal.Decimal
implements interface=.interfaces.IDecimal /
allow interface=.interfaces.IDecimal /
/class

It declares that the class decimal.Decimal implements your IDecimal
interface and that there are no security restrictions on the interface.

HTH,
 mac



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


Re: [Zope3-Users] Adapting multiple times

2006-04-05 Thread Michael Howitz
Am Mittwoch, den 05.04.2006, 08:48 +0200 schrieb Frank Burkhardt:
 Hi,
 
 I've got objects implementing interface
 
  IMyObject
  
 and two adapters:
 
  IMyObject - ISearchable
  ISearchable - ISearchableEN
 
 I would like to use a TextIndex to do fulltext search on objects
 implementing ISearchableEN .
 Unfortunately this doesn't work. The TextIndex tries something
 like this to adapt an object to the given interface:
 
  ISearchableEN(myobject)
 
 Which fails (Unable to adapt) because there is no adapter
 IMyObject - ISearchableEN and Zope doesn't try to adapt multiple
 times ( IMyObject - ISearchable - ISearchableEN ).
 
 Does anyone have an Idea how to do this or do I have to modify
 the TextIndex?

Idea: Write an adater which Adapts IMyObject to ISearchableEN. This
Adapter can be a function which only does the adaption chain and returns
the Adapter to ISearchableEn adapter.

HTH,
 mac

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


Re: [Zope3-Users] principalfolder breaks manager

2006-03-30 Thread Michael Howitz
Am Donnerstag, den 30.03.2006, 17:58 +0200 schrieb Frank Burkhardt:
 Hi,
 
 after adding a principal folder, the manager principal is no longer
 valid. That's bad, because I'm unable to remove the principal
 folder again (at least without pdb or 'zopectl debug').

 Is there a special reason for that behaviour or do i miss something
 (like: you have to install utility XY before adding/registering
 the principal folder)?
 
 I added a principal 'test' to the folder (prefix='mpgsite') and a line
 like this to zcml:
 
 grantAll principal=mpgsite.test /

You can only do a grantAll for users defined via ZCML.

All other users you have to do
zope.app.securitypolicy.principalpermission \
 import principalPermissionManager

principalPermissionManager.grantAllPermissionsToPrincipal(mpgsite.test)

-- 
Mit freundlichen Grüßen

Michael Howitz

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


Re: [Zope3-Users] DropdownWidget with SimpleVocabulary causes ConversionError.

2006-03-28 Thread Michael Howitz
Am Montag, den 27.03.2006, 18:31 +0900 schrieb [EMAIL PROTECTED]:
 I'd like to ask one more question.
 
 Why does SimpleVocabulary.fromValues/fromItems() not set 'title' ?
 Is there any good reason?
 Current implementation is unconvenient for non-ascii people.

Sure. Maybe a new method is needed which gets tuples of length three
which sets value, token and title.
Otherwise you can write a subclass of SimpleVocabulary which is more
convenient for non-ascii people. (Maybe there is a reason why it is
called 'simple' ;-)

mac



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


Re: [Zope3-Users] DropdownWidget with SimpleVocabulary causes ConversionError.

2006-03-26 Thread Michael Howitz
Am Montag, den 27.03.2006, 11:52 +0900 schrieb [EMAIL PROTECTED]: 
 Hi, 
 
 I got a ploblem with SimpleVocabulary/SimpleTerm.
 Here is the situation of that.
 
 (1) I used Zope3.2 on Windows XP.
 (2) I made :
a vocabulary, and
a Choice field with the vocabulary, and
a schema contains the field, and
an add-form using the schema.
 (3) the vocabulary was made using SimpleVocabulary.fromValues().
 with values which are all unicode strings(japanese).

Hi,

Vocabularies hav three levels:
value: which is stored in ZODB
token: which is used as value attribute of the option tag in HTML-Page.
It must be convertable to str with ASCII encoding because when the
conversion is done the encoding of the page is not yet known. (Correct
me if I'm wrong here)
title: which is dislpayed to the user as the contents of the option tag

SimpleVocabulary.fromValues uses the values as value, token and title,
so it is only useable with ASCII values.

So you have to do it like this way:
SimpleVocabulary(SimpleTerm(value, token, title), ...)

token might be the uid of value, if it is an object which is stored in
ZODB.

-- 
mac

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


[Zope3-Users] Announce: z3site - theme engine for Zope3-sites (ver 0.02)

2006-03-22 Thread Garanin Michael

 Hi,
 I'm getting this error.
 
 I guess your product uses boston app.
 is this dependent on  http://svn.zope.org/Zope3/branches/roger-bostonskin/ ?
 
 

I make new release 0.02:
 - add viewlet managers: IHead, ICSS, IJavaScript
 - remove 'zop.app.boston' dependency
 - remove 'create demo theme' menu item. use 'load theme' instead
 - rewrite functional test (full complete)

And bonus: 'bostontheme' it's example theme (NOT required
'zope.app.boston' ;-) ).  


You can get all on http://garanin.objectis.net/ or www.zope.org after
workflow-publish.





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


Re: [Zope3-Users] Announce: z3site - theme engine for Zope3-sites

2006-03-21 Thread Garanin Michael
 
 Hi,
 I'm getting this error.

 I guess your product uses boston app.
 is this dependent on  http://svn.zope.org/Zope3/branches/roger-bostonskin/ ?
 
 
Sorry, i use Zope3-trunk-version. I think boston-skin include to
release...

For solve problem you can remove zope.app.boston.boston from
browser.zcml in line 7:

skin name=z3site layers=z3site rotterdam zope.app.boston.boston
default/  --- to -- skin name=z3site layers=z3site rotterdam
default/

(but demo-theme use boston-skin as example)

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


[Zope3-Users] export\import content

2006-03-19 Thread Garanin Michael
Hello!
I have not empty Folder on computer. How can i import Folder to  other
computer? Where is analog of Zope2 import\export (zexp)? 
Thanks!

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


Re: [Zope3-Users] Re: Announce: z3site - theme engine for Zope3-sites

2006-03-18 Thread Garanin Michael
В Сбт, 18/03/2006 в 00:22 +, Martin Aspeli пишет:
 On Fri, 17 Mar 2006 20:37:04 -, Garanin Michael  
 [EMAIL PROTECTED] wrote:
 
  Hello!
  I publish simple theme-engine for Zope3-sites. I use it for customize
  GUI(and ZMI) of Zope3-sites through browser. It's dynamics skin and
  local utitlity for theme storage.
 
 Sounds interesting...
 
  url:
  http://www.zope.org/Members/garanin/z3site
 
 This requires a login, which I don't have ... perhaps a workflow state  
 problem?
 
 Martin
 
sorry, it's page has 'pending' status.
see attach.



z3site.tar.gz
Description: application/compressed-tar
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Announce: z3site - theme engine for Zope3-sites

2006-03-17 Thread Garanin Michael
Hello!
I publish simple theme-engine for Zope3-sites. I use it for customize
GUI(and ZMI) of Zope3-sites through browser. It's dynamics skin and
local utitlity for theme storage. 

Features:
1) you can change  GUI of web-site (and ZMI) through web (on fly,
without restart server, and without Zope3-programming)
2) you can prepare theme and upload as tar.gz archive.
3) you can create few themes for one site.

Example: you can get design from www.oswd.org and create new ZMI through
web (without create Zope3-skin and without restart server).


url:
http://www.zope.org/Members/garanin/z3site

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


Re: [Zope3-Users] Re: Announce: z3site - theme engine for Zope3-sites

2006-03-17 Thread Garanin Michael
В Сбт, 18/03/2006 в 00:22 +, Martin Aspeli пишет:
 On Fri, 17 Mar 2006 20:37:04 -, Garanin Michael  
 [EMAIL PROTECTED] wrote:
 
  Hello!
  I publish simple theme-engine for Zope3-sites. I use it for customize
  GUI(and ZMI) of Zope3-sites through browser. It's dynamics skin and
  local utitlity for theme storage.
 
 Sounds interesting...
 
  url:
  http://www.zope.org/Members/garanin/z3site
 
 This requires a login, which I don't have ... perhaps a workflow state  
 problem?
 
 Martin
 
sorry, it's page has 'pending' status...
new url: http://garanin.objectis.net/z3site.tar.gz


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


[Zope3-Users] Re: Email application form causing despair!

2006-03-14 Thread Michael Haubenwallner

Peter Bengtsson wrote:


Good code Laurence. Thanks.
I wish we had a Cookbook to put all of these into.
Zopelabs.com sucks unfortunately.



Hmm, i have used zopelabs.com for many years now, its a great resource 
of information.


Zope3 recipes could well be collected there (a 'Zope3' category has been 
added recently).


I never found it sucking - maybe you want to tell us your troubles ?

Michael

--
http://zope.org/Members/d2m
http://planetzope.org

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


Re: [Zope3-Users] Re: Creating objects in software space when making site

2006-03-07 Thread Michael Howitz
Am Dienstag, den 07.03.2006, 12:49 +0100 schrieb Florian Lindner:
 Hello,
 I've tried from __init__ so content is self in my case (at least I think so):
 
 from zope.app.component import site
 from zope.proxy import removeAllProxies
 
 class Centershock(BTreeContainer, SiteManagerContainer):
 __doc__ = ICentershock.__doc__
 
 implements(ICentershock)
 
 def __init__(self):
  Makes this object a site and add some required utitlies.
 bare = removeAllProxies(self)
 sm = site.LocalSiteManager(bare)
 self.setSiteManager(sm)
 
 
 That gives the wierd error:
 
   File /home/florian/Zope3/src/zope/interface/adapter.py, line 481, in 
 subscribers
 subscribers = [subscription(*objects)
   File /home/florian/Zope3/src/zope/app/container/contained.py, line 183, 
 in 
 dispatchToSublocations
 for sub in subs.sublocations():
   File /home/florian/Zope3/src/zope/app/container/contained.py, line 214, 
 in 
 sublocations
 for key in container:
   File /home/florian/Zope3/src/zope/app/container/sample.py, line 56, in 
 __iter__
 return iter(self.__data)
 AttributeError: 'Centershock' object has no attribute '_SampleContainer__data'
 
 
 Any idea?

How about calling
 super(Centershock, self).__init__(*args, **kw)
But this will not work because during __init__ you have no context which
is needed by the site manager.

Try to subscribe to the ObjectAddedEvent.


-- 
Mit freundlichen Grüßen

Michael Howitz

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


[Zope3-Users] zope3.org

2006-03-04 Thread Garanin Michael
Hello!
I  see  url ' http://www.zope3.org:8080/++skin++tracker/tracker/49'  in
'bugtracker/TODO.txt'.
But 'zope3.org' - it's television company site. Why?

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


[Zope3-Users] modified layout from web

2006-02-22 Thread Garanin Michael
I very want modified layout ('skin_macros') of my site throw web.
How i can do it?
I try create 'PageFolder'-utility but after create 'skin_macros'-ZPT my
site down  crach (is it bug?). 
Thanks.


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


Re: [Zope3-Users] standart views

2006-02-19 Thread Garanin Michael
For example i want insert yours tfws_i18ninfo into 'IRight'-slot of my
site == i must overwrite yours 'viewlet'-definitions. I think it's not
right.

В Вск, 19/02/2006 в 19:46 +1300, Darryl Cousins пишет:
 Hi Garanin,
 
 I don't believe such an agreement exists. I am getting used to using
 viewlets (zope.viewlet and implemented in zope.app.boston for example)
 and this provides easy insertion of presentationSlots as you describe.
 
 For example in a tfws.layers.tfws.viewlets.i18info configure.zcml:
 
   viewlet
   name=tfws_i18ninfo
   for=*
   manager=zope.app.boston.ILeft
   permission=zope.Public
   class=.browser.I18nInfoViewlet
   template=viewlet.pt
   layer=tfws
   weight=3
   /
 
 Hope this helps.
 
 Regards,
 Darryl
 
 
 On Sat, 2006-02-18 at 19:05 +0300, Garanin Michael wrote:
  Where are exists 'agreement about standart views'?
  I think it's need for development components for site. 
  Example of my problem:
  I have two 3th-party components 'Forum' and 'News'. And i want easy
  insert 'Last Forums Items'-box and 'Last News'-box into left column of
  my site pages. I think authors of Forum and News must develop
  '@@presentationSlotBox'-view according 'agreement about standart views'
  for easy insert into site :
  1) @@presentationSlotBox from 'Forum' present 'Last Forums items'-box.
  2) @@presentationSlotBox from 'News' present 'Last News'-box.
  
  
   
  
  ___
  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] standart views ('slot-box views')

2006-02-19 Thread Garanin Michael
Sorry, i think i mistake in my question. 
I only want offer rule for develop components: if you develop component
for use in web-sites, then develop few 'slot-box views' for easy insert
into sites. 'slot-box views' it's little box with standart zope3-css
(div.box etc.)

Example:
1) I develop 'NewsManager' component. And for easy usage in sites i
develop one 'slot-box views': @@lastNewsBox show 'Last 10 News '

2) I develop 'Z3Forum' component. And for easy usage in sites i develop
two 'slot-box views': @@lastItemsBox and @@myPrivateItems

Now, if SiteDeveloper want use my component 'NewsManager' then he easy
insert @@lastNewBox into site main page (as 'tal:content' or 'viewlet').






  

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


[Zope3-Users] Re: [Zope3-dev] 'standart viweletManger' for web-site

2006-02-19 Thread Garanin Michael
I mistake in my 'stadart views' post. My question is transformed.
'Boston' layer has 'standart' viewlet managers (IHead, ICSS, ILeft,
etc.). But 'Boston' layer it's layer for ZMI, and he not include
right-side slot.

Question: Where layer for web-site (not ZMI)? I offer create
'z3site'-layer and define 'standart' viewler managers for web-site(not
ZMI) : IHead, ICSS, .., ILeft, IRight(!), etc. 






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


[Zope3-Users] standart views

2006-02-18 Thread Garanin Michael
Where are exists 'agreement about standart views'?
I think it's need for development components for site. 
Example of my problem:
I have two 3th-party components 'Forum' and 'News'. And i want easy
insert 'Last Forums Items'-box and 'Last News'-box into left column of
my site pages. I think authors of Forum and News must develop
'@@presentationSlotBox'-view according 'agreement about standart views'
for easy insert into site :
1) @@presentationSlotBox from 'Forum' present 'Last Forums items'-box.
2) @@presentationSlotBox from 'News' present 'Last News'-box.


 

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


RE: [Zope3-Users] nextURL: add vs edit

2006-02-17 Thread Garanin Michael
Difference beetween AddView and EndView
1) for AddView: 'self.context' is view (name '+')
2) for EditView : 'self.context' is content-object

I think this is 'standart' behavior. Use 'zope.formlib' for advanced
customization your forms. 

В Птн, 17/02/2006 в 13:42 -0500, Shaun Cutts пишет:
 Ok,
 
 In AddView.update,
 
 self.request.response.redirect(self.nextURL())
 
 is called, but this is not called in EditView... so change isn't as
 simple as moving nextURL. However, if you put this line into
 EditView.update as well as moving nextURL, then my redirect works fine.
 
 But does this break anything else? Is there some reason why the editview
 doesn't do redirect? 
 
 I have gotten offlist feedback that I'm not the only one interested in
 this
 
 Thanks,
 - Shaun
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 Shaun Cutts
 Sent: Friday, February 17, 2006 1:17 PM
 To: Zope3-users@zope.org
 Subject: [Zope3-Users] nextURL: add vs edit
 
 Is there a reason why zope.app.form.browser.add.AddView defines:
 
 def nextURL(self):
 return self.context.nextURL()
 
 but zope.app.form.browser.editview.EditView doesn't?
 
 My redirection works for add but not edit, and this is the reason. Is
 this a feature or a bug? If a bug, all that needs to happen is that
 nextURL get moved to EditView from AddView, as EditView is base for Add.
 
 
 But perhaps there is a reason for this I don't understand?
 
 - Shaun
 
 
 ___
 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] Announcement: zsqlmap

2006-02-16 Thread Garanin Michael
Announcement zsqlmap-project: 
zsqlmap - it's Zope3-wrapper for SQLObject. i borrow idea from sqlos
(http://codespeak.net/z3/sqlos) and add features. 
Homepage:
https://code.keysolutions.ru/trac/zsqlmap/
Enjoy.

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


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-11 Thread Garanin Michael
   File /home/florian/Zope3/src/zope/schema/_bootstrapfields.py, line 171, 
 in 
 get
 return getattr(object, self.__name__)
 ForbiddenAttribute: ('blablubb', CS.centershock.centershock.Centershock 
 object at 0xb757a46c)
 
That is problem? You object don't have '__name__' attribute. 
See 'buddydemo.Buddy' please.  
There are two variants:
1) in MyClass write ' __name__ = __parent__ = None'
2) or MyClass must implement ILocation

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


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-10 Thread Garanin Michael
Do you register the 'centershock'skin? 
Write this part of zcml-code, please.


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


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-10 Thread Garanin Michael
В Птн, 10/02/2006 в 14:22 +0100, Florian Lindner пишет:
 Am Freitag, 10. Februar 2006 14:05 schrieb Garanin Michael:
  Do you register the 'centershock'skin?
  Write this part of zcml-code, please.
 
 Yes, there are a number of page directives that use the centershock skin and 
 are working correctly.
 
 Florian
Do you include 'default'-layer to 'centershock'-skin definition?
I think 'browser:form' ignore 'layer'-attribute and use
'default'-layer. 





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


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-10 Thread Garanin Michael
I simulate this for Buddy from buddydemo (see attached) == it is normal
work for Buddy-object! 

I think you make mistakes:
1) __init__ for 'view' always get 3-parameters (self, context, request)
2) getData must return dictionary.







configure  
xmlns=http://namespaces.zope.org/browser;
xmlns:zope=http://namespaces.zope.org/zope;
  layer name=centershock/
   
  skin name=centershock layers=centershock rotterdam default/

  form
name=registrationForm.html
 schema=.test.registrationForm
 class=.test.registrationFormView
 permission=zope.Public
 layer=centershock
 for=*/
  
/configurefrom zope.interface import Interface
from zope.schema import TextLine, Password

class registrationForm(Interface):
login = TextLine(title=uUsername)


class registrationFormView:

def getData(self):
return {}
def setData(self):
pass
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-10 Thread Garanin Michael
В Птн, 10/02/2006 в 17:18 +0300, Garanin Michael пишет:
 I simulate this for Buddy from buddydemo (see attached) == it is normal
 work for Buddy-object! 
for work my example don't forget insert

   implements 
   interface=.test.registrationForm /

to content class=.buddy.Buddy - tag. 


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


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-10 Thread Garanin Michael
I think 'browser:form' will be 'deprecated'. 
Try use 'zope.formlib' for new automatic-generated forms. It's easy and
more undestandable and more flexibility.

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


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-10 Thread Garanin Michael

В Птн, 10/02/2006 в 17:47 +0100, Florian Lindner пишет:
 Am Freitag, 10. Februar 2006 15:55 schrieb Garanin Michael:
  I think 'browser:form' will be 'deprecated'.
  Try use 'zope.formlib' for new automatic-generated forms. It's easy and
  more undestandable and more flexibility.
 
 Hi,
 You have any proof that the browser:form will be deprecated?
 

This links:
http://www.z3lab.org/sections/blogs/philipp-weitershausen/2005_12_14_zcml-needs-to-do-less
http://www.infrae.com/presentations/present_PF_DocumentLibrary/schemas
http://faassen.n--tree.net/blog/view/weblog/2005/09/06/0



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


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-10 Thread Garanin Michael
 I've played with zope.formlib before that. I didn't manage to generate a 
 entire form, just the input ... statemenets were generated, without any 
 html headers or anything like that. So I need to add them manually with 
 python code or a template. Can you tell me how I can generate a form. 
 Basically the same like the form directive we're talking about all the time.
 
 
 Thanks,
 
 Florian
It's easy. Example:

1) class IMyForm(Interface):
title = TextLine(...)

2) class MyAddForm(zope.formlib.AddForm):
form_fields = IMyForm

def create(self, data):
   # create you object from data-dictionary


   class MyEditForm(zope.formlib.EditForm):
form_fields = IMyForm
# yes it's all ! ;-)

3) in browser.zcml
   
  page
  name=AddMyObject.html
  for=zope.app.container.interfaces.IAdding 
  class=.MyAddForm
  permission=zope.ManageContent
  /
  page
  name=edit.html
  for=.IMyObjectInterface
  class=.MyEditForm
  permission=zope.ManageContent
  /

P.S. you can see usage zope.formlib in 'zsqlmap' (my product, see
zope.org ;-)









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


Re: [Zope3-Users] Simple Acquisition

2006-02-04 Thread Garanin Michael
  
В Сбт, 04/02/2006 в 21:01 +0100, Jean-Marc Orliaguet пишет:
   
 David Johnson wrote:
 
 I have created a ZPT Page which I have no trouble accessing:
 
 http://localhost/index.html
 
 
 
 However, if I try to access it from the following URL, I see the
 contents of MyFolder instead of the index.html.
 
 http://localhost/MyFolder/index.html
 
 What is the proper way to acquire index.html in other contexts?
   
you can overwrite traverse-behavior for 'your folders': write simple
Traverse-adapter for you folders. 
What is 'your folders'? It's folders implements
'IMyAcquisitionBehavior'. 

This adapter will has  'traverse'-method.
example(only idea):

class MyAcquisitionTraverse:
  __used_for__ = myproduct.interfaces.IMyAcquisitionBehavior

  def traverse(self, name):
 my_folder = self.context
 parent_folder = my_folder.__parent__ 
 return zapi.traverse(parent_folder, name) 












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


[Zope3-Users] Sum of Decimals

2006-02-03 Thread Garanin Michael
  
Hello!
My content object A has attributes 'cost'  'tax' - Decimal (from
decimal). I try: A.cost + A.tax --- security error '+' method for
Decimal-class. I solve problem by 'zope.proxy.removeAllProxies' , but i
think it's bad. What other ways are exist?

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


Re: [Zope3-Users] test() in TALES in Zope3

2006-02-01 Thread Michael Dudzik
On Wed, 01 Feb 2006 09:07:17 +0100, Andreas Jung
[EMAIL PROTECTED] said:
 
 
 --On 1. Februar 2006 09:04:36 +0100 Frank Burkhardt [EMAIL PROTECTED] wrote:
 
  Hi,
 
  in Zope2 there's a test() method that can be used in TAL (*). Is there
  something comparable in Zope3?
 
  I know how to write such a method but how to make it available in the
  namespace of TALES-python:-expressions? I would like to write
  expressions like this:
 
  div tal:attributes=class python: 'foo' + test(condition == True,'
  bar','') /
 
 
 You can write this in Python as
 
 condition and true_expression or false_expression

That doesn't work under some conditions:

C and A or B where C is a boolean

if C is false it evaluates to B
if C is true it evaluates to A EXCEPT when bool(A) == false

example:

C and None or 7 ALWAYS evaluates to 7

However, the expression (B,A)[C] always works if C is a boolean

I'm using that until Python 2.5 comes along.

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


  1   2   >