in Education by
We have a requirement for a dexterity content type to have exclude from navigation behaviour but for the exclude_from_nav field's default value to be True. In the behaviour plone.app.dexterity.behaviors.exclfromnav.IExcludeFromNavigation it defaults to False. Obviously I could create my own behaviour that copies IExcludeFromNavigation except for the default value but I was wondering if there was a way to do this based on reusing IExcludeFromNavigation. We have other content types that use IExcludeFromNavigation where we do want it to default to False. We're using Plone 4.1rc3 and Dexterity 1.0 JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
See http://plone.org/products/dexterity/documentation/manual/developer-manual/advanced/defaults and http://pypi.python.org/pypi/plone.directives.form#value-adapters, but basically: @form.default_value(field=IExcludeFromNavigation['exclude_from_nav'], context=IMyType) def excludeFromNavDefaultValue(data): return True Cheers, Martin

Related questions

0 votes
    How Do You Override a Spring Boot Project’s Default Properties?...
asked Nov 15, 2020 in Technology by Editorial Staff
0 votes
    How can we override the default properties of Spring boot projects?...
asked Jul 23, 2021 in Technology by JackTerrance
0 votes
    What do you understand by Dictionary Override?...
asked May 24, 2021 in Technology by JackTerrance
0 votes
    When do you use SQL override in a lookup transformation?...
asked Mar 26, 2021 in Technology by JackTerrance
0 votes
    I am currently using a LINQ query to read an XML file e.g. some_text some_more_text into a list ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    This method is in a Scores class, that is set the class variable scores, but the scores is combination ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 11, 2022 in Education by JackTerrance
0 votes
    This method is in a Scores class, that is set the class variable scores, but the scores is combination ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    This method is in a Scores class, that is set the class variable scores, but the scores is combination ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    This method is in a Scores class, that is set the class variable scores, but the scores is combination ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    Does a tinymce plone plugin exist for this? I've done a quick search and come up empty. JavaScript ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    _______ allows you to modify the error behavior so that you can browse the function call stack (a) debug() ... of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
0 votes
    What are the different transformations where you can use a SQL override?...
asked Mar 27, 2021 in Technology by JackTerrance
0 votes
    I've noticed on Marshmallow (e.g. Nexus 6P) and also on some more recently updated Lollipop phones ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    How to override or replace the Embedded tomcat server in Spring Boot?...
asked Jul 7, 2021 in Technology by JackTerrance
...