mirror of
https://github.com/chibicitiberiu/ytsm.git
synced 2024-02-24 05:43:31 +00:00
Integrated django-dynamic-preferences library into project. Settings are now stored in the database, the ini file only contains a minimal number of settings.
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
|
||||
def first_non_null(*iterable):
|
||||
'''
|
||||
Returns the first element from the iterable which is not None.
|
||||
If all the elements are 'None', 'None' is returned.
|
||||
:param iterable: Iterable containing list of elements.
|
||||
:return: First non-null element, or None if all elements are 'None'.
|
||||
'''
|
||||
return next((item for item in iterable if item is not None), None)
|
||||
|
Reference in New Issue
Block a user