plone

How to transform block of content from plone being inserted into diazo theme

非 Y 不嫁゛ 提交于 2019-12-01 09:13:12
I'm using a diazo (currently plone.app.theming 1.0b1-r48205) with Plone 4.1. I want to use exactly Plone's html for the search widget except that I'd like to replace <input> element used for the search button in the search widget with a <button> . The diazo docs seem to suggest you can do this. In my theme html file I have an empty <div id="portal-searchbox"></div> . In my rules.xml I have the following: <rules if-content="$enabled"> <replace css:theme="div#portal-searchbox"> <xsl:apply-templates css:select="div#portal-searchbox" /> </replace> <xsl:template css:match="div#portal-searchbox

How would you determine where each property and method of a Python class is defined?

一笑奈何 提交于 2019-12-01 08:56:39
Given an instance of some class in Python, it would be useful to be able to determine which line of source code defined each method and property (e.g. to implement 1 ). For example, given a module ab.py class A(object): z = 1 q = 2 def y(self): pass def x(self): pass class B(A): q = 4 def x(self): pass def w(self): pass define a function whither(class_, attribute) returning a tuple containing the filename, class, and line in the source code that defined or subclassed attribute . This means the definition in the class body, not the latest assignment due to overeager dynamism. It's fine if it

unsupported hash type when installing plone

Deadly 提交于 2019-12-01 08:23:55
I tried to install plone but I have a problem when I run the script install.sh. Here are the errors details: raise ValueError('unsupported hash type %s' % name) ValueError: unsupported hash type sha256 ERROR:root:code for hash sha384 was not found ValueError: unsupported hash type sha512 I read in a forum that this error may be caused by a version of Plone which is not compatible with the python version that is on the OS. But, here is what is said on the official website of plone: The Plone Unified Installer is a source-installation kit that installs Plone and its dependencies from source on

Can buildout create content as part of a Plone install?

倖福魔咒の 提交于 2019-12-01 07:32:34
I'm trying to achieve a repeatable deployment of Plone for a site, and using buildout, basically following Martin Aspeli's book Professional Plone 4 Development . I can set up the system with my source products <site>.policy and <site>.theme , and have activated the theme automatically, but when I run buildout, I still have to instantiate a Plone site and activate the policy product, before creating the standard objects for the site. Can buildout check for the existence of content objects like the Plone site object or particular folders during setup, and create them if they don't exist with

Moving fields between fieldsets on Dexterity

耗尽温柔 提交于 2019-12-01 06:59:29
In Archetypes, in order to move a field from a fieldset (or schemata) to another, we can do the following: schema['creators'].schemata = 'default' However, I'm not achieving the same using Dexterity. I've tried using form hints. Ex: form.fieldset('default', fields=['creators'] ) I notice that it doesn't work because the field "creators" is unknown at this time. (The ownership behavior wasn't evaluated yet). Nevertheless, with form hints, I can move from "default" to another (eg. "ownership"). myfile = NamedFile(title=_(u"A file")) form.fieldset('ownership', fields=['myfile']) How can I do that

Adding an class to body element with XDV

六眼飞鱼酱① 提交于 2019-12-01 06:51:52
问题 I want to style some forms in Plone3+collective.xdv but I don't want all forms to get the special style. So I'd like to add a special styled-form class name to the class attribute of the body element just when displaying certain templates: contact-info sendto_form PFG forms So I thought that I could manage to perform this with XDV in order not to modify those templates. By using the if-content directives in XDV rules I can check if those templates are being displayed: css:if-content="body

unsupported hash type when installing plone

血红的双手。 提交于 2019-12-01 06:15:02
问题 I tried to install plone but I have a problem when I run the script install.sh. Here are the errors details: raise ValueError('unsupported hash type %s' % name) ValueError: unsupported hash type sha256 ERROR:root:code for hash sha384 was not found ValueError: unsupported hash type sha512 I read in a forum that this error may be caused by a version of Plone which is not compatible with the python version that is on the OS. But, here is what is said on the official website of plone: The Plone

Best way to count page view in Plone

落爺英雄遲暮 提交于 2019-12-01 05:12:59
问题 I'm working in a case require fairy complex use of page views. Each content object will have page view, and this should be accessed easily so that we can do various things related to it (sorted on catalog result, display, calculate popular metter ...). The closest equivalent is the youtube video's view. I'm thinking of some possible ways to implemented this: Use annotation storage & indexer to create portal_catalog index & metadata. Use indexer only (either use volatile attribute or update

Can buildout create content as part of a Plone install?

纵然是瞬间 提交于 2019-12-01 05:06:07
问题 I'm trying to achieve a repeatable deployment of Plone for a site, and using buildout, basically following Martin Aspeli's book Professional Plone 4 Development . I can set up the system with my source products <site>.policy and <site>.theme , and have activated the theme automatically, but when I run buildout, I still have to instantiate a Plone site and activate the policy product, before creating the standard objects for the site. Can buildout check for the existence of content objects

Moving fields between fieldsets on Dexterity

*爱你&永不变心* 提交于 2019-12-01 04:51:51
问题 In Archetypes, in order to move a field from a fieldset (or schemata) to another, we can do the following: schema['creators'].schemata = 'default' However, I'm not achieving the same using Dexterity. I've tried using form hints. Ex: form.fieldset('default', fields=['creators'] ) I notice that it doesn't work because the field "creators" is unknown at this time. (The ownership behavior wasn't evaluated yet). Nevertheless, with form hints, I can move from "default" to another (eg. "ownership").