zope

What is the best way to convert a zope DateTime object into Python datetime object?

痞子三分冷 提交于 2019-12-05 04:20:10
I need to convert a zope 2 DateTime object into a Python datetime object. What is the best way to do that? Thanks, Erika modernthingy = datetime.datetime.fromtimestamp(zopethingy.timeTime()) The datetime instance is timezone-naive; if you need to support timezones (as Zope2's DateTime does), I recommend third-party extension package pytz . Newer DateTime implementations (2.11 and up) have a asdatetime method that returns a python datetime.datetime instance: modernthingy = zopethingy.asdatetime() If you mean this one .strftime('%m/%d/%Y %H:%M') = 04/25/2005 10:19 then reverse is >>> time

Error notification on plone 4

女生的网名这么多〃 提交于 2019-12-04 10:52:58
问题 I just want to have email notification when an error is declared in plone 4. Any ideas of product or any "how-to" ? Thanks 回答1: You can easily configure the built-in email notification for Zope, but we found that adding the mailinglogger package makes the emails a lot more managable. The package adds: customisable and dynamic subject lines for emails sent emails sent with configurable headers for easy filtering flood protection to ensure the number of emails sent is not excessive support for

Do as many copies as the number of revisions exist for a file in plone?

a 夏天 提交于 2019-12-04 01:36:25
问题 In plone, how many physical copies of a file (or any content) exist if it is revised say 4 times? I am using plone 4.1 wherein the files and images are stored on the file system. 回答1: Content objects consist of multiple persistent records. For images and files that includes the binary blob file on the file system. When a content object is changed, only the persistent records that are affected by the change are written as part of the transaction. Older records are not cleared at that moment,

Error notification on plone 4

好久不见. 提交于 2019-12-03 07:02:56
I just want to have email notification when an error is declared in plone 4. Any ideas of product or any "how-to" ? Thanks You can easily configure the built-in email notification for Zope, but we found that adding the mailinglogger package makes the emails a lot more managable. The package adds: customisable and dynamic subject lines for emails sent emails sent with configurable headers for easy filtering flood protection to ensure the number of emails sent is not excessive support for SMTP servers that require authentication configurable log entry filtering The plone.recipe.zope2instance

An easy way to redirect certain roles in zope

只谈情不闲聊 提交于 2019-12-02 12:18:03
问题 I have a section of my zope 2 site which uses an interim macro between the 'content' and the site-wide macro. I don't want to apply security to the folder, but I would like the interim macro to redirect users to a login screen if they try to load a page that uses it. An example of this would be this: page_html contains the content, it uses the macro in special_template, which then slots into a macro in standard_template. Therefore I want it to redirect to the login screen. If page_html didn't

plone change in code not visible in development site

核能气质少年 提交于 2019-12-02 10:24:13
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? Make sure you start your Zope server with bin/instance fg , most likely the name of the script if you used the Plone universal installer buildout. To see changes in python code you'll either need to restart the server

circular import references from zope schemas

主宰稳场 提交于 2019-12-02 06:37:44
问题 i'm having a problem very similar to this SO question, but my attempts to apply these previous answers isn't going thru and it was suggested i start it as a new question: in the code below i define a couple of getChoices() functions that i thought would defer the circular refs, but no!? what's wrong here, please? # ns.content/ns/content/foo.py from zope import schema from plone.directives import form from z3c.relationfield.schema import Relation, RelationChoice from plone.formwidget

circular import references from zope schemas

好久不见. 提交于 2019-12-02 06:26:36
i'm having a problem very similar to this SO question , but my attempts to apply these previous answers isn't going thru and it was suggested i start it as a new question: in the code below i define a couple of getChoices() functions that i thought would defer the circular refs, but no!? what's wrong here, please? # ns.content/ns/content/foo.py from zope import schema from plone.directives import form from z3c.relationfield.schema import Relation, RelationChoice from plone.formwidget.contenttree import ObjPathSourceBinder class IFoo(form.Schema): def getBarChoices(): # avoiding circular refs..

An easy way to redirect certain roles in zope

北城余情 提交于 2019-12-02 03:56:33
I have a section of my zope 2 site which uses an interim macro between the 'content' and the site-wide macro. I don't want to apply security to the folder, but I would like the interim macro to redirect users to a login screen if they try to load a page that uses it. An example of this would be this: page_html contains the content, it uses the macro in special_template, which then slots into a macro in standard_template. Therefore I want it to redirect to the login screen. If page_html didn't use special_template, but went straight to standard_template (which is what most of the pages on the

Cascading Dropdown List

喜欢而已 提交于 2019-12-02 02:40:57
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 javascript function. The web app is built in Zope and page templates may be an option along w/ the