17 lines
475 B
Python
17 lines
475 B
Python
from django.conf import settings
|
|
|
|
from core.db import orm
|
|
|
|
|
|
def remove_defaults(query_params):
|
|
for field, value in list(query_params.items()):
|
|
if field in settings.DRUGS_DEFAULT_PARAMS:
|
|
if value == settings.DRUGS_DEFAULT_PARAMS[field]:
|
|
del query_params[field]
|
|
|
|
|
|
def add_defaults(query_params):
|
|
for field, value in settings.DRUGS_DEFAULT_PARAMS.items():
|
|
if field not in query_params:
|
|
query_params[field] = value
|