Re: [Zope3-Users] ComponentLookupError

2006-05-12 Thread Egon Frerich
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Jachin,

with these changes your application works:


(new)
-  browser.py 

from zope.app.form.browser.editview import EditView
from zope.app.form.browser.add import AddView
from zope.app.form import CustomWidgetFactory
from zope.app.form.browser import ObjectWidget

from interfaces import IPerson
from person import Person
from streetAddress import StreetAddress


st = CustomWidgetFactory(ObjectWidget, StreetAddress)

class PersonEditView(EditView):
__used_for__ = IPerson

address_widget = st

class PersonAddView(AddView):
__used_for__ = IPerson

address_widget = st

- - configure.zcml 

configure
xmlns=http://namespaces.zope.org/zope;
xmlns:browser=http://namespaces.zope.org/browser;
xmlns:i18n=http://namespaces.zope.org/i18n;
i18n_domain=abook

!-- Person --

interface
interface= .interfaces.IPerson
type= zope.app.content.interfaces.IContentType
/

content class = .person.Person
factory
id= simple_abook.person.Person
description= A Person
/
require
permission= zope.View
interface= .interfaces.IPerson
/
require
permission= zope.View
set_schema= .interfaces.IPerson
/
/content

content class = .streetAddress.StreetAddress
factory
id= simple_abook.person.StreetAddress
description= A Person
/
require
permission= zope.View
interface= .interfaces.IStreetAddress
/
require
permission= zope.View
set_schema= .interfaces.IStreetAddress
/
/content


browser:addform
label= Add a Person
fields= firstName lastName address
name= AddPerson.html
schema= .interfaces.IPerson
content_factory= .person.Person
class=.browser.PersonAddView
permission= zope.View
/

browser:editform
label= Edit a Person
schema= .interfaces.IPerson
for= .interfaces.IPerson
fields= firstName lastName address
name= edit.html
class=.browser.PersonEditView
permission= zope.View
menu= zmi_views
title= Edit
/

browser:addMenuItem
title= A Person
description= Add a Person
view= AddPerson.html
class= .person.Person
permission= zope.View
/

/configure
-  


Regards,

Egon


Jachin Rupe schrieb am 11.05.2006 21:12:

 hi there

 opps I forgot:

 streetAddress.py

 from persistent import Persistent
 from zope.interface import implements

 from abook.interfaces import IStreetAddress


 class StreetAddress(Persistent):

 implements(IStreetAddress)

 street = u
 city = u
 state = u
 zipcode = u



 On May 11, 2006, at 2:02 PM, Egon Frerich wrote:

 Hi Jachin,


 Jachin Rupe schrieb am 11.05.2006 19:12:

 interfaces.py

 from zope.interface import Interface
 import zope.schema

 class IStreetAddress(Interface):
 A vine street address

 street = zope.schema.Text (
 title=uStreet 1,
 description=uThe street address,
 required = False
 )

 city = zope.schema.TextLine (
 title=uCity,
 description=uThe city.,
 required = False
 )

 state = zope.schema.TextLine (
 title=uState,
 description=uThe state.,
 required = False
 )

 zipcode = zope.schema.TextLine (
 title=uZip Code,
 description=uThe zip code,
 required = False,
 min_length = 5
 )




 Can you please me your implementation for this?

 Egon

 --
 Egon Frerich, Freudenbergstr. 16, 28213 Bremen

 E-Mail: [EMAIL PROTECTED]

- --
Egon Frerich, Freudenbergstr. 16, 28213 Bremen

E-Mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (MingW32)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEZHSiuTzybIiyjvURAjtUAKCBUauLTFzO+soS/N8RWPO4N5SG8ACfalVY
jvkyaY1jfGjM9/I1g/5HbLE=
=Elf8
-END PGP SIGNATURE-
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Problem with Umlauts

2006-05-08 Thread Egon Frerich
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Florian,

do you have the first line

# -*- coding: utf8 -*-

in your python module? And is the source encoded in UTF-8?

Greetings,

Egon

