Models

class modelsubscription.models.SubscriptableMixin(*args, **kwargs)

Subscriptable Mixin to aggregate subscription funcionality to a any model

save(*args, **kwargs)

Save the object, and run the subscriptions if SUBSCRIPTION_RUN_ON_CHANGE is set to True

subscribe_email(email, typ)

Create a subscription of the typ type to this object for a email

subscribe_user(user, typ)

Create a subscription of the typ type to this object for a user

unsubscribe_email(email, typ=None)

Remove a subscription of the typ type to this object for a email

If typ is None, remove all subscriptions of this email

unsubscribe_user(user, typ=None)

Remove a subscription of the typ type to this object for a user

If typ is None, remove all subscriptions of this user

class modelsubscription.models.Subscription(*args, **kwargs)

Subscription objects store subscription from user or email to objects

Every subscription have a type with his own handler

run(obj, **kwargs)

Run the handler of the subscription type for the obj param

class modelsubscription.models.SubscriptionEvent(*args, **kwargs)

Model to store events when dbhandler is runned

Handlers

class modelsubscription.handlers.dbhandler.DbHandler

DB Subscription Handler, store data in a django model when is runned

classmethod run(subscription, obj, **kwargs)

Store in the SubscriptionEvent model a reference to the subscription, the object, and a json of the kwargs

class modelsubscription.handlers.emailhandler.EmailHandler

Email Subscription Handler, send an email when is runned

classmethod run(subscription, obj, **kwargs)

send an email to the subscription.email or the subscription.user.email

Generate the email text from the templates modelsubscription/email/subject.txt and modelsubscription/email/body.txt with **kwargs and invitation in the context.

class modelsubscription.handlers.subscriptionhandlerbase.SubscriptionHandlerBase

Abstract class for Subscription Handlers

classmethod run(subscription, obj, *args)

Abstract method

Project Versions

Table Of Contents

Previous topic

Welcome to django-modelsubscription’s documentation!

This Page