Media libraryΒΆ

class feincms.module.medialibrary.models.Category(*args, **kwargs)

These categories are meant primarily for organizing media files in the library.

class feincms.module.medialibrary.models.CategoryManager

Simple manager which exists only to supply .select_related("parent") on querysets since we can’t even __unicode__ efficiently without it.

class feincms.module.medialibrary.models.MediaFile(*args, **kwargs)

MediaFile(id, file, type, created, copyright, file_size)

class feincms.module.medialibrary.models.MediaFileBase(*args, **kwargs)

Abstract media file class. Includes the feincms.models.ExtensionsMixin because of the (handy) extension mechanism.

MediaFileBase.determine_file_type(name)
>>> t = MediaFileBase()
>>> t.determine_file_type('foobar.jpg')
'image'
>>> t.determine_file_type('foobar.PDF')
'pdf'
>>> t.determine_file_type('foobar.jpg.pdf')
'pdf'
>>> t.determine_file_type('foobar.jgp')
'other'
>>> t.determine_file_type('foobar-jpg')
'other'
MediaFileBase.file_info()

Method for showing the file name in admin.

Note: This also includes a hidden field that can be used to extract the file name later on, this can be used to access the file name from JS, like for example a TinyMCE connector shim.

class feincms.module.medialibrary.models.MediaFileTranslation(*args, **kwargs)

Translated media file caption and description.

Previous topic

Page module

Next topic

Blog module

This Page