Open yurj opened 6 months ago
With plone.autoform
schema hints its event simpler to customize widget attributes. See the new enhanced demo
module in my latest PR ... I'll extend this with schema.xml
files too to outline the usage of DGF better for behaviors, contenttypes, controlpanels etc ... https://github.com/collective/collective.z3cform.datagridfield/blob/vocabulary-lookup-fix/src/collective/z3cform/datagridfield/demo/content.py#L46
I've opted out the demo
module, so it has to be included explicitely in buildout with
[instance]
zcml +=
collective.z3cform.datagridfield.demo
or in your integration packages zcml with
<include package="collective.z3cform.datagridfield.demo" />
then you can install the demo package in the addons and you have the behavior registered for Document
and a new DGFTest
contenttype ... I'll come up with some more tests too.
That's very good. I'm still using the approach above but this is definitively the way to go. Thanks!
Hi!
the documentation in collective.z3cform.datagridfield is add/edit form oriented. What about a common integrator that want to add a DGF field in a content type?
What I've found it works (with widget parameters customization):
ITableRowSchema:
and in widget.py:
If you don't need widget customization, it is simpler:
What works but you cannot change widget defaults with hints:
xml schema:
widget interfaces:
Note: here we have "servizi" + "table" but "it works". It works also if you change "table" in the xml schema above with "servizi", this is totally obscure to me, sorry my fault.
I'm aware it should work without behaviours (see: https://github.com/kombinat/collective.coursetool/blob/main/src/collective/coursetool/content/course.py#L57) but I still have to get it after several hours of reading and breakpoints (my fault).
Another missing piece (my opinion) is some hints on how to manage schemas (xml, profiles, object schema from model.schema).