Models — Django Stories 1.0 documentation

Django Stories 1.0 documentation

# Models

- Table of Contents
- index
  modules
  next
  previous

# Models

- Stories
- Relations

## Stories

class `stories.models.` `Story`(*args, **kwargs)

  A newspaper or magazine type story or document that was possibly also printed in a periodical.

  exception `DoesNotExist`
  exception `Story.` `MultipleObjectsReturned`
  `Story.` `author`

    Easy way to get a combination of authors without having to worry which fields are set (author/one-off author)

  `Story.` `author_display`

    Presentation of the story author(s). Renders the template stories/author_display.html suppling it with the following context

    - instance - the story instance
    - authors - all the authors (authors.objects.all())
    - non_staff_author - text value that can be used in place of authors
  `Story.` `authors`
  `Story.` `comments_frozen`

    Simplified way to get the comment status == frozen

  `Story.` `get_absolute_url`(*moreargs, **morekwargs)
  `Story.` `get_comment_status_display`(*moreargs, **morekwargs)
  `Story.` `get_next_by_modified_date`(*moreargs, **morekwargs)
  `Story.` `get_origin_display`(*moreargs, **morekwargs)
  `Story.` `get_previous_by_modified_date`(*moreargs, **morekwargs)
  `Story.` `get_status_display`(*moreargs, **morekwargs)
  `Story.` `objects` = <django.db.models.manager.Manager object at 0x2c575d0>
  `Story.` `paragraphs`

    Return the story.body as paragraphs by finding all <p> tags

  `Story.` `print_page` = (<django.db.models.fields.CharField object at 0x2c57290>,)
  `Story.` `print_pub_date` = (<django.db.models.fields.DateTimeField object at 0x2c571d0>,)
  `Story.` `print_section` = (<django.db.models.fields.CharField object at 0x2c57210>,)
  `Story.` `published` = <stories.models.CurrentSitePublishedManager object at 0x2c57610>
  `Story.` `site`

## Relations

class `stories.relations.models.` `StoryRelation`(*args, **kwargs)

  Related story item

  exception `DoesNotExist`
  exception `StoryRelation.` `MultipleObjectsReturned`
  `StoryRelation.` `content_object`

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

  `StoryRelation.` `content_type`
  `StoryRelation.` `objects` = <stories.relations.models.StoryRelationManager object at 0x30e9610>
  `StoryRelation.` `story`