Content Type Inherited Fields

When making new Plone ContentTypes, one usually copies a base schema from an existing, standard content type and modifies it. This means you get the fields that are defined in the base schema. If you use an identical name for a field you're specifying, unexpected results may occur if that pre-defined field name is used to do special things by other parts of the content type (e.g., the skin template or whatever). You don't want to accidentally overwrite any defined field you're copying from another content type. Everything you do with these should be deliberate!

How to know

Check out the fields in the schema defined in the base content type you're using. Look for it in the Products directory, under !ATContentTypes -> content (assuming that's where your code imports it from -- check!).

Note that this quest may well lead you into other python files because the schema may be (probably is) imported from an even more basic definition somewhere else. For example, if your type is based on a copy of the "Base" content schema and you look in base.py, you'll find that the schema uses ATContentTypeSchema, which is imported from schemata.py. Therein, BaseSchema? is itself imported from the basic archetypes product (Products/Archetypes), from a file therein called public.py. All this file does is import everything from another file in the Archetypes product called atapi. This file assembles references to the various schemata by importing them from various individual files. And so on ...

If you're using ArchGenXML, look in the python file it creates for your ContentType?. Look for a line that begins with "YourContentName?_schema = ". To the right of the equals sign, you'll see what content types are being copied to create your content type. For example:

GeographicEntityLite_schema = BaseFolderSchema.copy() + schema.copy()

Names to watch out for

This needs further research, to see exactly where things are coming from ... but that will take more time. For now, the following are known to me, either on general principles or because I've already tripped over them.

  • title
  • description
  • language
  • references