Re: [Zope3-Users] Generations of Zope and Enterprise Culture

2006-02-10 Thread Lennart Regebro
On 2/9/06, Edward Pollard [EMAIL PROTECTED] wrote:
 place to be. However, non-Zope development groups on campus have asked
 me: So, what will we do when another version of Zope comes along that
 will completely break backwards compatibility again?

Nothing. Why would yo do anything? Zope3 will not stop working if
Zope4 comes along, just as Zope2 has not stopped working when Zope3
came along.

 Certainly this discussion has to have taken place somewhere before.

Oh yeah. Hundreds of thousands of times with different software. It's
a variation of the forward compatibility-discussion, but forward
compatibility is a myth. Nobody can predict the future. Will the
bright minds behind Zope 3 come up with something even brighter and
make something completely new? Possibly, we don't know. Or some Ruby
guys will come up with it and everybody will shift to a new completely
incompatible version of Ruby on Rails. Or Microsoft can suddenly
decide to go open source. NOBODY KNOWS. All we can do is guess, and
most of our guesses wll be wrong.

Therefore: You do today, what works today, and worry about tomorrow
when it happens.

For example, what did you do in 1998, and did you in 1998 know what
you would be doing today? If you in 1998 knew that you were going to
have a Zope 2 based website, then they have a point. If you don't,
then they don't have a point. :-)

Now, how you break that information to management, is nothing I can
help you with. ;-)

 We have as much invested in ColdFusion
 as we do Zope 2 and there is a perceptual issue here I'm not certain
 how to correct via education.

Ah! But unlike Zope2 or Zope3, ColdFusion *will* break when
incompatible versions come out, because it's closed source, so you
can't fix the bugs. With open source you can. If the bug is too
complex, yo can pay somebody to fix it for with. With ColdFusion,
you're up shit creek without a debugger.

 Clearly Zope 3 does so much more out of
 the box to support the standards based semantically driven web site we
 are saying we want in our needs assessment documents, but it is a hard
 thing to sell.

I'm the worst salesman in the world. All I can do is shoot other
peoples arguments to pieces. ;-)

 Second, the existence of Zope 3 has completely shot any support for
 Zope 2 continuation out of the water in our environment. Is this fair,
 or is there life left to the Zope 2 tree we've developed some
 experience in? Should I be considering pitching a Zope 2 solution
 instead?

There is definitely life in Zope2 left. It will without any doubt be
supported and developed for years to come, although the development is
now mostly on consolidation with Zope3.

--
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Generations of Zope and Enterprise Culture

2006-02-10 Thread Lennart Regebro
On 2/10/06, Edward Pollard [EMAIL PROTECTED] wrote:
 Is this a viable strategy? We'd really be starting from scratch, so
 would such an approach enhance our work or hold us back?

Five is a viable strategy, but unless you need Zope2 products it will
most likely just hold you back.

 It seems the more I read about Five the less I understand the point of
 Zope3, but I chalk that up to my ignorance.

Well, no, Five is all about getting Zope3 technology into Zope2. It's
there fore people who want the component thinking but can't move to
Zope3. It may be that Five ends up making Zope2 and Zope3 merge
completely in some future, but as noted before: Nobody really knows
how the world looks in five years.

--
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] updating objects in ZODB

2006-02-10 Thread Thierry FLORAC




On Fri, 2006-02-10 at 11:15 +0100, Lorenzo Gil Sanchez wrote:


How do I update the old objects and add the new attribute to them? I can 
provide a default value for this attribute if that helps.
I know this is a common issue with application updates. I also know that 
during the development phase the best thing I can do is remove the 
Data.fs file and start again and that's what I'm currently doing. But 
I'm worried about installing the application in the client machines and 
two month later needing to add more fields to my content-types. If I 
understand correctly one of the advantages of Zope3 is the support for 
always-changing-applications. So how does it work in this particular 
situation?



I think that Zope3 handles this problem through the concept of generations.
Documentation and interfaces are available in package zope.app.generations.

 Thierry



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


Re: [Zope3-Users] updating objects in ZODB

2006-02-10 Thread Lorenzo Gil Sanchez

Thierry FLORAC wrote:

On Fri, 2006-02-10 at 11:15 +0100, Lorenzo Gil Sanchez wrote:
How do I update the old objects and add the new attribute to them? I can 
provide a default value for this attribute if that helps.
I know this is a common issue with application updates. I also know that 
during the development phase the best thing I can do is remove the 
Data.fs file and start again and that's what I'm currently doing. But 
I'm worried about installing the application in the client machines and 
two month later needing to add more fields to my content-types. If I 
understand correctly one of the advantages of Zope3 is the support for 
always-changing-applications. So how does it work in this particular 
situation?


