Example #1
0
def db_add_blacklist(phone):
    """Add a new blacklisted phone to the database.

    Args:
        phone (str): Phone of the contact.

    Returns:
        ID of the inserted element.
    """
    return DB.insert({'name': None, 'phone': phone, 'blacklisted': True})
Example #2
0
def db_add_contact(name, phone):
    """Add a new contact to the database.

    Args:
        name (str): Name to use for the contact.
        phone (str): Phone of the contact.

    Returns:
        ID of the inserted element.
    """
    return DB.insert({
        'name': name.lower(),
        'phone': phone,
        'blacklisted': False
    })