Florian Lindner schrieb am 08.05.2006 21:36:

 Hello,
 I have an schema like that:
 
 class IAbbreviation(Interface):
   abbreviation = TextLine(
   title = uAbkürzung,
   required = True)
   
   meaning = TextLine(
   title = uBedeutung,
   required = True)
 
   description = TextLine(
   title = uErklärung,
   required = False)
 
 
 but in all Forms (ZMI or formlib generated) the German Umlauts are displayed 
 like Abkürzung which should be Abkürzung.
 
 Anyone got an idea what's wrong?
 
 Thanks,
 
 Florian
 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users
 

- --
Egon Frerich, Freudenbergstr. 16, 28213 Bremen

E-Mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (MingW32)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEX6cWuTzybIiyjvURAn2vAJ45kPCmgDTPzEnz49p51YeTB55WIgCgx1Aq
xrzVzyabm46utdgfsvPG1Kg=
=9Wl/
-END PGP SIGNATURE-
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Problem with Umlauts

2006-05-08 Thread Egon Frerich
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hey Andreas,

Andreas Jung schrieb am 08.05.2006 22:28:

 
 
 --On 8. Mai 2006 22:16:24 +0200 Egon Frerich [EMAIL PROTECTED]
 wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hi Florian,

 do you have the first line

 # -*- coding: utf8 -*-

 in your python module? And is the source encoded in UTF-8?
 
 huh? what has the source encoding to do with how unicode strings
 are encoded on the output side?
 
 -aj
 


If you put Umlauts in your module (here: title = uAbkürzung,) and your
editor put the Umlaut from the keyboard in the encoding 'cp1252' or
whatever into your module but you have said your file is utf-8 encoded
what do you think what is the output?

Egon
- --
Egon Frerich, Freudenbergstr. 16, 28213 Bremen

E-Mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (MingW32)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEX7MiuTzybIiyjvURAhonAJwIKEivzyV39n9VGSk8aoBSWBV0cwCfXAAp
38yTkcV6tiMbAfoz+ErBtYc=
=cW8L
-END PGP SIGNATURE-
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Newbie Struggling with Zope 3

2006-05-07 Thread Egon Frerich
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



Siddhartha Azad schrieb am 07.05.2006 17:21:

 Hi, Yes I have installed zope-3.2. The worldcookery application stops
 working from chapter 6 onward in

Unfortunately you don't give us the traceback with the error message. I
cannot see any problem in chapter 6.

For chapter 7 you can find within the Errata on Philipp's website:

 #
 
 page 96, Example 7.4.1: Due to an incompatible change from Zope 3.1
 to Zope 3.2, The custom sequence widget no longer works as listed.
 Adding the following code to the widget class fixes the problem:
 
 def __init__(self, context, value_type, request): return
 super(DynamicSequenceWidget, self).__init__(context, request)
 


 zope-3.2 (attempt to add a Recipe results in a system error). I have
 found other people with a similar problem with the worldcookery code
 also. Rephrasing my question, suppose I have deployed a folder called
 shopping in my instance's lib/python. 

Here I have a problem with the terminology. I assume you have a
directory with the name shopping and this directory contains your
package.

Or do you mean you have a package in your instance which has statements
for creating a Zope 3 folder with the name shopping?

 Suppose this has a ZPT called
 shop-viewer.pt. How do I view this ZPT in Zope 3.2 without adding it
 via the ZMI. I am unable to simply say 
 http://localhost:8080/shopping/shop-viewer.pt. 

Did you see the example 7.3.2?
Do I have to add a new
 folder through the ZMI and add a new shop-viewer' instance to it? Or
 is there a way to access the shopping folder directly, once deployed?
  Thanks, Sid.

