news.models module

class news.models.NewsLetter(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Container of NewsItems. Which NewsItems (and their order) are handled via the auxiliary model NewsLetterNewsItemsTable.

date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

intro

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

closing

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

published

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_absolute_url()[source]
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

get_next_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=True, **kwargs)
get_previous_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

newsletternewsitemstable_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <django.db.models.manager.Manager object>
class news.models.NewsItem(id, date, headline, blurb_short, blurb, image, css_class, followup_link, followup_link_text, published, on_homepage)[source]

Bases: django.db.models.base.Model

date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

headline

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

blurb_short

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

blurb

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

image

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

css_class

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

published

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

on_homepage

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <news.managers.NewsManager object>
get_absolute_url()[source]
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

get_next_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=True, **kwargs)
get_previous_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

newsletternewsitemstable_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class news.models.NewsLetterNewsItemsTable(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Carries the specification of which NewsItem sits in which NewsLetter, and in which order.

newsletter

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

newsitem

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

order

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

newsitem_id
newsletter_id
objects = <django.db.models.manager.Manager object>