0.7.44
dates in route search
This commit is contained in:
@@ -155,7 +155,11 @@ def get_routes_Dict(user=None, data=None):
|
||||
if key in (
|
||||
'departure_DT', 'arrival_DT'
|
||||
):
|
||||
kwargs.update({f'{key}__date': datetime.strptime(val, '%Y-%m-%d')})
|
||||
dates = val.split(' - ')
|
||||
kwargs.update({
|
||||
f'{key}__date__gte': datetime.strptime(dates[0], '%d.%m.%Y'),
|
||||
f'{key}__date__lte': datetime.strptime(dates[1], '%d.%m.%Y').replace(hour=23, minute=59, second=59)
|
||||
})
|
||||
|
||||
if key not in (
|
||||
'from_address_point_txt', 'to_address_point_txt', 'csrfmiddlewaretoken', 'sort', 'weight',
|
||||
@@ -185,7 +189,7 @@ def get_routes_Dict(user=None, data=None):
|
||||
if key == 'to_el':
|
||||
to_el = int(val)
|
||||
|
||||
routes = Route.objects.filter(**kwargs).order_by('-modifiedDT')
|
||||
routes = Route.objects.filter(**kwargs).order_by('departure_DT', 'arrival_DT', '-modifiedDT')
|
||||
routes_count = routes.count()
|
||||
|
||||
if from_el and to_el:
|
||||
|
||||
@@ -226,7 +226,7 @@ CKEDITOR_CONFIGS = {
|
||||
'height': 291,
|
||||
'width': '70vw',
|
||||
'filebrowserWindowHeight': 600,
|
||||
'filebrowserWindowWidth': "100%",
|
||||
'filebrowserWindowWidth': "90%",
|
||||
'toolbar': 'Custom',
|
||||
'forcePasteAsPlainText': True,
|
||||
'allowedContent': True,
|
||||
|
||||
Reference in New Issue
Block a user