0

I have notices that types created with paster on the file system can be changed using the TTW editor.

When I reinstall the product the TTW changes persist, and the model file seems to be ignored. How can I discard these changes? Is there a guide to the relationship between web changes and file system changes?

Adrian Garner
  • 5,235
  • 2
  • 23
  • 29
  • This is not my experience. Are you sure you've actually installed your Python module with the Dexterity types? – SteveM Nov 25 '13 at 15:49
  • I have noticed also that my profile says form.model("models/program.xml") not model.load("models/program.xml"). – Adrian Garner Jan 16 '14 at 04:24

1 Answers1

2

A content type's entry in the portal_types tool has 3 properties related to where the model is loaded from. They are checked in this order:

  • model_source: The XML model, inline
  • model_file: Path to a file which contains the XML model
  • schema: Dotted path to a Python schema

My guess is that you need to make your filesystem product's installation profile explicitly empty model_source, so that it won't take precedence over model_file and schema.

David Glick
  • 5,422
  • 17
  • 23
  • How do I access this... I assumed it would be through the zmi under portal_types... but there is no model_xml (there's 'Model source', but it doesn't correspond to customisations) – Adrian Garner Jan 15 '14 at 11:19
  • I meant model_source. – David Glick Jan 15 '14 at 18:17
  • How can you explicitly empty it... like this: ? – Adrian Garner Jan 16 '14 at 04:37
  • I am really confused about this... changes to the schema through the web show up on different plone sites... – Adrian Garner Jan 16 '14 at 07:35
  • That will happen if you have the type installed in multiple sites and it references the same schema. When you use the TTW schema editor, it changes the schema in memory (which would affect other sites) and then writes it as XML to model_source in portal_types. You shouldn't use a Python schema if multiple sites need to edit the schema in different ways. – David Glick Jan 16 '14 at 20:07