I think that Zope3 handles this problem through the concept of 
generations.
Documentation and interfaces are available in package 
zope.app.generations.




Thanks for the pointer, that was exactly what I was looking for


  Thierry



___
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 Florian Lindner
Am Freitag, 10. Februar 2006 11:37 schrieb Lennart Regebro:
 On 2/10/06, Florian Lindner [EMAIL PROTECTED] wrote:
  It does not implement registrationForm. But I thought that
  interfaces.registrationForm is only for providing the schema to build the
  form, because of the for=* it should displayable from all objects. Or
  not?

 Right, but when you try to display a page that uses a schema for an
 object that does not implement that schema, it tries to look up an
 adapter between the object and the schema. And if that fails, the page
 will not be displayed. I suspect that may be the reason. Try to not
 define the schema and see if the page shows up.

I don't think that you're right...

Anyway, I tried it:
The schema is required, I can't leave it undefined. I've changed it to:

schema=CS.centershock.interfaces.ICentershock

And called ++skin++centershock/cs/registerForm.html. cs is an object that does 
implement ICentershock. I've also tried to set for on the same value as 
schema or omitting it. Everything gave the same result: 404.

Any more ideas?

Thanks,

Florian
___
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 Florian Lindner
Am Donnerstag, 9. Februar 2006 22:45 schrieb Bernd Dorn:
 On 09.02.2006, at 19:27, Florian Lindner wrote:
  Hello,
  I try to create a form build from a schema with browser:form:
 
  form
  name=registrationForm.html
  schema=.interfaces.registrationForm
  class=.views.registrationForm
  permission=zope.Public
  layer=centershock
  for=*/
 
 
 
  interfaces.registrationForm looks like that:
 
  from zope.interface import Interface
  from zope.schema import TextLine, Password
  class registrationForm(Interface):
  login = TextLine(title=uUsername)
 
 
  views.registrationForm:
 
  class registrationForm(object):
  def __init__(self):
  import pdb; pdb.set_trace()
  def getData(self):
  import pdb; pdb.set_trace()
  def setData(self):
  import pdb; pdb.set_trace()
 
  but when I try to call the URL:
  http://horus:8080/++skin++centershock/registrationForm.html I just
  get 404.

 maybe http://horus:8080/++skin++Centershock/registrationForm.html

 skin names are CamelCase per convention and layers lowercase

Not in my convention  ;-)

The skin is applied correctly, the 404 error page is rendered with my skin.

Regards,

Florian
___
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 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
___
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 Florian Lindner
Am Freitag, 10. Februar 2006 15:18 schrieb 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)

I've removed __init__ from the view class, like you did.

 2) getData must return dictionary.

getData was never called (otherwise I would jumped into pdb).

Anyway, I've changed it accordingly and still no success.

Any more ideas?

Florian
___
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 Rupert Redington
Florian Lindner wrote:
 Am Freitag, 10. Februar 2006 15:18 schrieb 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)
 
 I've removed __init__ from the view class, like you did.
 
 2) getData must return dictionary.
 
 getData was never called (otherwise I would jumped into pdb).
 
 Anyway, I've changed it accordingly and still no success.
 
 Any more ideas?
 
 Florian

I've just run the same test, Michael's code works for me, but _only_
when I declare an interface specifically in the for attribute,

eg:
for=persistent.interfaces.IPersistent

if I use a wildcard I get the 404 Florian describes...

