Forms
This module uses a rather sophisticated forms setup in order to provide the user with the ability to test their entered credentials and their connection to the Jira backend as well as caching the connection for future requests.
- class JiraAuthenticationForm(*args, **kwargs)[source]
Base class for all the forms which handle jira connections. All derived forms provide a way to communicate with the jira backend through the client property.
- username
The username used for the authentication at the API.
- password
The password used for the authentication at the API.
- property client: jira.client.JIRA
A client which can be used to communicate with the jira backend. E.g. to import/export stories. This property only becomes available when the form was configured to test the connection and after the form was successfully validated.
Use this whenever you want to communicate with the jira backend in order to prevent multiple authentication requests during the handling of the same form.
- Param
A JIRA instance which can be used to communicate with the jira backend.
- _get_connection() planning_poker_jira.models.JiraConnection[source]
This method should be implemented by all the child classes in order to provide a JiraConnection instance. The provided JiraConnection is used during the form’s validation process.
The returned instance does not have to be a saved instance from the database.
- Returns
A JiraConnection which can be used to retrieve a JIRA instance.
- _requires_connection_test() bool[source]
Determine whether the connection to the jira backend should be tested. This method gets called during the form’s validation process in order to determine whether the connection should be tested and therefore whether the `client` property will be populated or not.
Since most use cases require the connection to be tested this implementation will always return True. Child classes however can override this method to make the test optional (see the class`JiraConnectionForm` for an example) if needed.
- Returns
Whether the connection should be tested.
- clean() Dict[str, Any][source]
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- property media
Return all media required to render the widgets on this form.
- class JiraConnectionForm(*args, **kwargs)[source]
Bases:
planning_poker_jira.forms.JiraAuthenticationForm,django.forms.models.ModelFormForm which is used for the JiraConnectionAdmin class. This is used for the change and create views.
- test_connection
Determines whether the connection should be tested.
- delete_password
Determines whether the saved password should be deleted.
- clean()[source]
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- property media
Return all media required to render the widgets on this form.
- class ExportStoryPointsForm(*args, **kwargs)[source]
Bases:
planning_poker_jira.forms.JiraAuthenticationFormForm which is used for exporting stories to the jira backend.
- jira_connection
The Jira backend you want to export the story points to.
- property media
Return all media required to render the widgets on this form.
- class ImportStoriesForm(connection: planning_poker_jira.models.JiraConnection, *args, **kwargs)[source]
Bases:
planning_poker_jira.forms.JiraAuthenticationFormForm which is used for importing stories from the jira backend.
- poker_session
Optional: The poker session to which you want to import the stories.
- jql_query
The query which should be used to retrieve the stories from the Jira backend.
- property media
Return all media required to render the widgets on this form.