cms.contrib.attachments package

Submodules

cms.contrib.attachments.admin module

class cms.contrib.attachments.admin.AttachmentFileAdmin(model, admin_site)

Bases: cms.contrib.admin.admin.CMSAdmin

fieldsets = ((None, {'fields': ['author', 'login_required']}), (<django.utils.functional.__proxy__ object at 0x58bfa10>, {'fields': ['content_type', 'object_id']}), (<django.utils.functional.__proxy__ object at 0x58bfd90>, {'fields': ['attHash', 'attChecksum', 'attName', 'title', 'description', 'attFile', 'attSize', 'attMimeType']}))
list_display = ('attName', 'title', 'author', 'created_date', 'attMimeType', 'attSize')
list_filter = ('attMimeType',)
media
readonly_fields = ('attHash', 'attSize', 'attChecksum', 'created_date')
search_fields = ('attName', 'title', 'description', 'author', 'attMimeType')
class cms.contrib.attachments.admin.AttachmentFileInline(*args, **kwargs)

Bases: cms.core.translations.admin.TranslationGenericStackedInline

fieldsets = ((None, {'fields': ['title', 'attFile']}), (None, {'fields': [('status', 'login_required')]}), (None, {'fields': ['description', 'order']}))
max_num = 15
media
model

alias of AttachmentFile

sortable_field_name = 'order'

cms.contrib.attachments.cms_plugin module

class cms.contrib.attachments.cms_plugin.CMSPlugin

Bases: cms.core.plugins.CMSPluginBase

admin_icon_class = 'icon-sharedfile'
description = <django.utils.functional.__proxy__ object at 0x24d9d90>
status = 'beta'
verbose_name = <django.utils.functional.__proxy__ object at 0x24d9dd0>
version = '0.2'

cms.contrib.attachments.management module

cms.contrib.attachments.management.create_group(sender, **kwargs)

cms.contrib.attachments.managers module

class cms.contrib.attachments.managers.AttachmentsManager

Bases: cms.core.managers.DisplayableManager

attachments_for_object(obj)

cms.contrib.attachments.models module

class cms.contrib.attachments.models.AttachmentFile(id, keywords_string, created_date, modified_date, created_by_id, modified_by_id, description, description_auto, login_required, title, slug, status, published_date, expired_date, sitemapped, mark, order, author_id, content_type_id, object_id, attFile, attName, attMimeType, attHash, attChecksum, attSize)

Bases: cms.core.models.Orderable, cms.core.models.Displayable, cms.core.models.Ownable

exception ChecksumDoesNotExist

Bases: exceptions.Exception

exception AttachmentFile.DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception AttachmentFile.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class AttachmentFile.Settings
ADMIN_DASHBOARD_EXCLUDE = True
MEDIA_PATH = {'default': 'files'}
class AttachmentFile.Translation
fields = ('attFile',)
AttachmentFile.attFile

A descriptor used for the original translated field.

AttachmentFile.author
AttachmentFile.check_file()
AttachmentFile.clean_fields(exclude=None)
AttachmentFile.content_object

Provides a generic relation to any object through content-type/object-id fields.

AttachmentFile.content_type
AttachmentFile.content_type_class
AttachmentFile.created_by
AttachmentFile.description

A descriptor used for the original translated field.

AttachmentFile.get_absolute_url(*args, **kwargs)
AttachmentFile.get_checksum()
AttachmentFile.get_hash()
AttachmentFile.get_hash_2()

return tuple of first three bytes of search hash

AttachmentFile.get_keywordsfield_name()
AttachmentFile.get_mark_display(*moreargs, **morekwargs)
AttachmentFile.get_mime()

detect mime using system file program

AttachmentFile.get_next_by_created_date(*moreargs, **morekwargs)
AttachmentFile.get_next_by_modified_date(*moreargs, **morekwargs)
AttachmentFile.get_next_by_published_date(*moreargs, **morekwargs)
AttachmentFile.get_previous_by_created_date(*moreargs, **morekwargs)
AttachmentFile.get_previous_by_modified_date(*moreargs, **morekwargs)
AttachmentFile.get_previous_by_published_date(*moreargs, **morekwargs)
AttachmentFile.get_size()
AttachmentFile.get_status_display(*moreargs, **morekwargs)
AttachmentFile.keywords

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

AttachmentFile.keywords_string

A descriptor used for the original translated field.

AttachmentFile.modified_by
AttachmentFile.objects = <cms.core.translations.translator.NewMultilingualManager object at 0x3e16990>
AttachmentFile.save(*args, **kvargs)
AttachmentFile.set_file(fl)
AttachmentFile.sites
AttachmentFile.slug

A descriptor used for the original translated field.

AttachmentFile.title

A descriptor used for the original translated field.

cms.contrib.attachments.models.attachment_upload(instance)
cms.contrib.attachments.models.delete_filefield(sender, **kwargs)

Automatically deleted files when records removed. On Django 1.3, removing records will not followed by deleting files. Only remove if there is no further record for this file (based on checksum) - since we avoid saving duplicate files.

cms.contrib.attachments.signals module

cms.contrib.attachments.urls module

cms.contrib.attachments.views module

class cms.contrib.attachments.views.DownloadView(**kwargs)

Bases: django.views.generic.base.View

get(request, hash0, hash1, pk, hashFull)
serve_file()

Lets the web server serve the file using the X-Sendfile extension

Module contents