Re: [Plone-IT] Creare un nuovo oggetto solo se è presente una data interfaccia
Alessandro Pisa
alessandro.pisa a gmail.com
Mar 8 Set 2009 06:13:12 UTC
2009/9/7 Vito Falco <vitofalco a gmail.com>:
> Ciao a tutti,
> ho questa esigenza: rendere possibile l'aggiuna del mio tipo di oggetto SOLO
> in presenza di una data marker interface.
>
> Come posso fare? :-S
> Grazie
> Vito
>
> --
> "Design is the method of putting form and content together. Design, just as
> art, has multiple definitions; there is no single definition. Design can be
> art. Design can be aesthetics. Design is so simple, that's why it is so
> complicated." by Paul Rand
>
> _______________________________________________
> Plone-IT mailing list
> Plone-IT a lists.plone.org
> http://lists.plone.org/mailman/listinfo/plone-it
> http://www.nabble.com/Plone---Italy-f21728.html
>
Io avevo un problema simile e ho risolto mettendo nel contenuto
"padre" una funzione simile:
def allowedContentTypes(self):
all_allowed_types = super(folder.Base, self).allowedContentTypes()
condition = IMiaInterfaccia.providedBy(self)
if condition:
return all_allowed_types
else:
return [type
for type in all_allowed_types
if type.title != "Tipo da Eliminare"]
Prova ad adattarla alle tue esigenze.
Spero di essere stato utile.
Ciao
--
http://alepisa.blogspot.com
Esalando Prassi
Maggiori informazioni sulla lista
Plone-IT