[Grok-dev] Dolmen and its releases
trollfot at gmail.com
Thu Oct 22 10:00:28 EDT 2009
the field property is a property that handles the persistency of your
data transparently. And because code is always better than bad english
>>> from persistent import Persistent
>>> from dolmen.file import FileProperty, FileField
>>> from zope.interface import Interface, implements
>>> class IContent(Interface):
... binary = FileField(title=u"Binary data")
>>> class MyContent(Persistent):
... binary = FileProperty(IContent['binary'])
>>> root['mammoth'] = MyContent()
>>> manfred = root['mammoth']
>>> manfred.binary = FileChunk('Foobar')
<dolmen.file.file.NamedFile object at ...>
2009/10/22 Martin Aspeli <optilude+lists at gmail.com>:
> Souheil CHELFOUH wrote:
>> 2009/10/22 Martin Aspeli <optilude+lists at gmail.com>:
>>> Souheil CHELFOUH wrote:
>>> Nice to see so many new packages! :-)
> provides what I use a lot myself, the FileProperty.
> How does that work?
>> dolmen.blob is very ztk centric and doesn't really support anything zope2-ish
>> and same remarks : I use a lot the BlobProperty :)
> plone.namedfile works fine without blobs too. It's totally optional. I
> don't think it makes much difference.
>> This is not meant to act like a field, stored on the object. It's a level lower.
>> I used to work with z3c.relationfield, but it's too specific. A lot of
>> the mechanisms are similar,
>> as it was my start point. Howevern this is more of the framework
>> level. It would be possible to use
>> dolmen.relations to make a relationfield-like feature.
> May be interesting in cases where fields are not really what you're after.
>> I forgot the dolmen.storage, which I use a lot !
> No you didn't, I snipped it. :)
> Author of `Professional Plone Development`, a book for developers who
> want to work with Plone. See http://martinaspeli.net/plone-book
> Grok-dev mailing list
> Grok-dev at zope.org
More information about the Grok-dev