-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from collective/vocabulary-lookup-fix
Vocabulary lookup fix in `++add++` forms
- Loading branch information
Showing
25 changed files
with
408 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Generated from: | ||
# https://github.com/plone/meta/tree/main/config/default | ||
# See the inline comments on how to expand/tweak this configuration file | ||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
# Check for updates to GitHub Actions every week | ||
interval: "weekly" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fix the DictRowConverter when the field schema changes fields and no value | ||
for the new column field is available yet. | ||
[petschki] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
configure with `plone/meta`. | ||
[petschki] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
For the JSON deserializer, skip empty values from non-required fields. | ||
This fixes a problem where empty non-required fields would break deserialization. | ||
[thet] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Fix bug in vocabulary lookup on `++add++` forms. Override `IFieldPermissionChecker` | ||
the same as for `IDexterityContent`. | ||
[petschki] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from collective.z3cform.datagridfield.datagridfield import DataGridFieldWidgetFactory | ||
from collective.z3cform.datagridfield.row import DictRow | ||
from plone.app.z3cform.widgets.select import AjaxSelectFieldWidget | ||
from plone.autoform import directives | ||
from plone.autoform.interfaces import IFormFieldProvider | ||
from plone.namedfile import field as namedfile | ||
from plone.supermodel import model | ||
from z3c.relationfield.schema import RelationChoice | ||
from z3c.relationfield.schema import RelationList | ||
from zope import schema | ||
from zope.interface import Interface | ||
from zope.interface import provider | ||
from zope.schema.vocabulary import SimpleVocabulary | ||
|
||
|
||
class ITableRow(Interface): | ||
col1 = schema.TextLine(title="Column1") | ||
col2 = schema.Choice( | ||
vocabulary=SimpleVocabulary.fromValues(["yes", "no"]), required=False | ||
) | ||
links = RelationList( | ||
title="Related Links", | ||
value_type=RelationChoice( | ||
vocabulary="plone.app.vocabularies.Catalog", | ||
), | ||
required=False, | ||
) | ||
|
||
tags = schema.Tuple( | ||
title="Tags", | ||
value_type=schema.TextLine(), | ||
required=False, | ||
) | ||
|
||
directives.widget( | ||
"tags", | ||
AjaxSelectFieldWidget, | ||
vocabulary="plone.app.vocabularies.Keywords", | ||
) | ||
|
||
image = namedfile.NamedBlobImage( | ||
title="Image", | ||
required=False, | ||
) | ||
|
||
|
||
@provider(IFormFieldProvider) | ||
class IDatagridfieldMetadata(model.Schema): | ||
|
||
tabular_field = schema.List( | ||
title="datagridfield", | ||
value_type=DictRow(schema=ITableRow), | ||
required=False, | ||
) | ||
directives.widget( | ||
"tabular_field", | ||
DataGridFieldWidgetFactory, | ||
auto_append=True, | ||
allow_reorder=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# from collective.z3cform.datagridfield.datagridfield import DataGridFieldWidgetFactory | ||
# from collective.z3cform.datagridfield.demo.interfaces import ITableRow | ||
# from collective.z3cform.datagridfield.row import DictRow | ||
# from plone import schema | ||
# from plone.autoform import directives | ||
from plone.dexterity.content import Item | ||
from plone.supermodel import model | ||
from zope.interface import implementer | ||
|
||
|
||
class IDGFTest(model.Schema): | ||
"""Marker interface and Dexterity Python Schema for DGFTest""" | ||
|
||
# You can define the fields in the schema interface directly or load an XML | ||
# file ... see below | ||
# tabular_field = schema.List( | ||
# title="datagridfield", | ||
# value_type=DictRow(schema=ITableRow), | ||
# required=False, | ||
# ) | ||
# directives.widget( | ||
# "tabular_field", | ||
# DataGridFieldWidgetFactory, | ||
# auto_append=True, | ||
# allow_reorder=True, | ||
# ) | ||
|
||
model.load("dgftest.xml") | ||
|
||
|
||
@implementer(IDGFTest) | ||
class DGFTest(Item): | ||
"""Content-type class for IDGFTest""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<model xmlns="http://namespaces.plone.org/supermodel/schema" | ||
xmlns:form="http://namespaces.plone.org/supermodel/form" | ||
xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
xmlns:security="http://namespaces.plone.org/supermodel/security" | ||
i18n:domain="collective.z3cform.datagridfield" | ||
> | ||
<schema> | ||
<field form:widget="collective.z3cform.datagridfield.datagridfield.DataGridFieldWidgetFactory" | ||
name="table" | ||
type="zope.schema.List" | ||
> | ||
<title>Tabular Field</title> | ||
<description /> | ||
<value_type type="collective.z3cform.datagridfield.row.DictRow"> | ||
<schema>collective.z3cform.datagridfield.demo.interfaces.ITableRow</schema> | ||
</value_type> | ||
</field> | ||
</schema> | ||
</model> |
Oops, something went wrong.