Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thingsplode committed Mar 16, 2020
1 parent bc48b05 commit 1be8707
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions appkernel/model.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from typing import Callable,
from typing import Callable
import collections
import inspect
from datetime import datetime, date
from enum import Enum
from typing import Callable

from bson import ObjectId
from flask_babel import lazy_gettext
Expand Down
10 changes: 5 additions & 5 deletions appkernel/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ class QueryProcessor(object):
def __init__(self):
# self.query_pattern = re.compile('^(\w+:[\[\],\<\>A-Za-z0-9_\s-]+)(,\w+:[\[\],\<\>A-Za-z0-9_\s-]+)*$')
self.csv_pattern = re.compile('^.*,.*$')
self.json_pattern = re.compile('\{.*\:\{.*\:.*\}\}')
self.json_pattern = re.compile('\\{.*\\:\\{.*\\:.*\\}\\}')
self.date_patterns = {
re.compile('^(0?[1-9]|[12][0-9]|3[01])(\/|-|\.)(0?[1-9]|1[012])(\/|-|\.)\d{4}$'): '%d{0}%m{0}%Y',
re.compile('^(0?[1-9]|[12][0-9]|3[01])(\\/|-|\\.)(0?[1-9]|1[012])(\\/|-|\\.)\\d{4}$'): '%d{0}%m{0}%Y',
# 31/02/4500
re.compile('^\d{4}(\/|-|\.)(0?[1-9]|1[012])(\/|-|\.)(0?[1-9]|[12][0-9]|3[01])$'): '%Y{0}%m{0}%d'
re.compile('^\\d{4}(\\/|-|\\.)(0?[1-9]|1[012])(\\/|-|\\.)(0?[1-9]|[12][0-9]|3[01])$'): '%Y{0}%m{0}%d'
# 4500/02/31,
}
self.number_pattern = re.compile('^[-+]?[0-9]+$')
self.boolean_pattern = re.compile('^(true|false|True|False|y|yes|no)$')
self.date_separator_patterns = {
re.compile('([0-9].*-)+.*'): '-',
re.compile('([0-9].*\/)+.*'): '/',
re.compile('([0-9].*\.)+.*'): '.',
re.compile('([0-9].*\\/)+.*'): '/',
re.compile('([0-9].*\\.)+.*'): '.',
}
self.expression_mapper = {
'<': lambda exp: ('$lte', exp),
Expand Down
2 changes: 1 addition & 1 deletion appkernel/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Email(Regexp):

def __init__(self):
super(Email, self).__init__(
'(?:[a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])')
r'(?:[a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])')


class Min(Validator):
Expand Down

0 comments on commit 1be8707

Please sign in to comment.