Views¶
-
class
tom_alerts.views.
BrokerQueryCreateView
(**kwargs)¶ View for creating a new query to a broker. Requires authentication.
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
-
get_broker_name
()¶ Returns the broker specified in the request
- Returns
Broker name
- Return type
str
-
get_form_class
()¶ Returns the form class to use in this view. The form class will be the one defined in the specific broker module for which a new query is being created.
-
get_form
()¶ Returns an instance of the form to be used in this view.
- Returns
Form instance
- Return type
django.forms.Form
-
get_initial
()¶ Returns the initial data to use for forms on this view.
- Returns
dict of initial values
- Return type
dict
-
form_valid
(form)¶ Saves the associated
BrokerQuery
and redirects to theBrokerQuery
list.
-
-
class
tom_alerts.views.
BrokerQueryUpdateView
(**kwargs)¶ View that handles the modification of a previously saved
BrokerQuery
. Requires authentication.Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
-
get_object
()¶ Returns the
BrokerQuery
object that corresponds with the ID in the query path.- Returns
BrokerQuery
object- Return type
BrokerQuery
-
get_form_class
()¶ Returns the form class to use in this view. The form class will be the one defined in the specific broker module for which the query is being updated.
-
get_form
()¶ Returns an instance of the form to be used in this view.
- Returns
Form instance
- Return type
django.forms.Form
-
get_initial
()¶ Returns the initial data to use for forms on this view. Initial data for this form consists of the name of the broker that the query is for.
- Returns
dict of initial values
- Return type
dict
-
form_valid
(form)¶ Saves the associated
BrokerQuery
and redirects to theBrokerQuery
list.
-
-
class
tom_alerts.views.
BrokerQueryFilter
(data=None, queryset=None, *, request=None, prefix=None)¶ Defines the available fields for filtering the list of broker queries.
-
class
tom_alerts.views.
BrokerQueryListView
(**kwargs)¶ View that displays all saved
BrokerQuery
objects.Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
-
model
¶ alias of
tom_alerts.models.BrokerQuery
-
filterset_class
¶ alias of
BrokerQueryFilter
-
get_context_data
(*args, **kwargs)¶ Adds the brokers available to the TOM to the context dictionary.
- Returns
context
- Return type
dict
-
-
class
tom_alerts.views.
BrokerQueryDeleteView
(**kwargs)¶ View that handles the deletion of a saved
BrokerQuery
. Requires authentication.Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
-
model
¶ alias of
tom_alerts.models.BrokerQuery
-
-
class
tom_alerts.views.
RunQueryView
(**kwargs)¶ View that handles the running of a specific
BrokerQuery
.Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
-
get_context_data
(*args, **kwargs)¶ Runs the
fetch_alerts
method specific to the givenBrokerQuery
and adds the matching alerts to the context dictionary.- Returns
context
- Return type
dict
-
-
class
tom_alerts.views.
CreateTargetFromAlertView
(**kwargs)¶ View that handles the creation of
Target
objects from aBrokerQuery
result. Requires authentication.Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
-
post
(request, *args, **kwargs)¶ Handles the POST requests to this view. Creates a
Target
for each alert sent in the POST. Redirects to theTargetListView
if multiple targets were created, and theTargetUpdateView
if only one was created. Redirects to theRunQueryView
if noTarget
objects. were successfully created.
-