Rupert
___
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 Rupert Redington
Florian Lindner wrote:

 
 Also specifying an interface and calling the view from an object implementing 
 this interface does not make it work.
 
 FYI - Florian, it appears we're doing something very similar - mines a
 signup/registration form too! Do you intend to submit the form data to a
 method on a localUtility?
 
 Don't know exactly how I will proccess the data... first task is to make the 
 form working... :-(
 
 Florian

Here's what I'm using,
Rupert:

form
  name=Signup.html
  permission=zope.Public
  class=singleton.browser.signup.SignUp
  for=persistent.interfaces.IPersistent
  schema=singleton.interfaces.ISingletonSignup
  /

class ISingletonSignup(Interface):
A minimal schema for use in a sign-up process.

Gathers a username and full name and email.


login = TextLine(title=uLogin,
 description=uLogin/Username.,
 required=True)

title = TextLine(title=u'Full Name',
 description=uYour real name,
 required=True)

email = TextLine(title=u'Email',
 description=u'The email address to which your
password will be sent.',
 required=True)


class SignUp:

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


[Zope3-Users] zope3-users rejects mail

2006-02-10 Thread Florian Lindner
Hello,
some (not all) of my postings to zope3-users are being rejected:

Final-Recipient: rfc822; zope3-users@zope.org
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; host mail.zope.org[63.240.213.173] said: 550 
Error:
Message content rejected (in reply to end of DATA command)


Anybody knows whats wrong?

Thanks,

Florian
___
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


[Zope3-Users] newbie design questions for UI to external data

2006-02-10 Thread Shaun Cutts
Hello,

I'm trying to write a zope3 UI for data in an RDBMS with python business
logic. (Hence updates shouldn't go directly to the database; queries are
probably best off using the marshalling code in business logic as well,
but could use direct query if its especially easy.)

I was trying to adapt Stephan Ritcher's Zope3 book examples, but am
getting a bit snarled with escaping from/interacting with the ZODB.

For a collection of objects that live in the DDBMS, should I try to
implement a collection object that itself lives in the ZODB (inherits
from Persistent, implements IContainer), but really performs a query to
get its data?

Then I need to mark actual contents volatile (?) Is there a hook to set
the volatile contents?

Also, it would be good to have a simple admin object in the ZODB that
has DB connection info. Putting one there and making it accessible via
Zope3 seems easy enough -- just inherit from Persistent But how do I
access this info from, say, my collection object(s). Does Persistent
generate a standard key?

Or should I have one big database object in ZODB that has attributes
for the connection, and also attributes for each of the collections.
This seems easy enough, but then I wonder if the zcml config will become
tricky, as I would have to declare forms for attributes of instances
(somehow)?

When using the standard forms, I got errors for not setting __name__ and
__parent__ on my contained objects. The first was easy enough, but who
is supposed to set __parent__?

I want to use standard forms if possible for the moment, as I am trying
to get up a prototype fast. Eventually I will need a paged view. Is
there one out there to use?

In general, if there is a good example of something like I am trying to
do, I would be grateful if someone could point me to it.

- Shaun Cutts


___
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 Florian Lindner
Am Freitag, 10. Februar 2006 20:10 schrieb 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 ;-)

Thanks for your example. But I've the same error, a 404.

in views.py:

from zope.formlib.form import EditForm
from interfaces import IRegistrationForm

class registrationForm(EditForm):
form_fields = IRegistrationForm


in configure.zcml:

page
name=registrationForm.html
class=.views.registrationForm
permission=zope.Public
layer=centershock
for=CS.centershock.interfaces.ICentershock /


And I try to call it with:

/++skin++centershock/cs/registerForm.html whereas cs is a ICentershock object.

It still gives a 404.

Any guess what's wrong?

Thanks,

Florian
___
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-10 Thread Stephan Richter
On Thursday 09 February 2006 12:03, Chris Cogdon wrote:
  That is really strange. I cannot find the SQL-based auth plugin either
  anymore. I know it exists; I was at the sprint it was written, I  
  still have
  the picture in front of me. Darn,

 Well, it certainly exists, because I installed one :)

 http://www.zope.org/Products/Zope3-Packages

No, those are only the SQL adapters not the authentication plugin for SQL.

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


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

2006-02-10 Thread Stephan Richter
On Thursday 09 February 2006 13:27, Florian Lindner wrote:
 Why that? Anybody knows?

Any resolution? (I did not have time to read the entire thread carefully.)

If not, this does seem like a bug.

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


Re: [Zope3-Users] Generations of Zope and Enterprise Culture

2006-02-10 Thread Stephan Richter
On Thursday 09 February 2006 17:53, Max M wrote:
 Edward Pollard wrote:
  Second, the existence of Zope 3 has completely shot any support for
  Zope 2 continuation out of the water in our environment. Is this fair,
  or is there life left to the Zope 2 tree we've developed some
  experience in? Should I be considering pitching a Zope 2 solution
  instead?

 Why don't you just install Five, and take it from there? Your old
 codebase can be gradually updated to Zope^3 technologies.

I second that. Several companies have successfully started to migrate to Zope 
3 by using their existing code and transforming it more and more to using 
Five as a bridge. It is incremental and pretty risk free.

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


[Zope3-Users] Absolute url of an object

2006-02-10 Thread Paulus Zegwaard

Hi,

Sorry if I ask a question that is already asked a gazillion times, but I 
was not able to find the obvious answer.


