
    ]j                     2    d dl mZ d dlmZ d ZddZddZy)    )settings)_get_querysetc                 |    t        |       }	  |j                  |i |S # |j                  j                  $ r Y yw xY w)aC  
    Uses get() to return an object or None if the object does not exist.

    klass may be a Model, Manager, or QuerySet object. All other passed
    arguments and keyword arguments are used in the get() query.

    Note: Like with get(), a MultipleObjectsReturned will be raised if more than one
    object is found.
    N)r   getmodelDoesNotExist)klassargskwargsquerysets       </root/env/lib/python3.12/site-packages/annoying/functions.pyget_object_or_Noner      sE     U#Hx||T,V,,>>&& s    ;;Nc                 $    t        t        | |      S )z
    Get settings from django.conf if exists,
    return default value otherwise

    example:

    ADMIN_EMAIL = get_config('ADMIN_EMAIL', 'default@email.com')
    )getattrr   )keydefaults     r   
get_configr      s     8S'**    c                 (    t        | g|i |xs |S )z
    Uses get() to return an object or the value of <this> argument
    if object does not exist.

    If the <this> argument if not provided None would be returned.
    <model> can be either a QuerySet instance or a class.
    )r   )r   thisr
   r   s       r   get_object_or_thisr   "   s     e5d5f5==r   )N)django.confr   django.shortcutsr   r   r   r    r   r   <module>r      s      *"	+	>r   