dexterity

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").

Provide a default value on a field also on edit form

China☆狼群 提交于 2019-12-01 01:09:32
So I have a form (just getting the example from plone.directives.form ): from plone.directives import form from zope import schema class IMySchema(form.Schema): title = schema.TextLine(title=u"Title") @form.default_value(field=IMySchema['title']) def default_title(data): return data.context.suggested_title Which works fine only for add forms. So the question is: how can I make this same method be also used on an edit form? I do not generate the edit form by myself if that's relevant to the matter. Edit: I forgot something that it's quite relevant: the value entered in the field is stored

Generate PDF from Plone content types

。_饼干妹妹 提交于 2019-12-01 00:15:00
I need to create PDFs from content types (made with dexerity if that matters) so that the user creates a new document and after filling the form a PDF is generated and ready to be downloaded. So basically after creating/modifying the document a PDF should be created and stored in ZODB (actually I'm using blobs) so that I could link the view with a "Download as PDF". I've seen PDFNode but it doesn't seem to be what I'm looking for. There's also Produce & Publish but it's a webservice(?) and the company I'm going to develop this for doesn't want (for privacy) to send data outside their

Provide a default value on a field also on edit form

↘锁芯ラ 提交于 2019-11-30 21:03:22
问题 So I have a form (just getting the example from plone.directives.form): from plone.directives import form from zope import schema class IMySchema(form.Schema): title = schema.TextLine(title=u"Title") @form.default_value(field=IMySchema['title']) def default_title(data): return data.context.suggested_title Which works fine only for add forms. So the question is: how can I make this same method be also used on an edit form? I do not generate the edit form by myself if that's relevant to the

Generate PDF from Plone content types

戏子无情 提交于 2019-11-30 18:54:39
问题 I need to create PDFs from content types (made with dexerity if that matters) so that the user creates a new document and after filling the form a PDF is generated and ready to be downloaded. So basically after creating/modifying the document a PDF should be created and stored in ZODB (actually I'm using blobs) so that I could link the view with a "Download as PDF". I've seen PDFNode but it doesn't seem to be what I'm looking for. There's also Produce & Publish but it's a webservice(?) and