This file contains hidden or 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
def generate_login_form(): | |
""" | |
Generates a traditional login form, bootstrap-styled. | |
DEV USE: Look at this function to figure out how to generate | |
forms | |
:return form_skeleton_obj: | |
""" | |
form = [ |
This file contains hidden or 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
def get_mongo(db=[]): | |
""" | |
This function employs a good ol` gotcha with using mutable objects as a default value for an argument to cache | |
the database object. | |
If the `db` arg is an empty list, populate it with the object. | |
Every other call to this function will skip the if clause and return the cached `db` object. | |
Win. | |
""" | |
if db == []: |
NewerOlder