Re: Dynamisches vocabulary für SelectionWidget

"Jens W. Klein" <[email protected]>
Newsgroups gmane.comp.web.zope.german
Organization Klein & Partner KEG, BlueDynamics Alliance
Message-ID <1253709011.4699.2.camel@minime>
Am Mittwoch, den 23.09.2009, 14:26 +0200 schrieb Nico Grubert:
> Hallo zusammen
> 
> Ich habe einen Plone Content-Typen, der in etwa so aussieht:
> 
> -------------------------------------------------------------------------
> navSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((
> 
>      atapi.StringField('ldap_users',
>          required = False,
>          searchable = False,
>          label = u"Users",
>          widget = atapi.SelectionWidget(label = u'Users'),
>          vocabulary = getLDAPUsersDisplayList,
>          ),
>      ),
> 
> ))
> 
> finalizeATCTSchema(navSchema, folderish=True, moveDiscussion=False)
> 
> class nav(base.ATCTContent):
>      """Describe a nav item.
>      """
> 
>      implements(Inav)
> 
>      portal_type = "nav"
>      _at_rename_after_creation = True
>      schema = navSchema
> -------------------------------------------------------------------------
> 
> Für das vocabulary würde ich gern eine Funktion 
> 'getLDAPUsersDisplayList' aufrufen, die mit Daten aus dem "acl_users" 
> UserFolder der Plone Site die entsprechende DisplayList generiert.
> 
> Wie und wo definiere ich die getLDAPUsersDisplayList Methode nun, so 
> dass ich sie für das Vocabulary verwenden kann?

Als Klassenmethode von dem Archetype. Erwarte wird 

a) eine Instanz von Products.Archetypes.utils.Displaylist oder

b) eine Liste mit Strings oder

c) eine Liste von Tupeln (id, value).

hth Jens

> 
> Besten Dank im voraus
> Nico
-- 
Jens W. Klein
Software Architect
Managing Director, General Partner
+43 512 890077

Klein & Partner KEG          WEB APPLICATIONS,  ZOPE,  PLONE, HOSTING
BlueDynamics Alliance        production: concept, development, design
http://bluedynamics.com      consulting: analysis, coaching, training
http://zoplo.com             management: projects, process, community



_______________________________________________
zope mailing list
[email protected]
https://mail.dzug.org/mailman/listinfo/zope
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.