Project general views

Base exercise views.

create_selection_collection(model: type[Category | Source], user: UserApp) list

Create collection of items for selections.

class ExerciseParamsView(**kwargs)

Bases: CheckLoginPermissionMixin, TemplateView

Term term exercise conditions choice view.

template_name = ''

The exercise params view template path (str).

exercise_url = ''

URL of the exercise to redirect to after selecting parameters (str). For example:

exercise_url = reverse_lazy('glossary:exercise')
form = None

The exercise params form (Form).

get_context_data(**kwargs: object) dict[str, object]

Add exercise params form to context.

post(request: HttpRequest) HttpResponse

Get user task condition.

save_params(user: AbstractBaseUser, task_conditions: dict) None

Save the user exercise params to database.

Parameters:
  • user (AbstractBaseUser) – The current user.

  • task_conditions (dict) – The task conditions to save.

Raises:

NotImplementedError – if the method is not overridden.