Reference¶
For now, this documentation is automatically generated from the source code.
Models¶
Bases:
django.db.models.base.Model
Return a subject, text, HTML tuple with e-mail templates for a particular action. Returns a tuple with subject, text and e-mail template.
Bases:
django.db.models.base.Model
Update subscription according to requested action: subscribe/unsubscribe/update/, then save the changes.
Perform some basic validation and state maintenance of Subscription. TODO: Move this code to a more suitable place (i.e. clean()) and cleanup the code. Refer to comment below and https://docs.djangoproject.com/en/dev/ref/models/instances/#django.db.models.Model.clean
Bases:
django.db.models.base.Model
An Article within a Message which will be send through a Submission.
Bases:
django.db.models.base.Model
Message as sent through a Submission.
Get next available sortorder for Article.
Bases:
django.db.models.base.Model
Submission represents a particular Message as it is being submitted to a list of Subscribers. This is where actual queueing and submission happen.
Set the newsletter from associated message upon saving.
Forms¶
Bases:
django.forms.models.ModelForm
This is the base class for all forms managing subscriptions.
Bases:
newsletter.forms.NewsletterForm
Request subscription to the newsletter. Will result in an activation email being sent with a link where one can edit, confirm and activate one’s subscription.
Bases:
newsletter.forms.NewsletterForm
Request updating or activating subscription. Will result in an activation email being sent.
Bases:
newsletter.forms.UpdateRequestForm
Similar to previous form but checks if we have not already been unsubscribed.
Bases:
newsletter.forms.NewsletterForm
This form allows one to actually update to or unsubscribe from the newsletter. To do this, a correct activation code is required.
Bases:
django.forms.models.ModelForm
Form for updating subscription information/unsubscribing as a logged-in user.
Views¶
Bases:
object
Base class for newsletter views.
Bases:
newsletter.views.NewsletterViewBase
,django.views.generic.list.ListView
List available newsletters and generate a formset for (un)subscription for authenticated users.
Allow post requests.
Return a formset with newsletters for logged in users, or None.
Bases:
object
Mixin providing the ability to process args and kwargs from url before dispatching request.
Subclasses should put url data processing in this method.
Bases:
newsletter.views.ProcessUrlDataMixin
Mixin retrieving newsletter based on newsletter_slug from url and adding it to context and form kwargs.
Get newsletter based on newsletter_slug from url and add it to instance attributes.
Add newsletter to form kwargs.
Add newsletter to context.
Bases:
newsletter.views.ProcessUrlDataMixin
Mixin retrieving action from url and adding it to context.
Add action from url to instance attributes if not already set.
Add action to context.
Return list of template names for proper action.
Bases:
newsletter.views.NewsletterMixin
,newsletter.views.ActionMixin
,django.views.generic.base.TemplateView
View that renders a template for proper action, with newsletter and action in context.
Bases:
newsletter.views.NewsletterMixin
,newsletter.views.ActionMixin
,django.views.generic.edit.FormView
FormView with newsletter and action support.
Return url for given viename and associated with this view newsletter and action.
Bases:
newsletter.views.ActionTemplateView
Base class for subscribe and unsubscribe user views.
Add confirm to instance attributes.
Bases:
newsletter.views.ActionFormView
Base class for subscribe, unsubscribe and update request views.
Add error to instance attributes.
Add error to context.
Return subscription for the current request.
Subscribe/unsubscribe user and redirect to action activated page.
Returns the supplied success URL.
If the form is valid, redirect to the supplied URL.
Bases:
newsletter.views.ActionRequestView
Add ip to form kwargs for submitted forms.
Return subscription for the current request.
Bases:
newsletter.views.ActionRequestView
alias of
newsletter.forms.UpdateRequestForm
Redirect to update subscription view.
Bases:
newsletter.views.ActionFormView
alias of
newsletter.forms.UpdateForm
Add email, subscription and activation_code to instance attributes.
Returns the initial data to use for forms on this view.
Add instance to form kwargs.
Returns the supplied success URL.
Get our instance, but do not save yet.
Bases:
newsletter.views.NewsletterMixin
Base class for submission archive views.
Use only visible newsletters.
Filter out submissions for current newsletter.
Bases:
newsletter.views.SubmissionViewBase
,django.views.generic.dates.DateDetailView
Make sure the actual message is available.
Get the message template for the current newsletter.
Return a simplified response; the template should be rendered without any context. Use a SimpleTemplateResponse as a RequestContext should not be used.