Egon


 
 
 --- Egon Frerich [EMAIL PROTECTED] wrote:
 
 Hi,
 
 Siddhartha Azad schrieb am 07.05.2006 08:10:
 
 Hi, I am starting to work with Zope3 am having trouble 
 understanding a few things. I bought the Zope 3
 Book
 and installed the worldcookery application in my
 what does that mean?  The book tells you to create an application
 step by step. If you follow these steps then you can tell us in which
 step is which problem.
 
 Don't forget the book is about Zope X3.0. Maybe you installed Zope
 3.2 and there are some changes.
 
 instance's lib/python directory and configured the .zcml files
 too. But when I do a
 http://localhost:8080/worldcookery, I
 get:
 
  [top]  The page that you are trying to access is not 
 available
 
 Please note the following:
 
 1. You might have misspelled the url 2. You might be trying to
 access a non-existing page  I understand I can develop content
 types and views
 and
 ZPTs and place them in a folder as a package. But unless I have
 made it through the ZMI, I am unable
 to
 access it. Why is that? What URL should I be using
 for
 a newly developed folder that I didn't add through
 the
 ZMI but which is installed in my Zope Instance's lib/python and
 configured in the  ZCML files? This is really confusing me
 leading to a
 fundamental
 question, which is, how do you really develop a website with
 ZOPE? I would appreciate any help. Thanks, Sid.
 
 ___ Zope3-users
 mailing list Zope3-users@zope.org 
 http://mail.zope.org/mailman/listinfo/zope3-users
 
 -- Egon Frerich, Freudenbergstr. 16, 28213 Bremen
 
 E-Mail: [EMAIL PROTECTED]
 

- --
Egon Frerich, Freudenbergstr. 16, 28213 Bremen

E-Mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (MingW32)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEXlOruTzybIiyjvURAmEIAJ0Rdj6qE1J/L01OCbG/dYaq7+RHcQCfbQyB
kHT11djNU+VZ8TuMtlyjDJA=
=rYI5
-END PGP SIGNATURE-
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] factory - but object is not initialized

2006-02-13 Thread Egon Frerich
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,

for a content component I have programmed a factory to be sure numeric
fields have 0.0. If I add an object without numeric values the
introspectors tells me these fields have type NoneType and the values
are None.

Logging informations inform the factory is called and these fields
contain 0.0.

The datafields are instances of FieldProperty.

What have I to do?

Regards,
Egon
- --
Egon Frerich, Freudenbergstr. 16, 28213 Bremen

E-Mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (MingW32)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD8KZYuTzybIiyjvURAq70AKCDozSVUtazDXRPrNgvVu90SCZ4MgCgwoyM
ClyzVgV5PHRubJ8BpzS7fh8=
=/0g3
-END PGP SIGNATURE-
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] New User: Zope 2, or Zope 3?

2006-02-08 Thread Egon Frerich
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

there are two books, one from Philipp von Weitershausen, the other from
Stephan Richter.

You may have a look at
http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ProgrammerTutorial
http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/FrontPage/Zope3Book
http://www.benjiyork.com/quick_start/

Egon

Chris Cogdon schrieb am 09.02.2006 00:05:

 Hi folks! I'm starting work on a from-scratch web application, and I'd
 like to use this as a first-time-application using Zope.
 
 (Actually, this is not really the first time... but my previous was
 something really simple way back in the Zope 1 days, so... just pretend
 this is first-time).
 
 I'm trying to get started quickly (of course), and want to do it reading
 as much documentation as possible, without depending on you fine folk
 too much for help. From my research it seems that there's a bunch of
 documentation and tutorials geared around Zope 2, but not anywhere near
 as much for Zope 3, and Zope 3 seems a vastly different beast than '2'.
 
 So, my question is... should I stick with Zope 2 for the moment (with
 its plethora of documentation), or dive right into Zope 3 and battle it
 out (and depend more on the community for any lack of documentation)? In
 particular, I DO want a decent tutorial to work through to get me
 started (and I cant find one of any depth at all for Zope 3).
 
 Or... can I use the Zope 2 tutorials to work through Zope 3 ??
 
 My background: I'm a seasoned python developer, and have written my own
 web-frameworks for various applications. This time I want to use
 something more 'mainstream' so other developers on the project have
 something 'familiar' to work with, or at least something that will be
 useful to learn. The application will need to connect to a PostgreSQL
 database, and would like some simple authentication plugins so end-users
 of the application can create accounts, log in, and have data restricted
 based on logins. Nothing much more fancy than that.
 
 
 Thanks kindly for your consideration!
 
 

- --
Egon Frerich, Freudenbergstr. 16, 28213 Bremen

E-Mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (MingW32)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD6n96uTzybIiyjvURAoL0AJ9YlEpls4B9LN5dF+sAyy7Vl6vQHwCglMWZ
OexMbN9tRKBEXoKNNCAo79Q=
=Xkkc
-END PGP SIGNATURE-
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users