pushnotifications package¶
Subpackages¶
Submodules¶
pushnotifications.admin module¶
The admin interfaces registered by the pushnotifications package.
-
class
pushnotifications.admin.DeviceAdmin(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdminManage the devices.
-
actions= ('enable', 'disable')¶
-
list_display= ('name', 'type', 'active', 'date_created')¶
-
list_filter= ('active', 'type')¶
-
property
media¶
-
ordering= ('user__first_name',)¶
-
search_fields= ('registration_id', 'user__username', 'user__first_name', 'user__last_name')¶
-
-
class
pushnotifications.admin.MessageAdmin(model, admin_site)[source]¶ Bases:
utils.translation.TranslatedModelAdminManage normal messages.
-
date_hierarchy= 'sent'¶
-
exclude= None¶
-
fields= None¶
-
filter_horizontal= ('users',)¶
-
list_display= ('title', 'body', 'category', 'url', 'sent', 'success', 'failure')¶
-
list_filter= (<class 'pushnotifications.admin.MessageSentFilter'>, 'category')¶
-
property
media¶
-
search_fields= ()¶
-
-
class
pushnotifications.admin.MessageSentFilter(request, params, model, model_admin)[source]¶ Bases:
django.contrib.admin.filters.SimpleListFilterFilter the push notifications on whether they are sent or not.
-
lookups(request, model_admin)[source]¶ Must be overridden to return a list of tuples (value, verbose value)
-
parameter_name= 'is_sent'¶
-
title= 'sent'¶
-
-
class
pushnotifications.admin.ScheduledMessageAdmin(model, admin_site)[source]¶ Bases:
utils.translation.TranslatedModelAdminManage scheduled messages.
-
date_hierarchy= 'time'¶
-
exclude= None¶
-
fields= None¶
-
filter_horizontal= ('users',)¶
-
list_display= ('title', 'body', 'time', 'category', 'sent', 'success', 'failure')¶
-
list_filter= (<class 'pushnotifications.admin.MessageSentFilter'>, 'category')¶
-
property
media¶
-
search_fields= ()¶
-
pushnotifications.apps module¶
Configuration for the pushnotifications package.
pushnotifications.models module¶
The models defined by the pushnotifications package.
-
class
pushnotifications.models.Category(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelDescribes a Message category.
-
BOARD= 'board'¶
-
exception
DoesNotExist¶
-
EVENT= 'event'¶
-
GENERAL= 'general'¶
-
exception
MultipleObjectsReturned¶
-
NEWSLETTER= 'newsletter'¶
-
PARTNER= 'partner'¶
-
PHOTO= 'photo'¶
-
PIZZA= 'pizza'¶
-
property
description¶ Accessor that fetches the localized variant of description
-
description_en¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
device_set¶ 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.toppingsandTopping.pizzasareManyToManyDescriptorinstances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
key¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
message_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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
property
name¶ Accessor that fetches the localized variant of name
-
name_en¶ 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>¶
-
-
class
pushnotifications.models.Device(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelDescribes a device.
-
DEVICE_TYPES= (('ios', 'iOS'), ('android', 'Android'))¶
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
active¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
date_created¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_language_display(*, field=<django.db.models.fields.CharField: language>)¶
-
get_next_by_date_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=True, **kwargs)¶
-
get_previous_by_date_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=False, **kwargs)¶
-
get_type_display(*, field=<django.db.models.fields.CharField: type>)¶
-
id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
language¶ 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>¶
-
receive_category¶ 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.toppingsandTopping.pizzasareManyToManyDescriptorinstances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
registration_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
type¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
user¶ 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.parentis aForwardManyToOneDescriptorinstance.
-
user_id¶
-
-
class
pushnotifications.models.Message(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelDescribes a push notification.
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
all_objects= <pushnotifications.models.MessageManager object>¶
-
property
body¶ Accessor that fetches the localized variant of body
-
body_en¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
category¶ 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.parentis aForwardManyToOneDescriptorinstance.
-
category_id¶
-
failure¶ 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.
-
objects= <pushnotifications.models.NormalMessageManager object>¶
-
scheduledmessage¶ 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.restaurantis aReverseOneToOneDescriptorinstance.
-
sent¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
success¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
property
title¶ Accessor that fetches the localized variant of title
-
title_en¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
url¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
users¶ 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.toppingsandTopping.pizzasareManyToManyDescriptorinstances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
exception
-
class
pushnotifications.models.MessageManager(*args, **kwargs)[source]¶ Bases:
django.db.models.manager.ManagerReturns all messages.
-
class
pushnotifications.models.NormalMessageManager(*args, **kwargs)[source]¶ Bases:
django.db.models.manager.ManagerReturns manual messages only.
-
class
pushnotifications.models.ScheduledMessage(*args, **kwargs)[source]¶ Bases:
pushnotifications.models.MessageDescribes a scheduled push notification.
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶ Bases:
pushnotifications.models.Message.MultipleObjectsReturned
-
album_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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
executed¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_next_by_time(*, field=<django.db.models.fields.DateTimeField: time>, is_next=True, **kwargs)¶
-
get_previous_by_time(*, field=<django.db.models.fields.DateTimeField: time>, is_next=False, **kwargs)¶
-
message_ptr¶ 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.placeis aForwardOneToOneDescriptorinstance.
-
message_ptr_id¶
-
objects= <pushnotifications.models.ScheduledMessageManager object>¶
-
pizzaevent¶ 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.restaurantis aReverseOneToOneDescriptorinstance.
-
registration_event¶ 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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
scheduled¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
start_event¶ 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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
time¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
pushnotifications.urls module¶
The routes defined by the pushnotifications package.