Re: [Zope3-Users] Re: ZODB? PostgreSQL? (Laurence Rowe)

2007-04-26 Thread Chris Withers

Mark, Jonathan (Integic) wrote:

My interpretation of this statement is as follows. You can store
information in separate partitions of the ZODB, and ZEO will route
requests to the appropriate partition.


Correct, as Philipp described.


Is that true only for Zope 3, or is it true for Zope 2.1x as well?


It's been correct for everything from about Zope 2.0.something, and 
maybe even before that too ;-)



Would Zope applications need to be rewritten to support multiple
partitions? Or is it all transparent to the developer?


Totally transparent.


Has anyone actually ever tried that on a massive scale? What are the
largest and busiest functional partitioned ZODB instances in active use?


I routinely do this with storages that are several gigs in size. I've 
had recent reports of an active storage that's set up this way which is 
in excess of 200GB.


cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] "Wrong contained type" - why?

2007-04-26 Thread Rupert Redington
Hermann Himmelbauer wrote:
> Hi,
> As already mentioned before, I use interfaces that contain lists of other 
> interfaces via the following syntax:
> 
> emails = List(value_type=Object(schema=IEmail))
> 
> In my formlib-based class, I have use the following, so that the widgets are 
> displayed correctly:
> 
> email_widget = CustomWidgetFactory(ObjectWidget,Email)
> emails_widget = CustomWidgetFactory(ListSequenceWidget, 
> subwidget=email_widget)
> 
> and in the form.Form based class:
> 
> form_fields['emails'].custom_widget = emails_widget
> 
> The widgets are displayed perfectly, but when I try to update the data, the 
> validation fails with the following error:
> 
> "Wrong contained type"
> 
> I don't know how to get around this, especially I don't find a good entry 
> point to this problem - it seems that this error comes from the 
> widget.getInputValue() function - is that true?
> 
> All objects in my example are of the type Interface, perhaps I have to define 
> them as containers? 
> 
> Another thing I don't know is how I can omit fields from the email_widget, is 
> there a simple solution?
> 
> Best Regards,
> Hermann
> 

Hi Guys,

Curiously I seem to have run into a similar problem to Hermann's at
about the same time...

I too am using a Custom ObjectWidget in a ListSequenceWidget:

viewassociation_widget = CustomWidgetFactory(ObjectWidget, ViewAssociation)
elements_widget = CustomWidgetFactory(ListSequenceWidget,
subwidget=viewassociation_widget)

and placing it into my formlib.EditForm :

form_fields['elements'].custom_widget = elements_widget


The fields in the ObjectWidget are drawn from IViewAssociation :

class IViewAssociation(Interface):
"""Stores information about an editor's choice of view
   for an item within a section
"""

viewtype = Choice(
title=_(u"View Type"),
description=_(u"A type for the view"),
required = True,
values = [u'insert', u'thumbnail', u'link']
)

item = Choice(
title=_(u"Content Item"),
description=_(u"The item providing data for this view element"),
required = True,
vocabulary = u'Clipboard',
)

section = Attribute(u'The Section Object using this Association')


The form renders correctly, which is nice, but only validates and
creates and add the ViewAssociation objects if I knock out the 'item' field.

When I include the 'item' field in the schema validation fails with
"Wrong contained type". Here's the current simplified testing version of
the "Clipboard" vocabulary.

session = z3c.zalchemy.getSession
class ClipboardVocabFactory(object):
implements(IVocabularyFactory)

def __call__(self, context):
items = [x for x in session().query(ArchiveObject).select()]
voc = SimpleVocabulary.fromValues(items)
return voc


ViewAssociation objects can accept ArchiveObjects in their item
attribute in my unit tests...

To (spookily) increase the similarity of my case to Hermann's I too
would like to control the subwidgets in the Custom ObjectWidget - in my
case by using a RadioWidget for the viewtype field - but I can't quite
work out how.

viewassociation_widget = CustomWidgetFactory(ObjectWidget,
ViewAssociation, viewtype_widget=RadioWidget)

raises:

TypeError: Unable to configure a widget for viewtype - attribute
viewtype_widget does not implement IWidget

Thanks for fighting through this overlong post.
Can anyone help?

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


[Zope3-Users] Re: Utility Local to an Annotation?

2007-04-26 Thread Derek Richardson

Benji York wrote:

Derek Richardson wrote:
The specific case is uuids for atom feed entries. We have annotations 
representing feeds and I would like my uuid utility to be local to the 
feed annotation, thus recording and making available uuids only for 
entries in that feed.


How about a multi-adapter from content and feed to UUID?


Hmmm, to do that I have to be able to annotate an annotation, right? As 
the feed is an annotation and that is where I want to store the UUIDs. I 
tried this tonight and was unable to make it work - I got the following:


blah, blah, blah
  File 
"/Users/dkr/Zope-3.3.1/build/lib.darwin-8.8.1-i386-2.4/zope/security/adapter.py", 
line 84, in __call__

adapter = self.factory(*args)
  File 
"/Users/dkr/Zope-3.3.1/build/lib.darwin-8.8.1-i386-2.4/zope/annotation/factory.py", 
line 38, in getAnnotation

annotations = IAnnotations(context)
TypeError: ('Could not adapt', 
, 
)


Did you have something else in mind? Or is annotating an annotation 
possible and something is wrong in my implementation?


Thanks,

Derek

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