Fun with vocabularies

"Charlie Clark" <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Organization Clark Consulting & Research
Message-ID <[email protected]>
Hi,

I was wondering whether it's possible to use callables for schema  
vocabularies without registering them first?
ie.

def my_vocab(context):
	while some_constraint:
		yield zope.schema.SimpleTerm()
alsoProvides(my_vocab, zope.schema.interfacesIBaseVocabulary)

class IMySchema(Interface):

	value = Choice(
		vocabulary=my_vocab
			)

I'm sure it should be possible but my weak and feeble brain has somehow  
failed to solve the puzzle!

On a similar note: how should I handle i18n message objects that are the  
title of a SimpleTerm? At least in zope.formlib this leads to a rendering  
error because: "AttributeError: 'MessageFactory' object has no attribute  
'replace'"

Thanks for any pointers.

Charlie
-- 
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.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.