autowisp.browser_interface.home.create_project_view module

Class Inheritance Diagram

Inheritance diagram of CreateProjectView, HttpResponseRedirect, MasterConfigView, Namespace, Project, WalkFSView

Define the view for creating new AutoWISP projects.

class autowisp.browser_interface.home.create_project_view.CreateProjectView(**kwargs)[source]

Bases: WalkFSView

Inheritance diagram of autowisp.browser_interface.home.create_project_view.CreateProjectView

View to create a new AutoWISP project.

_create_project(config)[source]

Create a new project following the given configuration.

_get_context(config, search_dir)[source]

Return the context required by the home selection template.

_load_master_config(request)[source]

Load master configuration from user-supplied JSON file.

_save_form(request)[source]

Save the current state of the form to the session.

cancel_url_name = 'home:new_project'

The URL name to redirect to when the cancel button is pressed.

db_fname = 'autowisp.db'

The base filename of the SQLite database tracking all projects.

get(request, dirname=None)[source]

Display the appropriate project cretion page per the current mode.

The expected arguments depend on the mode:

Parameters:

dirname (str, optional) – Directory name to display contents of when selecting project home or where new directory or new project will be created.

mode = 'create_project'

What mode this view is in.

Possible values:

"select_home": Display the project home director selection page.

"create_dir": Allow specifying name of directory to create.

"create_project": Create a new project in the specified directory.

"change_master_usage": Toggle the

post(request, *_args, **_kwargs)[source]

Handle POST request to create a new directory.

Parameters:

request – The HTTP request object.

template = 'home/create_project.html'

The template used to display the project creation page.

url_name = 'home:new_project'

The URL name for this view.

class autowisp.browser_interface.home.create_project_view.MasterConfigView(**kwargs)[source]

Bases: CreateProjectView

Inheritance diagram of autowisp.browser_interface.home.create_project_view.MasterConfigView

Handle master configuration part of the project creation view.

get(request, master_type, **kwargs)[source]

Handle a change to the master configuration by the user.

If kwargs is empty, the master is toggled between enabled and disabled. Otherwise, it should contain a single key ("split" or "match") with a value a single tuple specifying the change: (old expression, new expression). If old expression is None, the corresponding list is extended.