Models — MassMedia v0.8beta2 documentation

MassMedia v0.8beta2 documentation

# Models

- Table of Contents
- index
  modules
  next
  previous

# Models

class `massmedia.models.` `Media`(*args, **kwargs)

  The abstract base class for all media types. It includes all the common attributes and functions.

  `title`

    `CharField(max_length 255)` A headline or short descriptive sentence. Used in creating the slug field.

  `slug`

    `SlugField` A variation of the title attribute that can be used in URLs. They must be unique.

    `unique=True`

  `title`

    CharField A headline or short descriptive sentence. Used in creating the slug field.

    `max_length=255`

  class `Meta`
  `Media.` `author`
  `Media.` `author_name`
  `Media.` `get_absolute_url`(*args, **kwargs)
  `Media.` `get_mime_type`()
  `Media.` `get_next_by_creation_date`(*moreargs, **morekwargs)
  `Media.` `get_previous_by_creation_date`(*moreargs, **morekwargs)
  `Media.` `get_template`(template_type)
  `Media.` `media_url`
  `Media.` `parse_metadata`()
  `Media.` `render_detail`()
  `Media.` `render_thumb`()
  `Media.` `save`(*args, **kwargs)
  `Media.` `site`
  `Media.` `thumb`()

class `massmedia.models.` `PublicMediaManager`
  `public`()

class `massmedia.models.` `Image`(*args, **kwargs)

  We are using a File field instead of Image field because the Image field will cause a problem if the file doesn’t exist and you merely access the record.

  exception `DoesNotExist`
  exception `Image.` `MultipleObjectsReturned`
  `Image.` `author`
    `author.` `field`
      `author.field.` `default`

        alias of `NOT_PROVIDED`

      static `author.field.` `related_query_name`(*moreargs, **morekwargs)
  `Image.` `site`
    `site.` `field`
      `site.field.` `default`

        alias of `NOT_PROVIDED`

      static `site.field.` `related_query_name`(*moreargs, **morekwargs)
  `Image.` `original`
    `original.` `field`
      `original.field.` `default`

        alias of `NOT_PROVIDED`

      static `original.field.` `related_query_name`(*moreargs, **morekwargs)
  `Image.` `author`
  `Image.` `get_absolute_url`(*moreargs, **morekwargs)
  `Image.` `get_next_by_creation_date`(*moreargs, **morekwargs)
  `Image.` `get_previous_by_creation_date`(*moreargs, **morekwargs)
  `Image.` `media_url`
  `Image.` `original`
  `Image.` `parse_metadata`()
  `Image.` `save`(*args, **kwargs)
  `Image.` `site`
  `Image.` `smart_fit`(width=20000, height=20000)

    Given a width, height or both, it will return the width and height to fit in the given area.

  `Image.` `variations`
  `Image.` `video_set`

class `massmedia.models.` `Video`(*args, **kwargs)

  A local or remote video file

  exception `DoesNotExist`
  exception `Video.` `MultipleObjectsReturned`
  `Video.` `author`
  `Video.` `get_absolute_url`(*moreargs, **morekwargs)
  `Video.` `get_next_by_creation_date`(*moreargs, **morekwargs)
  `Video.` `get_previous_by_creation_date`(*moreargs, **morekwargs)
  `Video.` `media_url`
  `Video.` `parse_metadata`()
  `Video.` `site`
  `Video.` `thumb`()
  `Video.` `thumbnail`

class `massmedia.models.` `Audio`(*args, **kwargs)

  An audio file

  exception `DoesNotExist`
  exception `Audio.` `MultipleObjectsReturned`
  `Audio.` `author`
  `Audio.` `get_absolute_url`(*moreargs, **morekwargs)
  `Audio.` `get_next_by_creation_date`(*moreargs, **morekwargs)
  `Audio.` `get_previous_by_creation_date`(*moreargs, **morekwargs)
  `Audio.` `media_url`
  `Audio.` `site`

class `massmedia.models.` `Flash`(*args, **kwargs)

  A flash SWF file to be played in a custom player

  exception `DoesNotExist`
  exception `Flash.` `MultipleObjectsReturned`
  `Flash.` `author`
  `Flash.` `get_absolute_url`(*moreargs, **morekwargs)
  `Flash.` `get_next_by_creation_date`(*moreargs, **morekwargs)
  `Flash.` `get_previous_by_creation_date`(*moreargs, **morekwargs)
  `Flash.` `media_url`
  `Flash.` `site`

class `massmedia.models.` `Document`(*args, **kwargs)

  A generic file

  exception `DoesNotExist`
  exception `Document.` `MultipleObjectsReturned`
  `Document.` `author`
  `Document.` `get_absolute_url`(*moreargs, **morekwargs)
  `Document.` `get_next_by_creation_date`(*moreargs, **morekwargs)
  `Document.` `get_previous_by_creation_date`(*moreargs, **morekwargs)
  `Document.` `media_url`
  `Document.` `site`

class `massmedia.models.` `Collection`(*args, **kwargs)

  An arbitrary collection of massmedia items

  exception `DoesNotExist`
  exception `Collection.` `MultipleObjectsReturned`
  `Collection.` `collectionrelation_set`
  `Collection.` `get_absolute_url`(*moreargs, **morekwargs)
  `Collection.` `get_next_by_creation_date`(*moreargs, **morekwargs)
  `Collection.` `get_previous_by_creation_date`(*moreargs, **morekwargs)
  `Collection.` `process_external_url`()

    Handle an external reference

  `Collection.` `process_zipfile`()

    Loop through a passed Zip file, saving the images and adding them to the Collection.

  `Collection.` `save`(*args, **kwargs)
  `Collection.` `site`

class `massmedia.models.` `CollectionRelation`(*args, **kwargs)

  Generic Many-to-Many Relationships between a Collection and any other obj

  exception `DoesNotExist`
  exception `CollectionRelation.` `MultipleObjectsReturned`
  `CollectionRelation.` `collection`
  `CollectionRelation.` `content_object`

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

  `CollectionRelation.` `content_type`

class `massmedia.models.` `MediaTemplate`(*args, **kwargs)

  Templates to display media, stored in the database

  exception `DoesNotExist`
  exception `MediaTemplate.` `MultipleObjectsReturned`
  `MediaTemplate.` `get_name_display`(*moreargs, **morekwargs)
  `MediaTemplate.` `template`()

    Return a Django Template object from the content of the record