dexterity

ComponentLookupError: (<InterfaceClass zc.relation.interfaces.ICatalog>, '') with Dexterity references

旧城冷巷雨未停 提交于 2019-12-12 18:12:25
问题 The following is a snippet from a dexterity content type which I'm working on. There are two content types, Programmes and Projects. It should be possible to associate a Project with a Programme (I've defined that below as a RelationChoice). from five import grok from plone.directives import dexterity, form from zope import schema from zope.schema.interfaces import IContextSourceBinder from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm from zope.interface import invariant,

Title and description aren't indexed with collective.dexteritytextindexer

不羁岁月 提交于 2019-12-12 09:47:19
问题 I have lots of Dexterity content types, some of them are just containers and are left with just the Title and Description (from plone.app.dexterity.behaviors.metadata.IBasic behavior). I can find them by searching the text inside their title or description. But for some complex content types I'm using collective.dexteritytextindexer to index some more fields and it works fine, I can find the text on the fields I marked to be indexed. However the Title and Description are no longer available

How can I change the URL of an object serverd by Dexterity in Plone

心不动则不痛 提交于 2019-12-12 03:58:58
问题 I defined some content types based on Plone Dexterity, I want any content type has his own ID. So I used the zope.schema.Id . class IArticle(form.Schema, IImageScaleTraversable): """ Article """ form.model("models/article.xml") id = schema.Id( title=_(u"Identifier"), description=_(u"The unique identifier of object."), required=False ) When I create a new article object, it works fine, but when I want to modify the Id of an existed article, It always show me error: {'args': (

How light weighted Dexterity-base contenttype can be

妖精的绣舞 提交于 2019-12-10 17:15:40
问题 I'm trying to write a light weight content type that work similar to Facebook's post. The whole content schema is just a text field. There's no title, description. It must be Contentish and is managed by CMFCore: It must have an FTI, a portaltype so that we can create/browse content through standard method; it is catalog-aware. They will have relation/reference within each others. The number of objects is gonna be huge, say 10-100M. The most similar things to this is the comment object (plone

How do I add keywords to SearchableText for a Dexterity content type?

隐身守侯 提交于 2019-12-10 14:19:24
问题 I have a site running Plone 4.1 which has a custom content type developed with Dexterity 1.1. My content authors can add keywords to basic Plone pages using the Categorization tab and users successfully find these pages if they search using one of the keywords. My content authors have also produced pages using a Dexterity custom content type I developed. This was defined using a Python-based file system schema. If users search for terms in the title and description of a Dexterity content type

Migrating Archetype news items to Dexterity content types

*爱你&永不变心* 提交于 2019-12-09 18:25:44
问题 I'm trying to copy the content in news items to other content type that I wrote. In my script I have the news item and the project item. The second, project , is a content type defined using Dexterity. It would be wonderful if I could to copy the image and the body text from news to project in the next way. project.text = news.text project.image = news.image Where text and image are defined in the project schema as RichText and NamedBlobImage. I don't know how the attributes are in the news

Plone 4 dexterity viewform - add css Class to widget in fieldset X

梦想的初衷 提交于 2019-12-08 01:55:15
问题 I have a dexterity based content type with different edit views and fieldsets defined in the schema. Whenever I want to update a widget/field in another than the first fieldset, it gets crumpy. For example: self.groups[0].fields['my_field'].mode = HIDDEN_MODE must be used to hide my_field from the 2nd fieldset. To make the same field required self.schema['my_field'].required = True does the trick. But how can I add a css class to a widget on another than the first fieldset? I mean, what self

Preventing users to upload BMP, TIFF etc. images to ImageField in Plone

≯℡__Kan透↙ 提交于 2019-12-07 10:15:35
问题 The users do it because they can. However, image auto-resize etc. breaks down. This make me a sad boy. How to limit image uploads to GIF, PNG and JPEG sitewide? For Archetypes For Dexterity 回答1: i ran into similar problems these days and worked around them like that: add a custom widget that adds an accept attribute to the file input set field.swallowResizeExceptions = True so users at least don't get a site-error when uploading an unsopported image type state mimetypes that work in

How can I add a Dexterity content type as the default view?

浪子不回头ぞ 提交于 2019-12-06 13:41:42
问题 I'm trying to set a folder default view as a Dexterity content type that I created. But I see that Dexterity content types aren't in the list of possible default content views for folders. Why? Is there an option that I must set in the content type? 回答1: Content items are listed as candidate default pages if: the object is not a container type or the object portal type is listed in the default_page_types of your site_properties property sheet. Find that in the ZMI (site settings -> Zope

Can not activate discussions on Plone Dexterity types (folderish)

隐身守侯 提交于 2019-12-06 02:16:41
问题 I have been working on a dexterity based plone application. I have created a couple of new types. This is what I did to activate comments on a specific dexterity content type named "activity_report": In Plone Control Panel In the Discussion section I enabled the following: globally enable comments enable anonymous comments In the Types Section I chose the "Activity Report" type from the drop down and enabled the "Allow comments" option. On the file system In the FTI file activityreport.xml: