zope

SQLAlchemy, Serializable transactions isolation and retries in idiomatic Python way

帅比萌擦擦* 提交于 2020-01-02 04:04:22
问题 PostgreSQL and SQL defines a Serializable transaction isolation level. If you isolate transactions to this level, conflicting concurrent transactions abort and need retrying. I am familiar with the concept of transaction retries from Plone / Zope world where the entire HTTP request can be replayed in the case there is a transaction conflict. How similar functionality could be achieved with SQLAlchemy (and potentially with zope.sqlalchemy)? I tried to read the documentation of zope.sqlalchemy

Cascading Dropdown List

六眼飞鱼酱① 提交于 2019-12-31 03:25:26
问题 I am working on a web app and trying to code a form with two dropdown lists. The list in the second dropdown will be dependent on the selection from the first one. The task itself isn’t too complicated except that once the first selection is made, I need to make a database call to pull the data for the second dropdown. This is where I am having difficulty. Both lists are in fact populated from a database. I am working on this in a python script and have been trying to do this w/ an onChange

Backing up (and restoring) a Plone instance

旧城冷巷雨未停 提交于 2019-12-29 09:19:41
问题 I have a Plone installation in my home directory under Linux. ~/Plone . This was made from a default distribution of Plone from its website. So Plone compiled own python and is bundeled with Zope. Please tell me, which files are necessary to backup if I want to: 1) Backup the whole data ever stored in my Plone instance; 2a) Restore the backed-up data in a same version of Plone, but located elsewhere. 2b) Restore the backed-up data in a (slightly) newer version of Plone. I thought, maybe it's

How to set the sharing rights of a folder in Plone?

自作多情 提交于 2019-12-29 09:03:19
问题 I want to set sharing rights of many folders by using a Python script in a Plone site. 回答1: You need to look at the AccessControl/rolemanager.py module for details; the sharing tab in Plone is a friendly wrapper around that API. To add roles for a given userid, call manage_addLocalRoles: context.manage_addLocalRoles('userid', ('Role1', 'Role2',)) The other two important methods are manage_setLocalRoles(userid, roles) (replace the current set of roles completely) and manage_delLocalRoles

How to set the sharing rights of a folder in Plone?

人盡茶涼 提交于 2019-12-29 09:02:54
问题 I want to set sharing rights of many folders by using a Python script in a Plone site. 回答1: You need to look at the AccessControl/rolemanager.py module for details; the sharing tab in Plone is a friendly wrapper around that API. To add roles for a given userid, call manage_addLocalRoles: context.manage_addLocalRoles('userid', ('Role1', 'Role2',)) The other two important methods are manage_setLocalRoles(userid, roles) (replace the current set of roles completely) and manage_delLocalRoles

Can't disable permissions of parent folder in Plone

血红的双手。 提交于 2019-12-25 00:35:42
问题 In the Sharing-Setup of my folders and contents, I can't remove the permissions of the parent folder. When I untick the box and press save, it seems to load something but when I reload the sharing page, the box is ticked again. 回答1: I solved the problem by updating to Plone version 4.3.2. There was an error in file plone/app/workflow/browser/sharing.py as described on this GitHub page. Thanks for your help guys! 来源: https://stackoverflow.com/questions/20805351/cant-disable-permissions-of

Importing ping module in RestrictedPython script in Plone

霸气de小男生 提交于 2019-12-24 20:12:17
问题 I would like to check internet connexion from my plone site. I tried a ping in a python script ## Script (Python) "pwreset_action.cpy" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##title=Reset a user's password ##parameters=randomstring, userid=None, password=None, password2=None from Products.CMFCore.utils import getToolByName from Products.PasswordResetTool.PasswordResetTool import InvalidRequestError,

Plone - Overriding skins.xml of another product

ぃ、小莉子 提交于 2019-12-24 12:44:21
问题 In using Plone, I had the need to use image maps. So I added this product to my build. However, I noted that I was not able to use the product in my application. After investigation, I noticed that this particular product had specified specific themes to be used i.e. the plone default themes. Here is the skins.xml from the product: <?xml version="1.0"?> <object name="portal_skins" allow_any="False" cookie_persistence="False"> <object name="zopyx_tinymceplugins_imgmap" meta_type="Filesystem

plone change in code not visible in development site

北城余情 提交于 2019-12-20 05:45:30
问题 I am very new to plone. I have a project folder in eclipse. I have imported it from the cvs project. I have zope as server and I start zope with ./bin/instance restart . When I make changes in my folder, I cannot see the changes in the development website. I can't seem to find what is happening. I even restarted zope after making changes in python. Can anyone help me with this? 回答1: Make sure you start your Zope server with bin/instance fg , most likely the name of the script if you used the

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