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 returnsFalse
-
add
()¶ Add a site.
Returns: Site
name added orFalse
if the parent Customer do not exists, or the site already exists.
-
delete
()¶ Delete a site.
Returns: Site
name deleted orFalse
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 orFalse
if the customer do not exists.
-
modify
()¶ Modify a site.
Returns: Site
original name andnew_name
name, orFalse
if there is with parent Customer or site
-
static