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.
-
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.
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 aReverseManyToOneDescriptor
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.
-
followup_link
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
followup_link_text
¶ 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>¶
-
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.
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 aReverseManyToOneDescriptor
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.
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 aForwardManyToOneDescriptor
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 aForwardManyToOneDescriptor
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
¶
-
objects
= <django.db.models.manager.Manager object>¶