AW: [Zope3-Users] Skin based on IPageletBrowserLayer

2007-07-05 Thread Roger Ineichen
Hi Hermann

 Betreff: [Zope3-Users] Skin based on IPageletBrowserLayer
 
 Hi,
 In my views, based on pagelets/z3c.form, it is recommended to 
 use a Layer/Skin based on IPageletBrowserLayer instead of 
 IDefaultBrowserLayer.
 
 My problem is that when requests are marked with 
 IPageletBrowserLayer, there are no error messages, no 404's, 
 nothing. In case of a zope error, the browser displays 
 Traversal error - A server error occurred but in the 
 transcript.log, no error is printed.
 
 If I point my browser to an unknown page, an empty paget is 
 returned, again without an error.
 
 What can I do about this?

Go to the page which shows the wrong/bad page and use the 
following addition in the url:

http://localhost:8080/++skin++yourskin/++debug++source/mypage.html

++debug++source forces to include additional information
about the locations of each html fragment.

Go to the html source of your page and see where the pagelet come form.
Based on this info, check the registration of your paglet. Probably
there is a pagelet registered for everything which overrides the 
error view.


Regards
Roger Ineichen
_
END OF MESSAGE

 Best Regards,
 Hermann
 
 --
 [EMAIL PROTECTED]
 GPG key ID: 299893C7 (on keyservers)
 FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7 
 ___
 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] z3c.form and subforms in an AddForm?

2007-07-05 Thread Maciej Wisniowski

 On Tuesday 03 July 2007 05:38, Maciej Wisniowski wrote:
   
 TraversalError: (ErrorViewSnippet for RequiredMissing, 'widget')
 

 People that got this error had either old versions of the code (run buildout 
 without -N) and/or had a PYTHONPATH set. Please make sure you have no entry 
 in PYTHONPATH.
My PYTHONPATH is empty. I've not used buildout. I have
my old zope 3.3.1 installed and I've downloaded
packages from http://download.zope.org/distribution/
I have:
z3c.form
z3c.formui
z3c.macro
z3c.pagelet
z3c.template
z3c.viewlet
z3c.zrtresource

I've extracted these packages into my instance's /lib/python folder.
I've also put z3c.formdemo into my instance.
 
My code still fails when submiting empty value for required field.
Formdemo fails as well.

I found in another post that you've changed something in i18n
so I have tried to get new zope.i18n package but with no effect.
What else should I have?

-- 
Maciej Wisniowski

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


Re: [Zope3-Users] z3c.form and subforms in an AddForm?

2007-07-05 Thread Stephan Richter
On Thursday 05 July 2007 06:59, Maciej Wisniowski wrote:
 I found in another post that you've changed something in i18n
 so I have tried to get new zope.i18n package but with no effect.
 What else should I have?

Okay, I would suggest the following:

1. Try to get the formdemo running with the buildout. Just to make sure this 
all has nothing to do with your Python and environment.

2. Get Zope 3.4.0b1 and see whether the demos are working.

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] z3c.form - Idea for subforms

2007-07-05 Thread Hermann Himmelbauer
Hi,
After playing around with subforms, I think some parts could be more implicit. 
What I don't like so much is that there's quite some boilerplate code which 
is not easily understandable for a newbie, moreover the explicit code is also 
hard to understand (at least for me) unless one does have a decent insight 
into the z3c.form package.

I have some ideas which could perhaps simplify subforms - however, I don't 
know if they work or break some key concepts:

1) Create seperate classes for form within form and logical units for each 
Add/Edit/Display, e.g.:

AddFormInForm / EditFormInForm / DisplayFormInForm
AddSubForm / EditSubForm / DisplaySubForm

I think this would provide a better understanding, as one can look at a class 
and immediately understand what they are ment for. Moreover various 
boilerplate code could be saved, e.g. like this in case of a AddSubForm:

def updateWidgets(self):
self.widgets = getMultiAdapter(
(self, self.request, self.getContent()), IWidgets)
self.widgets.ignoreContext = True
self.widgets.update()

2) Handling the creation / update of the subform in the update() method of the 
parent form is too explicit, I think. Another problem is the placing of the 
form in the HTML widget, this does not seem to work with a generator 
(tal:repeat), one has to insert them manually. In my case, where I don't want 
the subform at the top/bottom but in between other widgets, I probably have 
to write a lot of template code.

To my mind, it would be ideal, if Zope figures out all this for itself. I 
think that the interface itself provides all necessary information that Zope 
needs, e.g. in case of a field such as:

owner = Object(schema=IOwner)

Zope knows that there has to be a subform involved. My idea is to somehow 
register subforms to specific Interfaces/fields, but I'm not sure if that is 
possible. This could look something like this:

z3c:subform
   for = ICar,
   interface = IOwner,
   class = .browser.OwnerForm
   layer = ...
   /
  
In this case the update function would query for an appropriate adapter for 
the subform, moreover these subforms could also possibly be rendered just 
like any other widget, therefore no specific templates are needed.

3) I think SubForms should look/behave very similar to other forms, therefore 
it would be optimal if one could simply have a create() method in an 
AddSubForm where the object is created. This method would then be 
automatically be called by the parent form and the object would be stored in 
the object attribute.

What do you think?

Best Regards,
Hermann

-- 
[EMAIL PROTECTED]
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Thinking about blog entry structure

2007-07-05 Thread Florian Lindner
Hello,
I'm currently rethinking my Blog's structure for saving entries.
At the moment I use a flat structure with all entries represented by an 
instance. The naming scheme is like 2007_07_05_Title_of_entry example: [1]

But that is not something I really like and I think it will be unhandleable 
for large blogs.

What would you suggest as an organization?

Something like 2007/05/Title or even 2007/05/13/Title?

