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 returnsFalse
-
add
()¶ Add a customer.
Returns: Customer
name added orFalse
if the customer already exists.
-
delete
()¶ Delete a customer.
Returns: Customer
name deleted orFalse
if the customer already exists.
-
list
()¶ List the table
customers
ordered alphabetically.Returns: True
-
modify
()¶ Modify a customer.
Returns: Customer
original name andnew_name
, orFalse
if the customer do not exists.
-
static