John DeStefano, on 2009-03-12:
> I have a custom object type, based on ATEvent, which includes a
> 'Description' field:
> copied_fields['description'] = ATEvent.schema['description'].copy()
> copied_fields['description'].widget.description = "A brief
> description ... "
> copied_fields['description'].widget.description_msgid =
> "description_announcement_description"
> copied_fields['description'].widget.rows = 2
> copied_fields['description'].required = 1
> copied_fields['description'].searchable = 1
If you are overriding so many things of that field, I would say: just
create a new field. Literally copy over the lines of ATEvent and
change it to what you want.
> This Description shows up in the creation form, in the email version
> of the object, and even gets displayed on-hover on events in the
> calendar, but it is not displayed in the object itself after creation
> (which also means it can't be edited). Trying to "un-hide" it in the
> schema doesn't seem to help:
> copied_fields['description'].visible = {'view': 'visible', 'edit':
> 'visible'},
>
> In the subscriber, I had to convert the Description to UTF-8 in order
> to keep it from displaying garbage characters in the email version:
> rawDescription = obj.Description().encode('utf-8')
> ...
> msg += "Description: " + "\n" + rawDescription + "\n\n"
An Archetypes field also has a raw version. In this case it should be
self.getRawDescription(). See if that gives you what you want.
> How can I get the Description to be visible in the actual object?
>
> Additional code, if needed:
> http://deesto.pastebin.com/f166dd6d6
> http://deesto.pastebin.com/f1e48b52c
>
> Thanks,
> ~John
--
Maurits van Rees | http://maurits.vanrees.org/
Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers