customers module

class customers.Customers(db_path_name)

Bases: dbparam.DbParam

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

Customer 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 :param value: string to verify :return: True if the value is a valid string otherwise returns False

add()

Add a customer.

Returns:Customer name added or False if the customer already exists.
delete()

Delete a customer.

Returns:Customer name deleted or False if the customer already exists.
list()

List the table customers ordered alphabetically.

Returns:True
modify()

Modify a customer.

Returns:Customer original name and new_name, or False if the customer do not exists.