I'm rather new to Zope 3 and I have done a fair amount of Zope 2 
development and was used to be able to create dynamic menus by iterating 
over the objects in the root container (site root) and traversing all 
the way down (or as far as i wanted). That was sort of easy because 
every object in Zope 2 has an absolute_url method as well as a 
title_or_id method.


But although I understand Zope 3 has something like that too, I'm 
unclear how to achieve that every object provides an absolute_url 
method. Possibly Zope 3 has a far superior way of achiving the same 
goal. As a Zope 3 newbie I understand Zope 3 aims to require being 
explicit, yet I did like some of the implicit behavior of Zope 2 a lot. 
For instance I still think acquisition is bad by definition.. Maybe you 
should be able to turn it on or off at the folder level.


A related questions is: is there an obvious way to get the site url (or 
object) other then just knowing the name?


Can anyone point me in the right direction? BTW I have Stephan's book 
and ordered Phillip's book but that didn't arrive yet.


Thanks

Paulus
___
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 Alen Stanisic
On Fri, 2006-02-10 at 22:18 +0100, Florian Lindner wrote:
 Thanks for your example. But I've the same error, a 404.
 
 in views.py:
 
 from zope.formlib.form import EditForm
 from interfaces import IRegistrationForm
 
 class registrationForm(EditForm):
 form_fields = IRegistrationForm
 
 
 in configure.zcml:
 
 page
 name=registrationForm.html
 class=.views.registrationForm
 permission=zope.Public
 layer=centershock
 for=CS.centershock.interfaces.ICentershock /
 
 
 And I try to call it with:
 
 /++skin++centershock/cs/registerForm.html whereas cs is a ICentershock object.
 
 It still gives a 404.
 
 Any guess what's wrong?
 

What happens if you changed your view.py to:

from zope.formlib.form import Form
.
.
class registrationForm(Form):
.
.

Alen


___
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 Florian Lindner
Am Samstag, 11. Februar 2006 00:29 schrieb Alen Stanisic:
 On Fri, 2006-02-10 at 22:18 +0100, Florian Lindner wrote:
  Thanks for your example. But I've the same error, a 404.
 
  in views.py:
 
  from zope.formlib.form import EditForm
  from interfaces import IRegistrationForm
 
  class registrationForm(EditForm):
  form_fields = IRegistrationForm
 
 
  in configure.zcml:
 
  page
  name=registrationForm.html
  class=.views.registrationForm
  permission=zope.Public
  layer=centershock
  for=CS.centershock.interfaces.ICentershock /
 
 
  And I try to call it with:
 
  /++skin++centershock/cs/registerForm.html whereas cs is a ICentershock
  object.
 
  It still gives a 404.
 
  Any guess what's wrong?

 What happens if you changed your view.py to:

 from zope.formlib.form import Form
 .
 .
 class registrationForm(Form):

I get a system error:

2006-02-11T00:41:25 ERROR SiteError 
http://horus:8080/++skin++centershock/cs/registrationForm.html
Traceback (most recent call last):
  File /home/florian/Zope3/src/zope/publisher/publish.py, line 138, in 
publish
result = publication.callObject(request, object)
  File /home/florian/Zope3/src/zope/app/publication/zopepublication.py, line 
161, in callObject
return mapply(ob, request.getPositionalArguments(), request)
  File /home/florian/Zope3/src/zope/publisher/publish.py, line 113, in 
mapply
return debug_call(object, args)
  File /home/florian/Zope3/src/zope/publisher/publish.py, line 119, in 
debug_call
return object(*args)
  File /home/florian/Zope3/src/zope/formlib/form.py, line 738, in __call__
self.update()
  File /home/florian/Zope3/src/zope/formlib/form.py, line 707, in update
self.setUpWidgets()
  File /home/florian/Zope3/src/zope/formlib/form.py, line 770, in 
setUpWidgets
adapters=self.adapters, ignore_request=ignore_request
  File /home/florian/Zope3/src/zope/formlib/form.py, line 337, in 
setUpEditWidgets
field = form_field.field
AttributeError: 'str' object has no attribute 'field'
127.0.0.1 - - [11/Feb/2006:00:41:25 +0200] 
GET /++skin++centershock/cs/registrationForm.html HTTP/1.1 500 89 - 
Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.3 (like Gecko)



I get it now with EditForm too (the backtrace above was produced with 
EditForm) I think I had a typo that caused the 404 in my last post, sorry!.

