This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

menhir.contenttype.file provides a content type for Dolmen based Grok applications.

Schema

The menhir.contenttype.file provides a very simple schema, extending the IDescriptiveSchema interface, from dolmen.app.content:

>>> from dolmen.app.content import IDescriptiveSchema
>>> from menhir.contenttype.file import IFile

>>> IFile.isOrExtends(IDescriptiveSchema)
True

The IFile interface describes the data field, that is to hold the uploaded file or given bytes:

>>> for attr, doc in IFile.namesAndDescriptions():
...   print attr, ':', doc
data : <dolmen.file.field.FileField object at ...>

This IFile is directly provided by the File object, as defines it as its schema:

>>> from menhir.contenttype.file import File
>>> from dolmen.content import Content

>>> somefile = File(title=u"My nice file", data="Some file data")
>>> IFile.providedBy(somefile)
True

>>> from dolmen.content import schema
>>> IFile in schema.bind().get(somefile)
True

>>> somefile.title
u'My nice file'

Storage

The file uses a Blob storage for the data:

>>> somefile.data
<dolmen.blob.file.BlobValue object at ...>

>>> print somefile.data.data
Some file data

Icon

The content registers an icon, thanks to the dolmen.app.content package:

>>> from zope.component import getMultiAdapter
>>> from zope.publisher.browser import TestRequest

>>> request = TestRequest()
>>> icon = getMultiAdapter((somefile, request), name="icon")
>>> print icon
<zope.browserresource.icon.IconView object at ...>

Changelog

0.3 (2011-02-14)

  • The schema now inherits from IDescriptiveSchema from dolmen.app.content and no longer from IBaseContent from dolmen.content. This adds a description attribute along with the already existing title.

0.2 (2010-07-20)

  • Corrected package archive MANIFEST, to include missing icon

0.1 (2010-07-16)

  • Initial release
Release History

Release History

0.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
menhir.contenttype.file-0.3.tar.gz (5.1 kB) Copy SHA256 Checksum SHA256 Source Feb 14, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting