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

dolmen.app.content provides out-of-the-box utilities for Dolmen applications content.

Getting started

We import Grok and grok the package:

>>> import grok
>>> grok.testing.grok('dolmen.app.content')

We create a dolmen.content content:

>>> import dolmen.content
>>> class Mammoth(dolmen.content.Content):
...    grok.name('A furry thing')
>>> manfred = Mammoth()
>>> manfred.title = u'A nice mammoth'

Indexes

dolmen.app.content registers two indexes to catalog the dolmen.content.IBaseContent created inside a Dolmen application:

>>> from dolmen.app.content import indexes

Base indexes

The dolmen.app.content.indexes.BaseIndexes handles the title and the content type of an IBaseContent content:

>>> indexes.BaseIndexes.__grok_indexes__
{'content_type': <grok.index.Field object at ...>, 'title': <grok.index.Text object at ...>}

>>> indexes.BaseIndexes.__grok_indexes__['content_type']._attribute
'__content_type__'

Searchable text

dolmen.app.content provides a simple ‘ISearchableText’ implementation, allowing full text searches. It comes in two parts.

The index:

>>> indexes.SearchableIndex.__grok_indexes__
{'searchabletext': <grok.index.Text object at ...>}

The adapter:

>>> from zope.index.text.interfaces import ISearchableText
>>> adapter = ISearchableText(manfred)
>>> adapter.getSearchableText()
u'A nice mammoth'

Thumbnailing

Thanks to dolmen.thumbnailer, dolmen.app.content provides a base thumbnailing policy, using ZODB blobs as storage and introducing a new scale.

Scales

Let’s introspect our Miniaturizer component:

>>> from dolmen.app.content import thumbnails

>>> thumbnails.BlobMiniaturizer.factory
<class 'dolmen.blob.file.BlobValue'>

>>> print thumbnails.BlobMiniaturizer.scales
{'mini': (250, 250), 'square': (64, 64), 'thumb': (150, 150), 'large': (700, 700), 'small': (128, 128), 'preview': (400, 400)}

The new scale, ‘square’, scales down and crops the original image to provide a square thumbnail. This is done using a IThumbnailer adapter:

>>> from dolmen.thumbnailer import IThumbnailer
>>> thumbnails.SquareThumbnailer
<class 'dolmen.app.content.thumbnails.SquareThumbnailer'>
>>> IThumbnailer.implementedBy(thumbnails.SquareThumbnailer)
True

Credits

All Dolmen packages are sponsorised by NPAI (http://www.npai.fr)

Changelog

0.2.1 (2010-02-25)

  • Using PIL 1.1.7 instead of PILwoTK 1.1.6. This prevents having to declare a third party archive download location.
  • Maintenance cleaning for the release of Grok 1.1rc1. Code is now pep8 compliant.

0.2 (2010-02-01)

  • Added dolmen.blob include in configure.zcml.
  • Cleaning dependencies. The package is now zope.app free and relies on the latest Grok evolution.

0.1 (2009-11-02)

  • Initial release
Release History

Release History

1.0b2

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

1.0b1

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

1.0a3

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

1.0a2

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

1.0a1

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.1

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
dolmen.app.content-0.2.1.tar.gz (5.0 kB) Copy SHA256 Checksum SHA256 Source Feb 25, 2010

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