Thanks for ideas!

Florian


[1] http://xgm.de/Blog/2007_05_13_Zeit_für_eine_neue_Suchmaschine
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Thinking about blog entry structure

2007-07-05 Thread Matt Bowen

Hi Florian,

I know that the larger sites (e.g., blogger) use
root//MM/title-separated-by-dashes

If you expect to support really, really active sites you may want to add
Days in there so that it's slightly easier to find an entry. You may also
want to support supplemental URLs, such as root/category/NAME so that people
can find all of the posts in a given tag easily. I know that lifehacker does
something similar.

Just as a side note, you should use dashes instead of underscores to
separate words in the titles; Google interprets the dash as a space and the
underscore as a hyphen (backwards, I know)  -- see
http://www.movable-type-weblog.com/archive/entry/filename-with-underscore-or-dash.html

Good luck!
Matt

On 7/5/07, Florian Lindner [EMAIL PROTECTED] wrote:


Hello,
I'm currently rethinking my Blog's structure for saving entries.
At the moment I use a flat structure with all entries represented by an
instance. The naming scheme is like 2007_07_05_Title_of_entry example: [1]

But that is not something I really like and I think it will be
unhandleable
for large blogs.

What would you suggest as an organization?

Something like 2007/05/Title or even 2007/05/13/Title?

Thanks for ideas!

Florian


[1] http://xgm.de/Blog/2007_05_13_Zeit_für_eine_neue_Suchmaschine
___
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] z3c.form and subforms in an AddForm?

2007-07-05 Thread Matt Bowen

Stephan and Hermann,

Thank you both so much for all of your help; I can now display my object --
it turned out that my z3c.form had not put its configs in my
package-includes, so Stephan's #3 made my display work. Of course, I also
fixed some other things that you both suggested, so I know I had other
problems. Unfortunately, when I try to use either add or edit, I get the
following now:

for edit.html I get

127.0.0.1 - - [05/Jul/2007:21:03:22 -0400] GET
/++skin++MovingTargetBrowser/viewguy/edit.html HTTP/1.1 500 201 -
Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.4) Gecko/20070515
Firefox/2.0.0.4
exceptions.RuntimeError:
maximum recursion depth exceeded

/opt/zope/zope-3.4.0a1

/lib/python/zope/tal/talinterpreter.py(379)do_startEndTag()
- self.do_startTag(stuff, self.endsep, self.endlen)

I pasted the full trackback for edit here: http://paste.plone.org/15590

For addNextAction.html, I get

127.0.0.1 - - [05/Jul/2007:21:04:37 -0400] GET
/++skin++MovingTargetBrowser/viewguy/edit.html HTTP/1.1 500 201 -
Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.4) Gecko/20070515
Firefox/2.0.0.4
exceptions.RuntimeError:
maximum recursion depth exceeded

/opt/zope/zope-3.4.0a1

/lib/python/zope/tal/talinterpreter.py(226)StringIO()
- return FasterStringIO()

I pasted the full traceback for add here: http://paste.plone.org/15589

The tracebacks are 1600+ lines long, so I'm having a little trouble working
my way through them to decipher my error, so if anyone has any idea what
I've done wrong or has seen anything similar, I'd be grateful to hear.

Thank you all for all the help you've already given.

Best,
Matt

On 7/4/07, Stephan Richter [EMAIL PROTECTED] wrote:


On Wednesday 04 July 2007 12:59, Matt Bowen wrote:
   File /opt/zope/python2.4/lib/python2.4/site-packages/z3c.form-
 1.3.0-py2.4.egg/z3c/form/form.py, line 144, in __call__
 self.update()
   File /opt/zope/python2.4/lib/python2.4/site-packages/z3c.form-
 1.3.0-py2.4.egg/z3c/form/form.py, line 139, in update
 super(Form, self).update()
   File /opt/zope/python2.4/lib/python2.4/site-packages/z3c.form-
 1.3.0-py2.4.egg/z3c/form/form.py, line 88, in update
 self.updateWidgets()
   File /opt/zope/python2.4/lib/python2.4/site-packages/z3c.form-
 1.3.0-py2.4.egg/z3c/form/form.py, line 167, in updateWidgets
 self.widgets = zope.component.getMultiAdapter(
   File /opt/zope/zope-3.4.0a1/lib/python/zope/component/_api.py, line
 103, in getMultiAdapter
 raise ComponentLookupError(objects, interface, name)
 zope.component.interfaces.ComponentLookupError: ((
 z3c.pagelet.zcml.NextActionAddForm object at 0x2b69896b4850, 
 zope.publisher.browser.BrowserRequest instance URL=
 http://localhost:9080/++skin++MovingTargetBrowser/addNextAction.html, 
 zope.app.folder.folder.Folder object at 0x2b69896eb0c8),
InterfaceClass
 z3c.form.interfaces.IWidgets, u'')

This error tells you that the widget manager (implementing ``IWidgets``)
cannot be found for your (form, request, context) discriminator. This can
really just mean one of the following three things:

1. Your skin MovingTargetBrowser does *not* inherit from the
``IFormLayer``
skin. Can you show us your skin definition in Python and the registration
in
ZCML?

2. Your form does not provide ``IFieldsForm``. What does the following
return?

   from z3c.form import interfaces
   interfaces.IFieldsForm.providedBy(form)

  Can you paste your form Python code and the registration?

3. You did not hook up the ZCML files of z3c.form? Are you sure
z3c/form/configure.zcml is loaded? This can be checked by causing a syntax
error in that file and see whether the startup also breaks.

 I keep reading over the .txt files in z3c.form, and I feel like I may be
 missing some line. Do I need a datamanager? My schema is pretty
 straightforward:

No, the data manager and everything else is defined for the common case
you
are having.

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