mailing_lists.models module

class mailing_lists.models.MailchimpList(*args, **kwargs)[source]

Bases: scipost.behaviors.TimeStampedModel

This model is a copy of the current lists in the Mailchimp account. It will be used to map the Contributor’s preferences to the Mailchimp’s lists and keeping both up to date.

name

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

internal_name

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

supporting_text

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

mailchimp_list_id

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

status

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

subscriber_count

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

open_for_subscription

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

allowed_groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

objects = <mailing_lists.managers.MailListManager object>
get_absolute_url()[source]
update_members(status='subscribed')[source]

Update the subscribers in the MailChimp account.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_latest_activity(*, field=<scipost.db.fields.AutoDateTimeField: latest_activity>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_latest_activity(*, field=<scipost.db.fields.AutoDateTimeField: latest_activity>, is_next=False, **kwargs)
get_status_display(*, field=<django.db.models.fields.CharField: status>)
id

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

mailchimpsubscription_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 mailing_lists.models.MailchimpSubscription(*args, **kwargs)[source]

Bases: scipost.behaviors.TimeStampedModel

Track the Contributors’ settings on wheter he/she wants to have an active subscription to a specific (public) list.

active_list

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.

contributor

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.

status

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

active_list_id
contributor_id
get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_latest_activity(*, field=<scipost.db.fields.AutoDateTimeField: latest_activity>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_latest_activity(*, field=<scipost.db.fields.AutoDateTimeField: latest_activity>, is_next=False, **kwargs)
get_status_display(*, field=<django.db.models.fields.CharField: status>)
id

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

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