Fixes in documentation

This commit is contained in:
absurdo 2023-11-04 21:15:44 +01:00
parent cfb70403c1
commit dc58175760
13 changed files with 119 additions and 113 deletions

View file

@ -741,7 +741,8 @@ class WebModel:
raw_query (bool): If True, if foreignkeyfields exists, are not selected. If False, foreignkeyfields are selected too if foreignkeyfield are in arr_select.
Returns:
Return cursor db for get data using loops or other if operation is successful, if not, return False.
false (bool): If return false, the db connection is down.
sql_cursor (cursor): Return cursor db for get data using loops or other if operation is successful, if not, return False.
"""
@ -865,7 +866,7 @@ class WebModel:
cursor (Db cursor): A typical db cursor of python sql interface standard.
Returns:
dict: Return a dictionary with the row selected.
row (dict): Return a dictionary with the row selected.
"""
@ -906,7 +907,7 @@ class WebModel:
raw_query (bool): If True, if foreignkeyfields exists, are not selected. If False, foreignkeyfields are selected too if foreignkeyfield are in arr_select.
Returns:
dict: Returns dict with the row values.
row (dict): Returns dict with the row values.
"""
self.conditions=['WHERE `'+self.name+'`.`'+self.name_field_id+'`=%s', [id]]
@ -936,7 +937,7 @@ class WebModel:
raw_query (bool): If True, if foreignkeyfields exists, are not selected. If False, foreignkeyfields are selected too if foreignkeyfield are in arr_select.
Returns:
dict: Returns dict with the row values.
row (dict): Returns dict with the row values.
"""
self.limit="limit "+str(begin)+", 1"
@ -963,7 +964,7 @@ class WebModel:
raw_query (bool): If True, if foreignkeyfields exists, are not selected. If False, foreignkeyfields are selected too if foreignkeyfield are in arr_select.
Returns:
dict: Returns dict with the row values.
row_values (dict): Returns dict with the row values.
"""
@ -1013,7 +1014,7 @@ class WebModel:
raw_query (bool): If True, if foreignkeyfields exists, are not selected. If False, foreignkeyfields are selected too if foreignkeyfield are in arr_select.
Returns:
dict: Returns dict with the row values.
row (dict): Returns dict with the row values.
"""
if integer:
@ -1064,12 +1065,11 @@ class WebModel:
"""Method for get a typical sql count using conditions
Args:
Args:
fields_selected (dict): A list with the name of the fields how defined in PhangoField.
field_to_count (str): The field
raw_query (bool): If True, if foreignkeyfields exists, are not selected. If False, foreignkeyfields are selected too if foreignkeyfield are in arr_select.
Returns:
int: Returns the number of elements selected.
num_elecments (int): Returns the number of elements selected.
"""
# Connect to db
@ -1120,7 +1120,7 @@ class WebModel:
"""Method for delete a series of rows using conditions
Returns:
bool: If delete is successfully, return True, if not, return False.
bool (bool): If delete is successfully, return True, if not, return False.
"""
#self.connect_to_db()
@ -1166,7 +1166,7 @@ class WebModel:
in_list (list): List with numbers items.
Returns:
string with (1,2,3) sql sentence filtered.
sql_filtered (str): with (1,2,3) sql sentence filtered.
"""
@ -1185,7 +1185,7 @@ class WebModel:
in_list (list): List with value items.
Returns:
string with (value1, value2, value3) sql sentence filtered.
sql_filtered (str): (value1, value2, value3) sql sentence filtered.
"""
for x in range(0, len(in_list)):
@ -1359,7 +1359,7 @@ class WebModel:
"""Method for drop a table based in this model
Returns:
Return True if table was dropped successfully, false if table can't be dropped.
sql_str (str): Return the sql query for drop the table represented by this model
"""
return self.query('DROP TABLE '+self.name, [], self.connection_id)
@ -1381,8 +1381,10 @@ class WebModel:
errors_set (str): If insert value, the errors are set for insert sql statement, if update value, then the errors are set for update sql statement.
Returns:
Return False if checking is wrong. If not False returns a tuple with fields filtered, original values as values and values filtered how update_values
return (fields, values, update_values)
wrong (bool): Return False if checking is wrong. If not False returns a tuple with fields filtered, original values as values and values filtered how update_values
fields (list): list with fields
values (dict): dict with values
update_values (dict): dict with updated values with checking
"""
fields=[]
@ -1579,7 +1581,7 @@ class WebModel:
"""Get all errors of model last operation.
Returns:
str: A string with all errors.
error_txt (str): A string with all errors.
"""
arr_error=[]
@ -1604,7 +1606,7 @@ class WebModel:
"""Get all errors and save in dictionary
Returns:
dict: Return a dict where the key is the field where the error exists and value is the error text.
errors (dict): Return a dict where the key is the field where the error exists and value is the error text.
"""
arr_error= {}
@ -1666,7 +1668,7 @@ class WebModel:
"""Prepare a dict with values using fields keys how base
Returns:
dict: Return a dict with values without checking anything.
post (dict): Return a dict with values without checking anything.
"""
for k in self.fields.keys():