sites module

class sites.Sites(db_path_name)

Bases: dbparam.DbParam

Sites worker to operate DB on table sites (list, add, modify and delete methods).

Site name has to be alphanumeric and less than 20 characters. At the DB all the spaces " " will be replaced by underscores "_".

static _check_value(value)

Verifies the value to be alphanumeric string, and less than 20 characters.

Parameters:value – string to verify
Returns:True if the value is a valid string otherwise returns False
add()

Add a site.

Returns:Site name added or False if the parent Customer do not exists, or the site already exists.
delete()

Delete a site.

Returns:Site name deleted or False if the site do not exists.
list()

List the table sites ordered alphabetically, and filtered by customer if that option was selected.

Returns:True if the site was listed or False if the customer do not exists.
modify()

Modify a site.

Returns:Site original name and new_name name, or False if there is with parent Customer or site