Re: Wie richtig: Werte per propert_sheet konfigurieren lassen

Andreas Jung <[email protected]>
Newsgroups gmane.comp.web.zope.german
Organization ZOPYX Ltd & Co. KG
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Carsten Senger wrote:
> Hallo Hartmut,
>
> --On Mittwoch, Januar 27, 2010 13:50:31 +0100
>  Hartmut Goebel <[email protected]> wrote:
>
>> ich möchte für einen AT-Contenttype die zulässigen Werte aus einem
>> property_sheet holen. Mache ich das besser/eleganter direkt in einer
>> Methode des ATCT oder nehme ich den Umweg über ein Vocabulary?
>>
>> Fall letzteres: wie greife ich am bestern auf das Vacabulary zu?
>> Einfach
>> importieren? Oder über den Namen, under dem ich es in configure.zcml
>> angelegt habe (wie?)?
>
> Ich bin ja erstaunt, dass Archetypes zope3 vocabularies benutzen kann.
> Das Archetypes Developers Manual [1] sagt nur, dass der Name eine named
> vocabularies akzeptiert wird::
>
>  vocabulary_factory
>  ...
>  A string name of a Zope 3 style vocabulary factory (a named
>  utility providing zope.schema.interfaces.IVocabularyFactory)
>
Der Sourcecode sagt mehr:

 413         1) Static vocabulary$
 414 $
 415            - is already a DisplayList$
 416            - is a list of 2-tuples with strings (see above)$
 417            - is a list of strings (in this case a DisplayList$
 418              with key=value will be created)$
 419 $
 420         2) Dynamic vocabulary:$
 421 $
 422            - precondition: a content_instance is given.$
 423 $
 424            - has to return a:$
 425 $
 426                 * DisplayList or$
 427                 * list of strings or$
 428                 * list of 2-tuples with strings:$
 429                     '[("key1","value 1"),("key 2","value 2"),]'$
 430 $
 431            - the output is postprocessed like a static vocabulary.$
 432 $
 433            - vocabulary is a string:$
 434                 if a method with the name of the string exists it
will be called$
 435 $
 436            - vocabulary is a class implementing IVocabulary:$
 437                 the "getDisplayList" method of the class will be
called.$
 438 $
 439         3) Zope 3 vocabulary factory vocabulary$
 440         $
 441             - precondition: a content_instance is given$
 442             $
 443             - self.vocabulary_factory is given$
 444             $
 445             - a named utility providing
zope.schema.interfaces.IVocbularyFactory $
 446               exists for the name self.vocabulary_factory.$
 447 $

AT unterstützt als Gemischtwarenladen mal wieder alles mögliche.

Andreas

- -- 
ZOPYX Limited              \ zopyx group
Charlottenstr. 37/1         \ The full-service network for your
D-72070 Tübingen             \ Python, Zope and Plone projects
www.zopyx.com, [email protected] \ www.zopyxgroup.com
- ------------------------------------------------------------------------
E-Publishing, Python, Zope & Plone development, Consulting


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktgP0cACgkQCJIWIbr9KYxNTACgovm4jye4860s/WI61ByQaoNJ
fbsAn0ccDi7WW9zwRSCEbRAZ+jyq7mmn
=C97H
-----END PGP SIGNATURE-----



_______________________________________________
zope mailing list
[email protected]
https://mail.dzug.org/mailman/listinfo/zope
lists.vcf (text/x-vcard, 316 B)
begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:[email protected]
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.