示例#1
0
def get_modification_date(registry: Registry) -> datetime:
    """Get the shared modification date for the current transaction.

    This way every date created in one batch/post request
    can use this as default value.
    The frontend relies on this to ease sorting.
    """
    date = getattr(registry, '__modification_date__', None)
    if date is None:
        date = now()
        registry.__modification_date__ = date
    return date
示例#2
0
def get_modification_date(registry: Registry) -> datetime:
    """Get the shared modification date for the current transaction.

    This way every date created in one batch/post request
    can use this as default value.
    The frontend relies on this to ease sorting.
    """
    date = getattr(registry, '__modification_date__', None)
    if date is None:
        date = now()
        registry.__modification_date__ = date
    return date