Florian
___
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 Alen Stanisic
On Sat, 2006-02-11 at 00:44 +0100, Florian Lindner wrote:
 I get a system error:
 
 2006-02-11T00:41:25 ERROR SiteError 
 http://horus:8080/++skin++centershock/cs/registrationForm.html
 Traceback (most recent call last):
   File /home/florian/Zope3/src/zope/publisher/publish.py, line 138, in 
 publish
 result = publication.callObject(request, object)
   File /home/florian/Zope3/src/zope/app/publication/zopepublication.py, 
 line 
 161, in callObject
 return mapply(ob, request.getPositionalArguments(), request)
   File /home/florian/Zope3/src/zope/publisher/publish.py, line 113, in 
 mapply
 return debug_call(object, args)
   File /home/florian/Zope3/src/zope/publisher/publish.py, line 119, in 
 debug_call
 return object(*args)
   File /home/florian/Zope3/src/zope/formlib/form.py, line 738, in __call__
 self.update()
   File /home/florian/Zope3/src/zope/formlib/form.py, line 707, in update
 self.setUpWidgets()
   File /home/florian/Zope3/src/zope/formlib/form.py, line 770, in 
 setUpWidgets
 adapters=self.adapters, ignore_request=ignore_request
   File /home/florian/Zope3/src/zope/formlib/form.py, line 337, in 
 setUpEditWidgets
 field = form_field.field
 AttributeError: 'str' object has no attribute 'field'
 127.0.0.1 - - [11/Feb/2006:00:41:25 +0200] 
 GET /++skin++centershock/cs/registrationForm.html HTTP/1.1 500 89 - 
 Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.3 (like Gecko)
 
 
 
 I get it now with EditForm too (the backtrace above was produced with 
 EditForm) I think I had a typo that caused the 404 in my last post, sorry!.
 
 Florian

In your view.py is the syntax when you set form_fields valid, I haven't
seen it before:

form_fields = IRegistrationForm

I usually do it by 

(from zope.formlib import form)
form_fields = form.Fields(IRegistrationForm)

Alen

___
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 Lorenzo Gil Sanchez
El vie, 10-02-2006 a las 22:18 +0100, Florian Lindner escribió:
 Am Freitag, 10. Februar 2006 20:10 schrieb Garanin Michael:

 And I try to call it with:
 
 /++skin++centershock/cs/registerForm.html whereas cs is a ICentershock object.
 
 It still gives a 404.
 
 Any guess what's wrong?
 

Stupid question: isn't '@@' a prefix for the views? Like:

/++skin++centershock/cs/@@registerForm.html 

Just a newbie observation...

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


Re: [Zope3-Users] Absolute url of an object

2006-02-10 Thread Paulus Zegwaard

Hi,

OK, thanks to Alen and with some further digging, I can sort of 
answering my own question, I found some answers here:

zope3-for-zope2-developers.pdf from Phillip von Weitershausen. Thanks
Phillip for thinking of these legions of poor old fashioned zopistas! ;-)

So for the other newbies out there (if they search the archives later):

   * from Python do this: zapi.getView(obj, 'absolute_url', request) #
 obviously import zapi first
   * from a page template: obj/@@absolute_url

Also without doing any extra, it seems that objects don't know their
name anymore. No getId() or title_or_id().
But as Alen pointed out the parent normally does some magic, so:
you have __name__  (id in Zope 2 speak)
and __parent__ (is obj.getParent() in Zope 2)

Mmm, I guess I'm gonna roll my own ordered containers and pages that
have a title attribute.

Cheers,

Paulus


Paulus Zegwaard wrote:

Hi,

Sorry if I ask a question that is already asked a gazillion times, but 
I was not able to find the obvious answer.


I'm rather new to Zope 3 and I have done a fair amount of Zope 2 
development and was used to be able to create dynamic menus by 
iterating over the objects in the root container (site root) and 
traversing all the way down (or as far as i wanted). That was sort of 
easy because every object in Zope 2 has an absolute_url method as well 
as a title_or_id method.


But although I understand Zope 3 has something like that too, I'm 
unclear how to achieve that every object provides an absolute_url 
method. Possibly Zope 3 has a far superior way of achiving the same 
goal. As a Zope 3 newbie I understand Zope 3 aims to require being 
explicit, yet I did like some of the implicit behavior of Zope 2 a 
lot. For instance I still think acquisition is bad by definition.. 
Maybe you should be able to turn it on or off at the folder level.


A related questions is: is there an obvious way to get the site url 
(or object) other then just knowing the name?


Can anyone point me in the right direction? BTW I have Stephan's book 
and ordered Phillip's book but that didn't arrive yet.


Thanks

Paulus
___
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