gc2gh / django-dms

Automatically exported from code.google.com/p/django-dms
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Class-based syntax for metadata #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Sensible class-based syntax for defining metadata auto-population.

For example:
{{{
class DocumentPopulator(metadata.Populator):
    # Map fields to document fields
    fields = dict(title='title', 
                  file_mimetype='mimetype', 
                  author='creator', 
                  date_created='creation date')

    # Custom processing
    def process_title(self, value):
        return value.isupper() and value.title() or value

}}}

Original issue reported on code.google.com by e.willha...@gmail.com on 17 Jan 2009 at 8:34