newsletters package¶
Submodules¶
newsletters.admin module¶
Registers admin interfaces for the newsletters module
Bases:
utils.translation.TranslatedModelAdmin
Manage the newsletters
Renders the change view Disallow change access if a newsletter is marked as sent
field to use for date filtering
available fieldsets in the admin change form
Remove the deletion action from the admin
Check if delete permission is granted Disallow deletion if a newsletter is marked as sent
available inlines in the admin change form
available fields in the admin overview list
available fields for searching
Bases:
django.contrib.admin.options.StackedInline
The inline for the event items in the newsletter
alias of
newsletters.models.NewsletterEvent
Bases:
django.contrib.admin.options.StackedInline
The inline for the text items in the newsletter
alias of
newsletters.models.NewsletterItem
newsletters.apps module¶
Configuration for the newsletters package
Bases:
django.apps.config.AppConfig
AppConfig for the newsletters package
newsletters.emails module¶
The emails defined by the newsletters package
Sends the newsletter as HTML and plaintext email
- Parameters
newsletter – the newsletter to be send
newsletters.forms module¶
The forms defined by the newsletters package
Bases:
django.forms.models.ModelForm
Custom ModelForm for the NewsletterEvent model to add the order field and javascript for automatic field filling
Bases:
object
Bases:
object
alias of
newsletters.models.NewsletterEvent
Return all media required to render the widgets on this form.
newsletters.models module¶
The models defined by the newsletters package
Bases:
django.db.models.base.Model
Describes a newsletter
Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Accessor that fetches the localized variant of description
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.
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.
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
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.
Accessor that fetches the localized variant of title
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.
Bases:
django.db.models.base.Model
Describes one piece of basic content of a newsletter
Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.
Accessor that fetches the localized variant of description
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.
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.
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Accessor that fetches the localized variant of title
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.
Bases:
newsletters.models.NewsletterContent
Describes one piece of event content of a newsletter
Make sure that the event end date is after the start date
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 object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
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.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Accessor that fetches the localized variant of where
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.
Bases:
newsletters.models.NewsletterContent
Describes one piece of text content of a newsletter
Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
newsletters.services module¶
Writes the newsletter as HTML to file (in all languages)
Write newsletter to a file
newsletters.urls module¶
The routes defined by the newsletters package
newsletters.views module¶
Views provided by the newsletters package
If this is a GET request this view will render a confirmation page for the administrator. If it is a POST request the newsletter will be sent to all recipients
- Parameters
request – the request object
pk – the newsletter’s primary key
- Returns
302 RedirectResponse if POST else 200 with the confirmation page HTML
View that renders the newsletter as HTML
- Parameters
request – the request object
pk – the newsletter’s primary key
lang – the language of the render
- Returns
HttpResponse 200 containing the newsletter HTML