Пример #1
0
from django.dispatch import Signal

new_payment_query = Signal(providing_args=['order', 'payment'])
new_payment_query.__doc__ = """
Sent to ask for filling Payment object with additional data:
    payment.amount:			total amount of an order
    payment.currency:		amount currency

This data cannot be filled by ``getpaid`` because it is Order structure
agnostic. After filling values just do return.
"""

user_data_query = Signal(providing_args=['order', 'user_data'])
user_data_query.__doc__ = """
Sent to ask for filling user additional data:
    user_data['email']:		user email
    user_data['lang']:      lang code in ISO 2-char format

This data cannot be filled by ``getpaid`` because it is Order structure
agnostic. After filling values just do return.
"""

new_payment = Signal(providing_args=['order', 'payment'])
new_payment.__doc__ = """Sent after creating new payment."""


payment_status_changed = Signal(providing_args=['old_status', 'new_status'])
payment_status_changed.__doc__ = """Sent when Payment status changes."""


order_additional_validation = Signal(providing_args=['request',
Пример #2
0
from django.dispatch import Signal

payment_status_changed = Signal(providing_args=['old_status', 'new_status'])
payment_status_changed.__doc__ = """
Sent when Payment status changes.
	old_status:	str
	new_status:	str
"""

order_items_query = Signal(providing_args=['items'])
order_items_query.__doc__ = """
Sent to ask for order's items.
	items:			list
Listeners must fill the items list with at least one item.
Each item must be a dict instance, with at least 'name' element defined.
Other accepted keys are 'quantity' and 'unit_price' which default to 1 and 0
respectively.
"""

customer_data_query = Signal(providing_args=['customer'])
customer_data_query.__doc__ = """
Sent to ask for customer's data.
	customer:		dict
Handling of this signal will depend on the gateways you want to enable.
Currently, with PayPal, it doesn't have to be answered at all.
The optional arguments accepted by paypal backend are:
first_name, last_name, email, city, postal_code, country_iso
"""

return_urls_query = Signal(providing_args=['urls'])
return_urls_query.__doc__ = """
Пример #3
0
from django.dispatch import Signal

new_subscription = Signal(providing_args=['subscription'])
new_subscription.__doc__ = """Sent after creating a subscription"""

payment_error = Signal(providing_args=['error_code', 'exception'])
payment_error.__doc__ = """Is sent whenever an error occurs during payment"""
Пример #4
0
from django.dispatch import Signal

post_schema_sync = Signal(providing_args=['tenant'])
post_schema_sync.__doc__ = """
Sent after a tenant has been saved, its schema created and synced
"""
Пример #5
0
from django.dispatch import Signal

new_payment_query = Signal(providing_args=['order', 'payment'])
new_payment_query.__doc__ = """
Sent to ask for filling Payment object with additional data:
    payment.amount:			total amount of an order
    payment.currency:		amount currency

This data cannot be filled by ``getpaid`` because it is Order structure
agnostic. After filling values just do return.
"""

user_data_query = Signal(providing_args=['order', 'user_data'])
new_payment_query.__doc__ = """
Sent to ask for filling user additional data:
    user_data['email']:		user email
    user_data['lang']:      lang code in ISO 2-char format

This data cannot be filled by ``getpaid`` because it is Order structure
agnostic. After filling values just do return.
"""

new_payment = Signal(providing_args=['order', 'payment'])
new_payment.__doc__ = """Sent after creating new payment."""


payment_status_changed = Signal(providing_args=['old_status', 'new_status'])
payment_status_changed.__doc__ = """Sent when Payment status changes."""
Пример #6
0
from django.dispatch import Signal

order_started = Signal()
order_started.__doc__ = """
Sent after order was started (awaiting payment)
"""

order_completed = Signal()
order_completed.__doc__ = """
Sent after order was completed (payment accepted, account extended)
"""

user_language = Signal(providing_args=['user', 'language'])
user_language.__doc__ = """Sent to receive information about language for user account"""

account_expired = Signal(providing_args=['user'])
account_expired.__doc__ = """
Sent on account expiration. This signal is send regardless ``account_deactivated`` it only means that account has expired due to plan expire date limit.
"""

account_deactivated = Signal(providing_args=['user'])
account_deactivated.__doc__ = """
Sent on account deactivation, account is not operational (it could be not expired, but does not meet quota limits).
"""

account_activated = Signal(providing_args=['user'])
account_activated.__doc__ = """
Sent on account activation, account is now fully operational.
"""
account_change_plan = Signal(providing_args=['user'])
account_change_plan.__doc__ = """
Пример #7
0
from django.db.models.signals import post_delete
from django.dispatch import Signal, receiver
from django_tenants.utils import get_tenant_model, schema_exists

post_schema_sync = Signal(providing_args=['tenant'])
post_schema_sync.__doc__ = """
Sent after a tenant has been saved, its schema created and synced
"""

schema_needs_to_be_sync = Signal(providing_args=['tenant'])
schema_needs_to_be_sync.__doc__ = """
Schema needs to be synced
"""


@receiver(post_delete)
def tenant_delete_callback(sender, instance, **kwargs):
    if not isinstance(instance, get_tenant_model()):
        return

    if instance.auto_drop_schema and schema_exists(instance.schema_name):
        instance._drop_schema(True)
Пример #8
0
import sys

from django.core.exceptions import ValidationError
from django.dispatch import Signal
from django.http import Http404
from django.shortcuts import get_object_or_404 as get_obj_or_404
from django.urls import path, re_path

link_status_changed = Signal()
link_status_changed.__doc__ = """
Providing arguments: ['link']
"""


def print_info(message):  # pragma no cover
    """
    print info message if calling from management command ``update_all``
    """
    if 'update_topology' in sys.argv:
        print('{0}\n'.format(message))


def get_object_or_404(model, pk, **kwargs):
    """
    retrieves topology with specified arguments or raises 404
    """
    kwargs.update({'pk': pk, 'published': True})
    try:
        return get_obj_or_404(model, **kwargs)
    except ValidationError:
        raise Http404()
Пример #9
0
from django.dispatch import Signal

partner_income_signal = Signal(providing_args=['user', 'amount', 'currency', 'description', 'period'])
partner_income_signal.__doc__ = """
Sent when new payment for an account is made in a system.
"""
Пример #10
0
from django.dispatch import Signal

is_working_changed = Signal()
is_working_changed.__doc__ = """
Providing araguments: [
    'is_working',
    'old_is_working',
    'instance',
    'failure_reason',
    'old_failure_reason'
]
"""
Пример #11
0
from django.dispatch import Signal

subnet_provisioned = Signal()
subnet_provisioned.__doc__ = """
Providing arguments: ['instance', 'provisioned']
"""
Пример #12
0
'''
NOTE: the construction of the sender is based on the urlname and the event.
This allows for listeners to be registered independently of resource construction.
'''

from django.dispatch import Signal

endpoint_event = Signal(providing_args=["endpoint", "event", "item_list"])
endpoint_event.__doc__ = '''
Sent by the endpoint when an event occurs

:param sender: The full url name of the endpoint + ! + the event
:param endpoint: The endpoint emitting the event
:param event: A string representing the event
:param item_list: An item list for which the event applies, may be empty
'''

resource_event = Signal(providing_args=["resource", "event", "item_list"])
resource_event.__doc__ = '''
Sent by the resource when an event occurs

:param sender: The full url name of the resource + ! + the event
:param resource: The resource emitting the event
:param event: A string representing the event
:param item_list: An item list for which the event applies, may be empty
'''
Пример #13
0
from django.dispatch import Signal

transaction_started = Signal()
transaction_started.__doc__ = """
Sent after order was started (awaiting payment)
"""

transaction_was_successful = Signal(providing_args=['invoice'])
transaction_was_successful.__doc__ = """
Sent after order was completed (product, account,order)
"""

transaction_was_unsuccessful = Signal(providing_args=['invoice'])
transaction_was_unsuccessful.__doc__ = """
Sent after order was returned (product, account,order)
"""

order_canceled = Signal(providing_args=['invoice'])
order_canceled.__doc__ = """
Sent after order was canceled (product, account,order)
"""

order_novalid = Signal(providing_args=['product', 'user', 'instance'])
order_novalid.__doc__ = """
Sent after order was canceled (product, account,order)
"""
"""






"""

from django.dispatch import Signal

api_request_started = Signal(providing_args=['request', 'model'])
api_request_started.__doc__ = \
"""
Sent when the API begins processing a request.

Arguments sent with this signal::

    sender:
        The API model class.
    
    request:
        The HttpRequest object for this request.
    
    model:
        The model class of the request.
"""

api_request_finished = Signal(providing_args=['request', 'response'])
api_request_finished.__doc__ = \
"""
Пример #15
0
from django.db.models.signals import pre_delete
from django.dispatch import Signal, receiver

from .utils import get_tenant_model, schema_exists

schema_activate = Signal(providing_args=["schema"])
schema_activate.__doc__ = "Sent after a schema has been activated"

dynamic_tenant_needs_sync = Signal(providing_args=["tenant"])
dynamic_tenant_needs_sync.__doc__ = "Sent when a schema from a dynamic tenant needs to be synced"

dynamic_tenant_post_sync = Signal(providing_args=["tenant"])
dynamic_tenant_post_sync.__doc__ = "Sent after a tenant has been saved, its schema created and synced"

dynamic_tenant_pre_drop = Signal(providing_args=["tenant"])
dynamic_tenant_pre_drop.__doc__ = "Sent when a schema from a dynamic tenant is about to be dropped"


@receiver(pre_delete)
def tenant_delete_callback(sender, instance, **kwargs):
    if not isinstance(instance, get_tenant_model()):
        return
    if instance.auto_drop_schema and schema_exists(instance.schema_name):
        dynamic_tenant_pre_drop.send(sender=get_tenant_model(), tenant=instance.serializable_fields())
        instance.drop_schema()
Пример #16
0
from django.dispatch import Signal

post_schema_sync = Signal(providing_args=['tenant'])
post_schema_sync.__doc__ = """
Sent after a tenant has been saved, its schema created and synced
"""

schema_needs_to_be_sync = Signal(providing_args=['tenant'])
schema_needs_to_be_sync.__doc__ = """
Schema needs to be synced
"""

tenant_assigned = Signal(providing_args=['tenant', 'domain'])
tenant_assigned.__doc__ = """
Sent after the tenant assigned.
"""
Пример #17
0
'''
NOTE: the construction of the sender is based on the urlname and the event.
This allows for listeners to be registered independently of resource construction.
'''

from django.dispatch import Signal


endpoint_event = Signal(providing_args=["endpoint", "event", "item_list"])
endpoint_event.__doc__ = '''
Sent by the endpoint when an event occurs

:param sender: The full url name of the endpoint + ! + the event
:param endpoint: The endpoint emitting the event
:param event: A string representing the event
:param item_list: An item list for which the event applies, may be empty
'''

resource_event = Signal(providing_args=["resource", "event", "item_list"])
resource_event.__doc__ = '''
Sent by the resource when an event occurs

:param sender: The full url name of the resource + ! + the event
:param resource: The resource emitting the event
:param event: A string representing the event
:param item_list: An item list for which the event applies, may be empty
'''
Пример #18
0
from django.dispatch import Signal

post_schema_create = Signal(providing_args=['tenant'])
post_schema_create.__doc__ = """
Sent after a tenant's schema has been created.

It's ideal for starting the database syncing process after this with a task queue!
"""

pre_schema_delete = Signal(providing_args=['tenant'])
pre_schema_delete.__doc__ = """Sent immediately before a tenant's schema being deleted."""
Пример #19
0
from django.dispatch import Signal

order_started = Signal()
order_started.__doc__ = """
Sent after order was started (awaiting payment)
"""

order_completed = Signal()
order_completed.__doc__ = """
Sent after order was completed (payment accepted, account extended)
"""


user_language = Signal()
user_language.__doc__ = """
Sent to receive information about language for user account

sends arguments: 'user', 'language'
"""

account_automatic_renewal = Signal()
account_automatic_renewal.__doc__ = """
Try to renew the account automatically.
Should renew the user's UserPlan by recurring payments. If this succeeds, the plan should be extended.

sends arguments: 'user'
"""

account_expired = Signal()
account_expired.__doc__ = """
Sent on account expiration.
Пример #20
0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.dispatch import Signal


user_created = Signal(providing_args=['user'])
user_created.__doc__ = """
Signal triggered when a user is automatically created during authentication.

:param sender:
    The function that created the user instance.

:param user:
    The user instance that was created.
"""
Пример #21
0
from django.dispatch import Signal

threshold_crossed = Signal()
threshold_crossed.__doc__ = """
Providing arguments: ['metric', 'alert_settings', 'target', 'first_time']
"""
pre_metric_write = Signal()
pre_metric_write.__doc__ = """
Providing arguments: ['metric', 'values', 'time', 'current']
"""
post_metric_write = Signal()
post_metric_write.__doc__ = """
Providing arguments: ['metric', 'values', 'time', 'current']
"""
Пример #22
0
from django.dispatch import Signal

new_payment_query = Signal(providing_args=['order', 'payment'])
new_payment_query.__doc__ = """
Sent to ask for filling Payment object with additional data:
    payment.amount:			total amount of an order
    payment.currency:		amount currency

This data cannot be filled by ``getpaid`` because it is Order structure
agnostic. After filling values just do return.
"""

user_data_query = Signal(providing_args=['order', 'user_data'])
user_data_query.__doc__ = """
Sent to ask for filling user additional data:
    user_data['email']:		user email
    user_data['lang']:      lang code in ISO 2-char format

This data cannot be filled by ``getpaid`` because it is Order structure
agnostic. After filling values just do return.
"""

new_payment = Signal(providing_args=['order', 'payment'])
new_payment.__doc__ = """Sent after creating new payment."""

payment_status_changed = Signal(providing_args=['old_status', 'new_status'])
payment_status_changed.__doc__ = """Sent when Payment status changes."""

order_additional_validation = Signal(
    providing_args=['request', 'order', 'backend'])
order_additional_validation.__doc__ = """
Пример #23
0
from django.dispatch import Signal

post_schema_sync = Signal(providing_args=['tenant'])
post_schema_sync.__doc__ = """
Sent after a tenant has been saved, its schema created and synced
"""

schema_needs_to_be_sync = Signal(providing_args=['tenant'])
schema_needs_to_be_sync.__doc__ = """
Schema needs to be synced
"""

post_schema_migrate = Signal(providing_args=['tenant'])
post_schema_migrate.__doc__ = """
Sent after migrations have been run on a tenant.
"""
Пример #24
0
def _signal_with_docs(args, doc):
    # FIXME - this fixes the docstring, but not the provided arguments
    # so the API docs look weird.
    signal = Signal(providing_args=args)
    signal.__doc__ = doc
    return signal
Пример #25
0
def _signal_with_docs(args, doc):
    # FIXME - this fixes the docstring, but not the provided arguments
    # so the API docs look weird.
    signal = Signal(providing_args=args)
    signal.__doc__ = doc
    return signal
Пример #26
0
from django.dispatch import Signal

health_status_changed = Signal()
health_status_changed.__doc__ = """
Providing arguments: ['instance', 'status']
"""
device_metrics_received = Signal()
device_metrics_received.__doc__ = """
Providing arguments: ['instance', 'request', 'time', 'current']
"""
Пример #27
0
from django.dispatch import Signal

checksum_requested = Signal()
checksum_requested.__doc__ = """
Providing arguments: ['instance', 'request']
"""
config_download_requested = Signal()
config_download_requested.__doc__ = """
Providing arguments: ['instance', 'request']
"""
config_status_changed = Signal()
config_status_changed.__doc__ = """
Providing arguments: ['instance']
"""
# device and config args are maintained for backward compatibility
config_modified = Signal()
config_modified.__doc__ = """
Providing arguments: ['instance', 'device', 'config', 'previous_status', 'action']
"""
device_registered = Signal()
device_registered.__doc__ = """
Providing arguments: ['instance', 'is_new']
"""
management_ip_changed = Signal()
management_ip_changed.__doc__ = """
Providing arguments: ['instance', 'management_ip', 'old_management_ip']
"""
device_name_changed = Signal()
device_name_changed.__doc__ = """
Providing arguments: ['instance']
"""
Пример #28
0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.dispatch import Signal

user_created = Signal(providing_args=['user'])
user_created.__doc__ = """
Signal triggered when a user is automatically created during authentication.

:param sender:
    The function that created the user instance.

:param user:
    The user instance that was created.
"""
Пример #29
0
from django.dispatch import Signal
"""
Signals to emit to coordinate with other applications depending on flexible_plans
"""

customer_created = Signal(providing_args=['customer'])
customer_created.__doc__ = """
Sent after the creation of the Customer associated to the User
"""

subscription_activate = Signal(providing_args=['subscription'])
subscription_activate.__doc__ = """
Sent after the activation of the Customer Subscription
"""

subscription_deactivate = Signal(providing_args=['subscription'])
subscription_deactivate.__doc__ = """
Sent after the deactivation of the Customer Subscription
"""

subscription_cancel = Signal(providing_args=['subscription'])
subscription_cancel.__doc__ = """
Sent after the Customer cancels the Subscription
"""

subscription_end = Signal(providing_args=['subscription'])
subscription_end.__doc__ = """
Sent after the Subscription ends
"""
Пример #30
0
from django.db.models.signals import post_delete
from django.dispatch import Signal, receiver
from django_tenants.utils import get_tenant_model, schema_exists

post_schema_sync = Signal()
post_schema_sync.__doc__ = """

Sent after a tenant has been saved, its schema created and synced

Argument Required = tenant

"""

schema_needs_to_be_sync = Signal()
schema_needs_to_be_sync.__doc__ = """
Schema needs to be synced

Argument Required = tenant

"""

schema_migrated = Signal()
schema_migrated.__doc__ = """
Sent after migration has finished on a schema

Argument Required = schema_name
"""

schema_migrate_message = Signal()
schema_migrate_message.__doc__ = """
Sent when a message is generated in run migration
Пример #31
0
from django.dispatch import Signal

partner_income_signal = Signal(
    providing_args=['user', 'amount', 'currency', 'description', 'period'])
partner_income_signal.__doc__ = """
Sent when new payment for an account is made in a system.
"""
Пример #32
0
from django.dispatch import Signal

pyga_user_query = Signal(providing_args=['request', 'user_data'])
pyga_user_query.__doc__ = """
Sent to ask for filling user additional data:
    user_data['id']:		user id
Signal passes request from within middleware, asking receiver to proved user
id based on that request.

returned user_data MUST contain id key. If there's no user, set id to None

This data cannot be filled by ``pygawrapper`` because it is host's structure
agnostic. After filling values just do return.

#--------------------------------------------#
# example implementation                     #
#--------------------------------------------#
def pyga_user_query_listener(sender, request, user_data, **kwargs):
    from django.contrib.auth.models import User
    if request.user.is_authenticated():
        pk = request.user.pk
    else:
        pk = None
    user_data.update({'id':pk})

from pygawrapper.signals import pyga_user_query
signals.pyga_user_query.connect(pyga_user_query_listener)

"""
pyga_init_query = Signal(providing_args=['request'])
pyga_user_query.__doc__ = """
Пример #33
0
from django.dispatch import Signal

order_started = Signal()
order_started.__doc__ = """
Sent after order was started (awaiting payment)
"""

order_completed = Signal()
order_completed.__doc__ = """
Sent after order was completed (payment accepted, account extended)
"""


user_language = Signal(providing_args=['user', 'language'])
user_language.__doc__ = """
Sent to receive information about language for user account"""



account_expired = Signal(providing_args=['user'])
account_expired.__doc__ = """
Sent on account expiration. This signal is send regardless
``account_deactivated`` it only means that account has expired due to plan
expire date limit.
"""

account_deactivated = Signal(providing_args=['user'])
account_deactivated.__doc__ = """
Sent on account deactivation, account is not operational (it could be not
expired, but does not meet quota limits).
"""
Пример #34
0
"""
Signals relating to django-contactme.
"""
from django.dispatch import Signal

confirmation_will_be_requested = Signal(providing_args=["data", "request"])
confirmation_will_be_requested.__doc__ = """
Sent just before a confirmation message is requested.

A message is sent to the user right after the contact form is been posted and
validated to verify the user's email address. This signal may be used to ban
email addresses or check message content. If any receiver returns False the
process is discarded and the user receives a discarded message.
"""

confirmation_requested = Signal(providing_args=["data", "request"])
confirmation_requested.__doc__ = """
Sent just after a confirmation message is requested.

A message is sent to the user right after the contact form is been posted
and validated to verify the user's email address. This signal may be uses to
trace contact messages posted but never confirmed.
"""

# Sent just after a contact_msg has been verified.
confirmation_received = Signal(providing_args=["data", "request"])
confirmation_received.__doc__ = """
Sent just after a confirmation has been received.

A confirmation is received when the user clicks on the link provided in the
confirmation message sent by email. This signal may be used to validate that
Пример #35
0
from django.dispatch import Signal

#TODO make into a prioritizing signal processor
control_model = Signal(providing_args=["instance", "cm"])
control_model.__doc__ = """
cm is a dictionary that gets passed through the listeners and the listeners may
choose to modify the cm
"""
Пример #36
0
"""
Signals relating to django-contactme.
"""
from django.dispatch import Signal


confirmation_will_be_requested = Signal(providing_args=["data", "request"])
confirmation_will_be_requested.__doc__ = """
Sent just before a confirmation message is requested.

A message is sent to the user right after the contact form is been posted and 
validated to verify the user's email address. This signal may be used to ban 
email addresses or check message content. If any receiver returns False the 
process is discarded and the user receives a discarded message. 
"""


confirmation_requested = Signal(providing_args=["data", "request"])
confirmation_requested.__doc__ = """
Sent just after a confirmation message is requested.

A message is sent to the user right after the contact form is been posted 
and validated to verify the user's email address. This signal may be uses to
trace contact messages posted but never confirmed.
"""


# Sent just after a contact_msg has been verified.
confirmation_received = Signal(providing_args=["data", "request"])
confirmation_received.__doc__ = """
Sent just after a confirmation has been received.
Пример #37
0
from django.dispatch import Signal

new_payment_query = Signal(providing_args=['order', 'payment'])
new_payment_query.__doc__ = """
Sent to ask for filling Payment object with additional data:
    payment.amount:			total amount of an order
    payment.currency:		amount currency

This data cannot be filled by ``getpaid`` because it is Order structure
agnostic. After filling values just do return.
"""

user_data_query = Signal(providing_args=['order', 'user_data'])
new_payment_query.__doc__ = """
Sent to ask for filling user additional data:
    user_data['email']:		user email
    user_data['lang']:      lang code in ISO 2-char format

This data cannot be filled by ``getpaid`` because it is Order structure
agnostic. After filling values just do return.
"""

new_payment = Signal(providing_args=['order', 'payment'])
new_payment.__doc__ = """Sent after creating new payment."""


payment_status_changed = Signal(providing_args=['old_status', 'new_status'])
payment_status_changed.__doc__ = """Sent when Payment status changes."""


redirecting_to_payment_gateway_signal = Signal(providing_args=['request', 'order', 'payment', 'backend'])
Пример #38
0
from django.dispatch import Signal

order_started = Signal()
order_started.__doc__ = """
Sent after order was started (awaiting payment)
"""

order_completed = Signal()
order_completed.__doc__ = """
Sent after order was completed (payment accepted, account extended)
"""


user_language = Signal(providing_args=['user', 'language'])
user_language.__doc__ = """Sent to receive information about language for user account"""



account_expired = Signal(providing_args=['user'])
account_expired.__doc__ = """
Sent on account expiration. This signal is send regardless ``account_deactivated`` it only means that account has expired due to plan expire date limit.
"""

account_deactivated = Signal(providing_args=['user'])
account_deactivated.__doc__ = """
Sent on account deactivation, account is not operational (it could be not expired, but does not meet quota limits).
"""

account_activated = Signal(providing_args=['user'])
account_activated.__doc__ = """
Sent on account activation, account is now fully operational.
Пример #39
0
from django.db.models.signals import pre_delete
from django.dispatch import Signal, receiver

from .utils import get_tenant_model, schema_exists

schema_post_sync = Signal(providing_args=["tenant"])
schema_post_sync.__doc__ = "Sent after a tenant has been saved, its schema created and synced"

schema_needs_sync = Signal(providing_args=["tenant"])
schema_needs_sync.__doc__ = "Sent when a schema needs to be synced"

schema_pre_drop = Signal(providing_args=["tenant"])
schema_pre_drop.__doc__ = "Sent when a schema is about to be dropped"


@receiver(pre_delete)
def tenant_delete_callback(sender, instance, **kwargs):
    if not isinstance(instance, get_tenant_model()):
        return
    if instance.auto_drop_schema and schema_exists(instance.schema_name):
        schema_pre_drop.send(sender=get_tenant_model(),
                             tenant=instance.serializable_fields())
        instance.drop_schema()
Пример #40
0
from django.dispatch import Signal

new_payment_query = Signal(providing_args=['order', 'payment'])
new_payment_query.__doc__ = """
Sent to ask for filling Payment object with additional data:
    payment.amount:			total amount of an order
    payment.currency:		amount currency

This data cannot be filled by ``getpaid`` because it is Order structure
agnostic. After filling values just do return.
"""

user_data_query = Signal(providing_args=['order', 'user_data'])
new_payment_query.__doc__ = """
Sent to ask for filling user additional data:
    user_data['email']:		user email
    user_data['lang']:      lang code in ISO 2-char format

This data cannot be filled by ``getpaid`` because it is Order structure
agnostic. After filling values just do return.
"""

new_payment = Signal(providing_args=['order', 'payment'])
new_payment.__doc__ = """Sent after creating new payment."""

payment_status_changed = Signal(providing_args=['old_status', 'new_status'])
payment_status_changed.__doc__ = """Sent when Payment status changes."""

redirecting_to_payment_gateway_signal = Signal(
    providing_args=['request', 'order', 'payment', 'backend'])
redirecting_to_payment_gateway_signal.__doc__ = """
Пример #41
0
from django.dispatch import Signal

post_schema_sync = Signal(providing_args=['tenant'])
post_schema_sync.__doc__ = """
Sent after a tenant has been saved, its schema created and synced
"""

schema_needs_to_be_sync = Signal(providing_args=['tenant'])
schema_needs_to_be_sync.__doc__ = """
Schema needs to be synced
"""
Пример #42
0
from django.dispatch import Signal

notify = Signal()
notify.__doc__ = """
Creates notification(s).

Sends arguments: 'recipient', 'actor', 'verb', 'action_object',
    'target', 'description', 'timestamp', 'level', 'type', etc.
"""