dexterity

Plone 4.3.4 - ImportError: No module named dexterity.localcommands.dexterity

旧巷老猫 提交于 2019-12-23 15:05:15
问题 On a vanilla Plone 4.3.4 site (Unified Installer on Ubuntu 14.04.1LTS), and after updating buildout.cfg with the zopeskel and paster boiler plate stuff and running buildout, I successfully created a dexterity package in my src folder: $ cd src $ ../bin/zopeskel dexterity my.package After updating buildout.cfg (adding my.package to the eggs section and src/my.package to the develop section) and running buildout, I tried to add content to my new package, like I have done so many times in Plone

Moving existing fields/behaviors in dexterity [duplicate]

随声附和 提交于 2019-12-23 12:30:12
问题 This question already has an answer here : Moving fields between fieldsets on Dexterity (1 answer) Closed 3 years ago . How can move an existing field (IDublinCore.rights) into another fieldset, after a specific field - Without writing my own Behavior (a copy of IDublinCore)? "Rights" fields should be appear after "image_caption" (own contenttype) This isn't working form.order_after(rights='image_caption') 回答1: How about using Jquery? (Since the fieldsets are using Jquery anyway) For example

Restrict upload by filetype or mimetype using Dexterity on Plone

微笑、不失礼 提交于 2019-12-22 09:25:17
问题 I have a custom content type, built with dexterity. In the schema (The schema is listed below), I use ' plone.namedfile.field.NamedFile ' for attachements/uploads. I would like to restrict uploads so that only mp3 files can be attached to my content type. What is the best approach for achieving this? Here is the full schema/model for my content type: <model xmlns="http://namespaces.plone.org/supermodel/schema"> <schema> <field name="date" type="zope.schema.Date"> <description /> <title>Date<

How do you override the default value of a field in a dexterity behavior in Plone?

核能气质少年 提交于 2019-12-22 08:07:33
问题 We have a requirement for a dexterity content type to have exclude from navigation behaviour but for the exclude_from_nav field's default value to be True . In the behaviour plone.app.dexterity.behaviors.exclfromnav.IExcludeFromNavigation it defaults to False . Obviously I could create my own behaviour that copies IExcludeFromNavigation except for the default value but I was wondering if there was a way to do this based on reusing IExcludeFromNavigation . We have other content types that use

Problem with plone.indexer and Dexterity

雨燕双飞 提交于 2019-12-22 04:42:08
问题 I wish to enable a special index, called Sectors, for a attribute ('sectors') of my Dexterity based custom content-type. In my schema, inside types/mycontent.py I have: class IMyContent(form.Schema): """ My Content """ sectors = schema.Set( title=_(u"Sectors"), description=_(u"Select some sectors"), value_type=schema.Choice(vocabulary=vocs.sectors), required=True, ) (...) I then define the index in this way, inside indexers.py from plone.indexer.decorator import indexer from zr.content.types

How I order behavior IDublinCore in Dexterity Type?

廉价感情. 提交于 2019-12-19 19:44:35
问题 I'm writing a product using Python Dexterity Type, and I have Title and Description , this fields come from a behavior plone.app.dexterity.behaviors.metadata.IDublinCore , but I neeed reorder this fields with my fields. Example: My fields: document, collage, age, biography IDublinCore: Title, Description The order: collage, Title, document, age, biography, Description How I Do it? 回答1: Since you got your own Dexterity Type you can handle with form directives aka setting taggedValues on the

Render rich text widget manually in plone custom page

半世苍凉 提交于 2019-12-19 11:34:42
问题 I have a custom edit (browser page) for my dexterity content type. In template I have defined a form using Bootstrap and added some Angular JS code for form behavior. It is working. :) I need to replace a simple textarea with rich text widget. So how can I render in my template the rich text widget (one that is normally used in dexterity)? 回答1: If you are using Mockup (not sure if anybody use it on Plone 4) you can find tips there: Obtaining the "default" mockup TinyMCE configuration on Plone

How to add the is_folderish attribute to Dexterity objects?

試著忘記壹切 提交于 2019-12-13 19:50:45
问题 The .is_folderish attribute is used in many places. For example when setting an object as the default view or when activating discussions on an object. My first question is how to check is an object has that attribute set. I tried using the bin/instance debug with something like this: >>> app.site.news.is_folderish ... AttributeError: is_folderish I imagine that I can't reach attributes on that way because app.site.news is a wrapper to the object that has that attribute. My second question is

How to add new collection criteria in Plone 5?

拈花ヽ惹草 提交于 2019-12-13 15:23:33
问题 I add a new choice field named course to Dexterity Content Type File in a new created instance. In order to use the field "course" as criteria in /++add++Collection, I follow this guide and add these to the file registry.xml in plone/buildout-cache/eggs/plone.app.querystring-1.3.14-py2.7.egg/plone/app/querystring/profiles/default/registry.xml: <records interface="plone.app.querystring.interfaces.IQueryField" prefix="plone.app.querystring.field.course"> <value key="title">course</value> <value

Extending SearchableText using collective.dexteritytextindexer

a 夏天 提交于 2019-12-13 02:27:57
问题 I am trying to extend the SearchableText index for my content type. I have succeeded in getting multiple fields to be included by marking them as indexer:searchable="true" in the model file. However I can't extend the SearchableText from my type's py as follows: class IMyBehavior(form.Schema): dexteritytextindexer.searchable('description') description = schema.Text(title=u'Precis') alsoProvides(IMyBehavior, IFormFieldProvider) class MySearchableTextExtender(object): adapts(IMyBehavior)