plone

How can I generate a registration number in PloneFormGen, using a TALES Expression?

爱⌒轻易说出口 提交于 2019-12-12 14:21:39
问题 I am trying to set up a registration form for a conference using PloneFormGen, and I would like to use a TALES Expression to count the number of existing records, add "1", then display this on the "Thank You" page as the registrant's registration number. Is this possible? I have used the following to generate a random 6 digit number in the past to create a case number ID for a support request, where the number didn't matter other than to track the request, then it would be deleted once the

How to use matplotlib in Plone

淺唱寂寞╮ 提交于 2019-12-12 13:47:52
问题 I am using Plone 4.3 with matplotlib. I have the plot window but I want to render the plot window in a page template. Some folks suggested I use HTML5 canvas to render the plot window in a template page. But I am unable to grasp that concept. So anyone can help me? 回答1: Create a browser view, set the header type, and return the image data e.g. from zope.publisher.browser import BrowserPage class PloneMatPlotLib(BrowserPage): """ """ def __call__(self): import cStringIO from matplotlib.figure

Plone 4: changing the login name on the @@personal-information form

僤鯓⒐⒋嵵緔 提交于 2019-12-12 13:22:29
问题 I have created a custom form to add fields to the @@personal-information form. I found that the login name can be changed by using set_own_login_name() which is provided by Products.CMFPlone.utils In my form adapter, I have something like this: def get_username(self): prop = self.context.getUserName() return prop def set_username(self, value): id = self.context.getProperty('id', '') value = id if (value == None) else value return utils.set_own_login_name(self.context, value) username =

How to define default views in Plone

天大地大妈咪最大 提交于 2019-12-12 11:51:27
问题 I have already a page template for the default view of a Plone site (main page). How to define the default view of a folder? This default view should use a page template. 回答1: Try this: navigate to the desired folder add "/manage_propertiesForm" at the end of the url in the resulting form add this property: name : "layout" type : "string" value : the page template name without extension 回答2: Use the answers above if you want to set one of the default views (tabular, thumbnail, etc), but if

Plone- How can I create a control panel for a record in registry that is a dictionary type?

浪尽此生 提交于 2019-12-12 11:51:24
问题 I am trying to create a control panel add-on on my Plone site for editing a registry record that is a dictionary type. My purpose is to store "types of suppliers" as a dictionary in registry. My registry.xml in profiles/default: <registry> <record interface="gpcl.assets.suppliertypes.ISupplierTypes" field="supplier_types"> <value> <element key="1">Distributor</element> <element key="2">Manufacturer</element> <element key="3">Service Provider</element> </value> </record> </registry> My

Zope.Schema/Plone - How can I set the value of a Datetime field in an updateWidget function?

本小妞迷上赌 提交于 2019-12-12 09:58:19
问题 On a plone site I am working on, I have a form that is used to edit records of objects stored mapped to a table in the backend database. In the interface class, one of the fields is a schema.Datetime field. class ICalibration(Interface): """Interface class for calibration records """ ... Last_Calibration = schema.Datetime(title=u"Last Calibration" description=u"date of last calibration", ) ... In my updateWidgets function, in the edit form, I try to set the value of the widget, class

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': (

plone Assertion error in themes

℡╲_俬逩灬. 提交于 2019-12-12 03:07:28
问题 Iam new to Plone. I installed Plone 4 and i have gone through http://noenieto.com/blog/theming-plone-4 and created theme product. When i run ./bin/buildout, iam getting the error as Develop: '/usr/local/Plone/zinstance/src/plonetheme.hanging' error in plonetheme.hanging setup command: Distribution contains no modules or packages for namespace package 'plonetheme' While: Installing. Processing develop directory '/usr/local/Plone/zinstance/src/plonetheme.hanging'. An internal error occured due

Why are command line instructions not affecting my Plone site?

孤人 提交于 2019-12-12 01:44:42
问题 I'm using Bika Lab System which uses Plone, running on Ubuntu 14.04 (on a virtual machine) and NGINX 1.4.6. Plone is setup as a cluster, not an instance. I'm trying to terminate Plone using the command line ./bin/plonectl stop but even though the terminal says that Plone is not running, the website still works normally. What am I doing wrong? 回答1: Is it possible that you started your components in foreground mode and that they are running in other (or disconnected) console sessions? If that's