Views

Views of the dasf-broker-django app to be imported via the url config (see dasf_broker.urls).

Classes:

BrokerTopicPingView(**kwargs)

View to ping a broker topic.

BrokerTopicStatusView(**kwargs)

Get a hint on the status of a broker topic.

HttpResponseServiceUnavailable([content])

class dasf_broker.views.BrokerTopicPingView(**kwargs)

Bases: PermissionRequiredMixin, SingleObjectMixin, View

View to ping a broker topic.

Attributes:

accept_global_perms

permission_required

Methods:

check_permissions(request)

Checks if request.user has all permissions returned by get_required_permissions method.

get(request, *args, **kwargs)

post(request, *args, **kwargs)

Models:

model

alias of BrokerTopic

accept_global_perms = True
check_permissions(request)

Checks if request.user has all permissions returned by get_required_permissions method.

Parameters:

request – Original request.

get(request, *args, **kwargs)
model

alias of BrokerTopic Miscellaneous:

DoesNotExist

MultipleObjectsReturned

Classes:

StoreMessageChoices(value)

Choices for storing messages.

Attributes:

availability

Get the online/offline status for the topic.

brokermessage_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

consumers

effective_store_messages

Get the store message rule for this topic.

is_response_topic

Is this topic a responsetopic?

objects

producers

responsetopic

Accessor to the related object on the reverse side of a one-to-one relation.

responsetopics

Accessor to the related objects manager on the reverse side of a many-to-one relation.

status_viewers

Methods:

build_websocket_url(request[, route])

create_and_send_message(user, content)

Create and send a message for the user

get_next_by_date_created(*[, field, is_next])

get_outstanding_messages([user])

Get the messages that still need to be send.

get_previous_by_date_created(*[, field, is_next])

get_store_messages_display(*[, field])

get_websocket_url(request)

Get the websocket url for this topic.

ping()

Create a ping message and send it to the consumer.

Model Fields:

date_created

A wrapper for a deferred-loading field.

garbage_collect_on

A wrapper for a deferred-loading field.

id

A wrapper for a deferred-loading field.

is_public

A wrapper for a deferred-loading field.

last_ping

A wrapper for a deferred-loading field.

last_pong

A wrapper for a deferred-loading field.

slug

A wrapper for a deferred-loading field.

store_messages

A wrapper for a deferred-loading field.

supports_dasf

A wrapper for a deferred-loading field.

permission_required = 'dasf_broker.can_produce'
post(request, *args, **kwargs)
class dasf_broker.views.BrokerTopicStatusView(**kwargs)

Bases: PermissionRequiredMixin, BaseDetailView

Get a hint on the status of a broker topic.

Attributes:

accept_global_perms

any_perm

permission_required

Methods:

check_permissions(request)

Checks if request.user has all permissions returned by get_required_permissions method.

render_to_response(context)

Models:

model

alias of BrokerTopic

accept_global_perms = True
any_perm = True
check_permissions(request)

Checks if request.user has all permissions returned by get_required_permissions method.

Parameters:

request – Original request.

model

alias of BrokerTopic Miscellaneous:

DoesNotExist

MultipleObjectsReturned

Classes:

StoreMessageChoices(value)

Choices for storing messages.

Attributes:

availability

Get the online/offline status for the topic.

brokermessage_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

consumers

effective_store_messages

Get the store message rule for this topic.

is_response_topic

Is this topic a responsetopic?

objects

producers

responsetopic

Accessor to the related object on the reverse side of a one-to-one relation.

responsetopics

Accessor to the related objects manager on the reverse side of a many-to-one relation.

status_viewers

Methods:

build_websocket_url(request[, route])

create_and_send_message(user, content)

Create and send a message for the user

get_next_by_date_created(*[, field, is_next])

get_outstanding_messages([user])

Get the messages that still need to be send.

get_previous_by_date_created(*[, field, is_next])

get_store_messages_display(*[, field])

get_websocket_url(request)

Get the websocket url for this topic.

ping()

Create a ping message and send it to the consumer.

Model Fields:

date_created

A wrapper for a deferred-loading field.

garbage_collect_on

A wrapper for a deferred-loading field.

id

A wrapper for a deferred-loading field.

is_public

A wrapper for a deferred-loading field.

last_ping

A wrapper for a deferred-loading field.

last_pong

A wrapper for a deferred-loading field.

slug

A wrapper for a deferred-loading field.

store_messages

A wrapper for a deferred-loading field.

supports_dasf

A wrapper for a deferred-loading field.

permission_required = ['dasf_broker.can_view_status', 'dasf_broker.can_produce', 'dasf_broker.can_consume']
render_to_response(context)
class dasf_broker.views.HttpResponseServiceUnavailable(content=b'', *args, **kwargs)

Bases: HttpResponse

Attributes:

status_code

status_code = 503