1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-10 23:50:12 +00:00

linter changes

This commit is contained in:
shashikanth 2021-01-06 19:45:43 +05:30
parent bcf74d74d6
commit a4bad3f7b5
2 changed files with 11 additions and 6 deletions
backend/src/baserow/contrib/database

View file

@ -68,8 +68,9 @@ class DatabaseConfig(AppConfig):
from .views.view_filters import (
EqualViewFilterType, NotEqualViewFilterType, EmptyViewFilterType,
NotEmptyViewFilterType, DateEqualViewFilterType, DateNotEqualViewFilterType,
DateEqualTodayViewFilterType,DateInNearFutureViewFilterType,DateInNearPastViewFilterType,
DateInThisMonthViewFilterType,DateInThisYearViewFilterType,
DateEqualTodayViewFilterType, DateInNearFutureViewFilterType,
DateInNearPastViewFilterType,
DateInThisMonthViewFilterType, DateInThisYearViewFilterType,
HigherThanViewFilterType, LowerThanViewFilterType, ContainsViewFilterType,
ContainsNotViewFilterType, BooleanViewFilterType
)

View file

@ -186,6 +186,7 @@ class DateEqualTodayViewFilterType(ViewFilterType):
f'{field_name}__day': today.day
})
class DateInThisMonthViewFilterType(ViewFilterType):
"""
The date filter parses the provided value as date and checks if the field value is
@ -212,6 +213,7 @@ class DateInThisMonthViewFilterType(ViewFilterType):
f'{field_name}__month': today.month
})
class DateInThisYearViewFilterType(ViewFilterType):
"""
The date filter parses the provided value as date and checks if the field value is
@ -237,6 +239,7 @@ class DateInThisYearViewFilterType(ViewFilterType):
f'{field_name}__year': today.year,
})
class DateInNearFutureViewFilterType(ViewFilterType):
"""
The date filter parses the provided value as date and checks if the field value is
@ -263,8 +266,8 @@ class DateInNearFutureViewFilterType(ViewFilterType):
today = datetime.utcnow()
lastDay = today + timedelta(days=value)
return Q(**{f'{field_name}__lte': lastDay,f'{field_name}__gte': today})
return Q(**{f'{field_name}__lte': lastDay, f'{field_name}__gte': today})
class DateInNearPastViewFilterType(ViewFilterType):
"""
@ -292,8 +295,9 @@ class DateInNearPastViewFilterType(ViewFilterType):
today = datetime.utcnow()
lastDay = today - timedelta(days=value)
return Q(**{f'{field_name}__lte': today,f'{field_name}__gte': lastDay})
return Q(**{f'{field_name}__lte': today, f'{field_name}__gte': lastDay})
class DateEqualViewFilterType(ViewFilterType):
"""