-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb3ffed
commit 6af616a
Showing
1 changed file
with
12 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
def get_data_format_stylish(value): | ||
if isinstance(value, str): | ||
return value | ||
data_format = value | ||
elif value is None: | ||
return 'null' | ||
return str(value).lower() | ||
data_format = 'null' | ||
else: | ||
data_format = str(value).lower() | ||
return data_format | ||
|
||
|
||
def get_data_format_plain(value): | ||
if isinstance(value, dict): | ||
return '[complex value]' | ||
data_format = '[complex value]' | ||
elif isinstance(value, bool): | ||
return str(value).lower() | ||
data_format = str(value).lower() | ||
elif isinstance(value, str): | ||
return f"'{value}'" | ||
data_format = f"'{value}'" | ||
elif value is None: | ||
return 'null' | ||
return str(value) | ||
data_format = 'null' | ||
else: | ||
data_format = str(value) | ||
return data_format |