mailinglists package¶
Submodules¶
mailinglists.admin module¶
The admin interfaces registered by the mailinglists package
-
class
mailinglists.admin.
ListAliasInline
(parent_model, admin_site)[source]¶ Bases:
django.contrib.admin.options.TabularInline
Class to inline show the ListAlias.
-
property
media
¶
-
model
¶ alias of
mailinglists.models.ListAlias
-
property
-
class
mailinglists.admin.
MailingListAdmin
(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdmin
Class to show the mailing lists in the admin.
-
filter_horizontal
= ('members',)¶
-
inlines
= (<class 'mailinglists.admin.VerbatimAddressInline'>, <class 'mailinglists.admin.ListAliasInline'>)¶
-
list_display
= ('name', 'alias_names', 'moderated', 'description')¶
-
property
media
¶
-
search_fields
= ['name', 'aliases__alias']¶
-
-
class
mailinglists.admin.
VerbatimAddressInline
(parent_model, admin_site)[source]¶ Bases:
django.contrib.admin.options.TabularInline
Class to inline show the VerbatimAddress.
-
property
media
¶
-
model
¶ alias of
mailinglists.models.VerbatimAddress
-
property
mailinglists.apps module¶
Configuration for the mailinglists package
mailinglists.gsuite module¶
GSuite syncing helpers defined by the mailinglists package
-
class
mailinglists.gsuite.
GSuiteSyncService
(groups_settings_api=<googleapiclient.discovery.Resource object>, directory_api=<googleapiclient.discovery.Resource object>)[source]¶ Bases:
object
-
class
GroupData
(name, description='', moderated=False, aliases=(), addresses=())[source]¶ Bases:
object
-
delete_group
(name: str)[source]¶ Set the specified list to unused, this is not a real delete :param name: Group name
-
static
mailinglist_to_group
(mailinglist: mailinglists.models.MailingList)[source]¶ Convert a mailinglist model to everything we need for GSuite
-
sync_mailinglists
(lists: List[mailinglists.gsuite.GSuiteSyncService.GroupData] = None)[source]¶ Sync mailing lists with GSuite :param lists: optional parameter to determine which lists to sync
-
class
mailinglists.models module¶
The models defined by the mailinglists package
-
class
mailinglists.models.
ListAlias
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
Model describing an alias of a mailing list.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
alias
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
mailinglist
¶ 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.
-
mailinglist_id
¶
-
objects
= <django.db.models.manager.Manager object>¶
-
exception
-
class
mailinglists.models.
MailingList
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
Model describing mailing lists.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
addresses
¶ 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.
-
aliases
¶ 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.
-
description
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
member_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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
membergroup
¶ 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.
-
members
¶ 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
moderated
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
name
¶ 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>¶
-
exception
-
class
mailinglists.models.
VerbatimAddress
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
Model that describes an email address subscribed to a mailing list.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
address
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
mailinglist
¶ 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.
-
mailinglist_id
¶
-
objects
= <django.db.models.manager.Manager object>¶
-
exception