Models Module
- class action_triggers.models.BaseAction(*args, **kwargs)[source]
Bases:
Model
Abstract model to represent an action.
- TIMEOUT_SETTING_KEY: str
- property timeout_respecting_max: float | None
Return the timeout respecting the maximum timeout setting.
- Returns:
The timeout respecting the maximum timeout setting.
- timeout_secs
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class action_triggers.models.Config(*args, **kwargs)[source]
Bases:
Model
Model to represent the action triggers configuration.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- active
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- config_signals
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.
- content_types
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.
- created_by
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.
- created_by_id
- created_on
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_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
- get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- message_broker_queues
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.
- objects = <django.db.models.manager.ManagerFromConfigQuerySet object>
- payload
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- webhooks
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.
- class action_triggers.models.ConfigQuerySet(model=None, query=None, using=None, hints=None)[source]
Bases:
QuerySet
Custom queryset for the Config model.
- active() ConfigQuerySet [source]
Return only active configurations.
- Returns:
A queryset of active configurations
- Return type:
- for_model(model: Model | Type[Model]) ConfigQuerySet [source]
Return only configurations for the given model.
- Parameters:
model (Union[models.Model, Type[models.Model]]) – The model to filter by.
- Returns:
A queryset of configurations for the given model
- Return type:
- for_signal(signal: SignalChoices) ConfigQuerySet [source]
Return only configurations for the given signal.
- Parameters:
signal (SignalChoices) – The signal to filter by.
- Returns:
A queryset of configurations for the given signal
- Return type:
- class action_triggers.models.ConfigSignal(*args, **kwargs)[source]
Bases:
Model
Model to represent the type of signals to trigger for.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- config
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.
- config_id
- get_signal_display(*, field=<django.db.models.fields.CharField: signal>)
- 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>
- signal
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class action_triggers.models.MessageBrokerQueue(*args, **kwargs)[source]
Bases:
BaseAction
Model to represent a message broker queue configuration.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- TIMEOUT_SETTING_KEY: str = 'MAX_BROKER_TIMEOUT'
- config
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.
- config_id
- conn_details
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.
- 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>
- parameters
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- timeout_secs
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class action_triggers.models.Webhook(*args, **kwargs)[source]
Bases:
BaseAction
Model to represent the webhook configuration.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- TIMEOUT_SETTING_KEY: str = 'MAX_WEBHOOK_TIMEOUT'
- config
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.
- config_id
- get_http_method_display(*, field=<django.db.models.fields.CharField: http_method>)
- headers
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- http_method
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.
- is_endpoint_whitelisted() bool [source]
Check if the webhook endpoint is whitelisted.
- Returns:
True if the endpoint is whitelisted, False otherwise.
- objects = <django.db.models.manager.Manager object>
- timeout_secs
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.