improved getCounter kwargs parameters read

This commit is contained in:
Adolfo Gómez García 2020-07-30 06:21:03 +02:00
parent 0664968352
commit 50fc172fd7

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013-202 Virtual Cable S.L.U.
# Copyright (c) 2013-2020 Virtual Cable S.L.U.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -88,9 +88,9 @@ def getCounters(obj: typing.Any, counterType: int, **kwargs) -> typing.Generator
"""
from uds.models import NEVER
since = kwargs.get('since', NEVER)
to = kwargs.get('to', datetime.datetime.now())
limit = kwargs.get('limit', 1000)
since = kwargs.get('since') or NEVER
to = kwargs.get('to') or datetime.datetime.now()
limit = kwargs.get('limit') or 1000
use_max = kwargs.get('use_max', False)
type_ = type(obj)