Gracias Mikel, me imagine que fuera algo como eso. Sin embargo, solamente tuve 
que realizar el import de los xmlns:fss, más no utilizar los monky me daba un 
error "AttributeError: 'module' object has not attribute '__module__' " y en el 
canal IRC me dijeron que quitara los monkye. Lo digo para que quede registro 
por si alguien tiene el mismo problema, y quedo funcionando bien. 

De nuevo, muchas gracias. 
 
Vìctor Teràn
 
 
www.greenpeace.org.ar
 



> From: [email protected]
> Subject: Resumen de Plone-ConoSur, Vol 43, Envío 8
> To: [email protected]
> Date: Fri, 16 Jul 2010 10:16:00 +0200
> 
> Envie los mensajes para la lista Plone-ConoSur a
>       [email protected]
> 
> Para subscribirse o anular su subscripción a través de WEB
>       http://lists.plone.org/mailman/listinfo/plone-conosur
> 
> O por correo electrónico, enviando un mensaje con el texto "help" en
> el asunto (subject) o en el cuerpo a:
>       [email protected]
> 
> Puede contactar con el responsable de la lista escribiendo a:
>       [email protected]
> 
> Si responde a algún contenido de este mensaje, por favor, edite la
> linea del asunto (subject) para que el texto sea mas especifico que:
> "Re: Contents of Plone-ConoSur digest...". Ademas, por favor, incluya
> en la respuesta solo aquellas partes del mensaje a las que esta
> respondiendo.
> 
> 
>
> 
> Message: 2
> Date: Fri, 16 Jul 2010 04:25:46 +0000
> From: Victor Teran <[email protected]>
> Subject: [Plone-conosur] FileSystemStorage error usando el registro
>       zcml y  el de python
> To: Lista Plone <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> 
> 
> Saludos a todos, estoy tratando de usar un producto que guarde los archivos 
> en el sistema de archivos de la maquina(valga la redundancia) Estoy siguiendo 
> el manual de desarrollo de 
> (http://plone.org/products/filesystemstorage/#id45). Aplique el método python 
> de esta manera:
> En el archivo __init__ del raiz.
> 
> #FileSystemStorage  Configurationfrom iw.fss import zcml as fss_utilsfrom 
> Products.ATContentTypes import atctfrom multimedia.cenditel.content import 
> videofss_utils.patchATType(atct.ATFile, ['video'])
> de esta manera, me devuelve la siguiente excepción.
> (venv)vic...@victor-laptop:~/buildouts/FSS$ ./bin/instance fgNo handlers 
> could be found for logger "PortalTransforms"Traceback (most recent call 
> last):  File "./bin/instance", line 119, in ?    import 
> plone.recipe.zope2instance.ctl  File 
> "/home/victor/buildouts/FSS/eggs/plone.recipe.zope2instance-3.6-py2.4.egg/plone/recipe/__init__.py",
>  line 3, in ?    __import__('pkg_resources').declare_namespace(__name__)  
> File 
> "/home/victor/buildouts/FSS/eggs/distribute-0.6.14-py2.4.egg/pkg_resources.py",
>  line 2691, in ?    add_activation_listener(lambda dist: dist.activate())  
> File 
> "/home/victor/buildouts/FSS/eggs/distribute-0.6.14-py2.4.egg/pkg_resources.py",
>  line 668, in subscribe    callback(dist)  File 
> "/home/victor/buildouts/FSS/eggs/distribute-0.6.14-py2.4.egg/pkg_resources.py",
>  line 2691, in <lambda>    add_activation_listener(lambda dist: 
> dist.activate())  File 
> "/home/victor/buildouts/FSS/eggs/distribute-0.6.14-py2.4.egg/pkg_resources.py",
>  line 2195, in activate    map(declare_namespace, 
> self._get_metadata('namespace_packages.txt'))  File 
> "/home/victor/buildouts/FSS/eggs/distribute-0.6.14-py2.4.egg/pkg_resources.py",
>  line 1790, in declare_namespace    _handle_ns(packageName, path_item)  File 
> "/home/victor/buildouts/FSS/eggs/distribute-0.6.14-py2.4.egg/pkg_resources.py",
>  line 1761, in _handle_ns    loader.load_module(packageName); module.__path__ 
> = path  File 
> "/home/victor/buildouts/FSS/eggs/distribute-0.6.14-py2.4.egg/pkg_resources.py",
>  line 1590, in load_module    mod = imp.load_module(fullname, self.file, 
> self.filename, self.etc)  File 
> "/home/victor/buildouts/FSS/src/cenditel.multimedia/cenditel/__init__.py", 
> line 7, in ?    fss_utils.patchATType(atct.ATFile, ['video'])  File 
> "/home/victor/buildouts/FSS/eggs/iw.fss-2.8.0rc3-py2.4.egg/iw/fss/zcml.py", 
> line 65, in patchATType    field = class_.schema[fieldname]  File 
> "/home/victor/buildouts/FSS/eggs/Products.Archetypes-1.5.15-py2.4.egg/Products/Archetypes/Schema/__init__.py",
>  line 240, in __getitem__    return self._fields[name]KeyError: 'video'
> 
> Por otro lado, este es mi schema. 
> tapi.StringField("title",                required=True,                
> searchable=True,                storage=atapi.AnnotationStorage(),            
>     widget=atapi.StringWidget(label=_(u"title"))                ),   
> atapi.TextField("description",                required=False,                
> searchable=True,                storage=atapi.AnnotationStorage(),            
>     widget=atapi.RichWidget(label=_(u"description"))                ),   
> atapi.FileField("video",                required=True,                
> searchable=False,                storage=FieldSystemStorage(),                
> #storage=atapi.AnnotationStorage(),                
> widget=atapi.FileWidget(label=_(u"video"))                ),
> Usando el configure.zcml 
> <configure
>   ...
>   xmlns:zcml="http://namespaces.zope.org/zcml";
>   xmlns:fss="http://namespaces.ingeniweb.com/filesystemstorage";
>   ...>
>   ...
>   <fss:typeWithFSS
>     zcml:condition="installed iw.fss"
>     class="Products.ATContentTypes.atct.ATFile"
>     fields="file" />
>   ...
> </configure>Tampoco obtuve buenos resultados, inserte el codigo que faltaba 
> pero tambien obtenia excepciones.
> Segun el manual en la ultimo parametro debe ser el nombre del campo yo 
> coloque 'video' 'audio' siguiendo mi schemaAlguien me puede decir ¿Donde 
> estoy equivocado? Por favor.
> 
> De antemano, muchas gracias. 
> 
> 
> 
> 
>  
> Vìctor Teràn
>  
>  
> www.greenpeace.org.ar
>  
> 
>                                         
> _________________________________________________________________
> Los cochazos de los famosos Patrick Dempsey, Tom Cruise o Michael Douglas 
> presumen de automóvil
> http://motor.es.msn.com/coches/galeria.aspx?cp-documentid=152634169
> ------------ próxima parte ------------
> Se ha borrado un adjunto en formato HTML...
> URL: 
> http://lists.plone.org/pipermail/plone-conosur/attachments/20100716/88275c2b/attachment-0001.htm
> 
> ------------------------------
> 
> Message: 3
> Date: Fri, 16 Jul 2010 07:57:54 +0200
> From: Mikel Larreategi <[email protected]>
> Subject: Re: [Plone-conosur] Manejo de interfaces vía Python script
> To: "Regional list: Plone Cono Sur: Argentina, Bolivia, Chile,
>       Paraguay y Uruguay" <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> or., 2010.eko uztren 16a 03:36(e)an, Ariel Podestá(e)k idatzi zuen:
> > Estimados:
> >
> > Les dejo una pregunta concreta. Necesito manipular interfaces mediante
> > un script de Python. Puntualmente sería establecer que un content type
> > propio de Plone implemente una interfaz que yo agrego al sistema.
> > ¿Alguien se ha encontrado con esta problemática?
> >
> 
> Para ello tienes que utilizar vistas (browser-view). Desde código 
> restringido (scripts python), no puedes realizar esas operaciones.
> 
> 
> Mikel
> 
> 
> -- 
> Mikel Larreategi
> [email protected]
> 
> CodeSyntax
> Azitaingo Industrialdea 3 K
> E-20600 Eibar
> Tel: (+34) 943 82 17 80
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Fri, 16 Jul 2010 08:04:46 +0200
> From: Mikel Larreategi <[email protected]>
> Subject: Re: [Plone-conosur] FileSystemStorage error usando el
>       registro zcml y el de python
> To: [email protected]
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> or., 2010.eko uztren 16a 06:25(e)an, Victor Teran(e)k idatzi zuen:
> >
> > Saludos a todos, estoy tratando de usar un producto que guarde los
> > archivos en el sistema de archivos de la maquina(valga la redundancia)
> > Estoy siguiendo el manual de desarrollo de
> > (http://plone.org/products/filesystemstorage/#id45). Aplique el método
> > python de esta manera:
> >
> > En el archivo __init__ del raiz.
> >
> >
> > #FileSystemStorage Configuration
> > from iw.fss import zcml as fss_utils
> > from Products.ATContentTypes import atct
> > from multimedia.cenditel.content import video
> > fss_utils.patchATType(atct.ATFile, ['video'])
> >
> > de esta manera, me devuelve la siguiente excepción.
> >
> > (venv)vic...@victor-laptop:~/buildouts/FSS$ ./bin/instance fg
> > No handlers could be found for logger "PortalTransforms"
> > Traceback (most recent call last):
> > File "./bin/instance", line 119, in ?
> > import plone.recipe.zope2instance.ctl
> > File
> > "/home/victor/buildouts/FSS/eggs/plone.recipe.zope2instance-3.6-py2.4.egg/plone/recipe/__init__.py",
> > line 3, in ?
> > __import__('pkg_resources').declare_namespace(__name__)
> > File
> > "/home/victor/buildouts/FSS/eggs/distribute-0.6.14-py2.4.egg/pkg_resources.py",
> > line 2691, in ?
> > add_activation_listener(lambda dist: dist.activate())
> > File
> > "/home/victor/buildouts/FSS/eggs/distribute-0.6.14-py2.4.egg/pkg_resources.py",
> > line 668, in subscribe
> > callback(dist)
> > File
> > "/home/victor/buildouts/FSS/eggs/distribute-0.6.14-py2.4.egg/pkg_resources.py",
> > line 2691, in <lambda>
> > add_activation_listener(lambda dist: dist.activate())
> > File
> > "/home/victor/buildouts/FSS/eggs/distribute-0.6.14-py2.4.egg/pkg_resources.py",
> > line 2195, in activate
> > map(declare_namespace, self._get_metadata('namespace_packages.txt'))
> > File
> > "/home/victor/buildouts/FSS/eggs/distribute-0.6.14-py2.4.egg/pkg_resources.py",
> > line 1790, in declare_namespace
> > _handle_ns(packageName, path_item)
> > File
> > "/home/victor/buildouts/FSS/eggs/distribute-0.6.14-py2.4.egg/pkg_resources.py",
> > line 1761, in _handle_ns
> > loader.load_module(packageName); module.__path__ = path
> > File
> > "/home/victor/buildouts/FSS/eggs/distribute-0.6.14-py2.4.egg/pkg_resources.py",
> > line 1590, in load_module
> > mod = imp.load_module(fullname, self.file, self.filename, self.etc)
> > File
> > "/home/victor/buildouts/FSS/src/cenditel.multimedia/cenditel/__init__.py",
> > line 7, in ?
> > fss_utils.patchATType(atct.ATFile, ['video'])
> > File
> > "/home/victor/buildouts/FSS/eggs/iw.fss-2.8.0rc3-py2.4.egg/iw/fss/zcml.py",
> > line 65, in patchATType
> > field = class_.schema[fieldname]
> > File
> > "/home/victor/buildouts/FSS/eggs/Products.Archetypes-1.5.15-py2.4.egg/Products/Archetypes/Schema/__init__.py",
> > line 240, in __getitem__
> > return self._fields[name]
> > KeyError: 'video'
> >
> >
> > Por otro lado, este es mi schema.
> >
> > tapi.StringField("title",
> > required=True,
> > searchable=True,
> > storage=atapi.AnnotationStorage(),
> > widget=atapi.StringWidget(label=_(u"title"))
> > ),
> > atapi.TextField("description",
> > required=False,
> > searchable=True,
> > storage=atapi.AnnotationStorage(),
> > widget=atapi.RichWidget(label=_(u"description"))
> > ),
> > atapi.FileField("video",
> > required=True,
> > searchable=False,
> > storage=FieldSystemStorage(),
> > #storage=atapi.AnnotationStorage(),
> > widget=atapi.FileWidget(label=_(u"video"))
> > ),
> >
> > Usando el configure.zcml
> >
> > <configure
> >    ...
> >    xmlns:zcml="http://namespaces.zope.org/zcml";
> >    xmlns:fss="http://namespaces.ingeniweb.com/filesystemstorage";
> >    ...>
> >    ...
> >    <fss:typeWithFSS
> >      zcml:condition="installed iw.fss"
> >      class="Products.ATContentTypes.atct.ATFile"
> >      fields="file" />
> >    ...
> > </configure>
> >
> > Tampoco obtuve buenos resultados, inserte el codigo que faltaba pero
> > tambien obtenia excepciones.
> >
> > Segun el manual en la ultimo parametro debe ser el nombre del campo yo
> > coloque 'video' 'audio' siguiendo mi schema
> > Alguien me puede decir ¿Donde estoy equivocado? Por favor.
> >
> 
> Para hacer funcionar FileSystemStorage hay 2 opciones:
> 
> 1- Escribes tu archetype directamente compatible con FSS
> 2- Parcheas tu archetype en tiempo de ejecución utilizando ZCML
> 
> 
> Para la primera opción tienes que escribir tu schema tal y como lo has 
> descrito en el mail *pero* tienes un error ahí. Donde dice:
> 
>     atapi.FileField("video",
>                  required=True,
>                  searchable=False,
>                  storage=FieldSystemStorage(),
>                  #storage=atapi.AnnotationStorage(),
>                  widget=atapi.FileWidget(label=_(u"video"))
>                  ),
> 
> Debe decir:
> 
>     atapi.FileField("video",
>                  required=True,
>                  searchable=False,
>                  storage=FileSystemStorage(),
>                  widget=atapi.FileWidget(label=_(u"video"))
>                  ),
> 
> Es FileSystemStorage no FieldSystemStorage.
> 
> 
> Para la segunda opción, el ZCML que añades es el correcto, pero es 
> correcto para el tipo "Archivo" de Plone. Para el tuyo debería ser algo así:
> 
> <configure
>    xmlns:fss="http://namespaces.ingeniweb.com/filesystemstorage";
> 
> 
>    <fss:typeWithFSS
>      zcml:condition="installed iw.fss"
>      class="multimedia.cenditel.content.video"
>      fields="video" />
> 
> </configure>
> 
> Es decir, apuntando a tu clase archetype 
> (multimedia.cenditel.content.video) y a su campo video.
> 
> 
> Del mismo modo, las primeras líneas que describes:
> 
> #FileSystemStorage  Configuration
> from iw.fss import zcml as fss_utils
> from Products.ATContentTypes import atct
> from multimedia.cenditel.content import video
> fss_utils.patchATType(atct.ATFile, ['video'])
> 
> Son incorrectas, porque estas intentando aplicar FSS al campo video del 
> object ATFile, cosa que no existe.
> 
> De todas formas no te recomiendo utilizar esta opción, yo utilizaría 
> directamente la opción del ZCML.
> 
> 
> Saludos,
> 
> Mikel
> 
> -- 
> Mikel Larreategi
> [email protected]
> 
> CodeSyntax
> Azitaingo Industrialdea 3 K
> E-20600 Eibar
> Tel: (+34) 943 82 17 80
> 
> 
> ------------------------------
> 
> _______________________________________________
> Plone-ConoSur mailing list
> [email protected]
> http://lists.plone.org/mailman/listinfo/plone-conosur
> 
> 
> Fin de Resumen de Plone-ConoSur, Vol 43, Envío 8
> ************************************************
                                          
_________________________________________________________________
Los cochazos de los famosos Patrick Dempsey, Tom Cruise o Michael Douglas 
presumen de automóvil
http://motor.es.msn.com/coches/galeria.aspx?cp-documentid=152634169
_______________________________________________
Plone-ConoSur mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/plone-conosur

Responder a