Archetypes API provides default_method() to populate initial values programmatically.
However, since this is a class method, it is not suitable for archetypes.schemaextender. What would be the equivalent approach with the extender?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If there is no field.default nor field.default_method you can use IFieldDefaultProvider adapter. See this snippet of code from Archetypes.Field.Field class, getDefault method:
and also IFieldDefaultProvider: