[Zope-CMF] Re: Biography type
Tres Seaver
tseaver at palladion.com
Tue Nov 1 11:15:11 EST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
BIll Anderson wrote:
> Ok, so it's clearly been quite some time since I've done any CMF stuff.
>
> I need to have a "document" type for biographies. Essentially a document
> with a custom view template as well as a few additional properties. it
> is these properties that got me stymied.
>
> I need two properties:
> an image URL called BioImage
> the name of the bio subject, MemberName
>
>
> Obviously these are not part of Metadata OOTB. What would be the
> simplest way to add the ability to set/change these? I'd prefer to be
> able to have them set during the creation process and must be able to
> change them later.
>
> There are no docs I have found for this. I know how to add a property
> during creation, as well as use it in ZPT. BUT nothing on how to update
> it from a form.
One way to accomplish your goal is to write a filesystem product
deriving a new Biography class from CMFDefault's Document. At that
point, you can add "setter" methods for your new propoerties, which can
be called from the PythonScript which is handling the form POST.
If your content type is a ScriptableTypeInfo, where your creation script
added the properties, then you can use 'manage_changeProperties' in the
POST-handling script.
Tres.
- --
===================================================================
Tres Seaver +1 202-558-7113 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDZ5SP+gerLs4ltQ4RAkoaAKCUr7276Llio+s37vAbSYrSxUCOugCgoqKi
+/jG9+hxaHFAMc/lJE6bcVg=
=2oV9
-----END PGP SIGNATURE-----
More information about the Zope-CMF
mailing list