B
Size: a a a
B
E
E
E
E
E
СК
view.py
в конце app.py
АА
@staticmethod
def get(title=object(), body=object(), slug=object(), is_active=object(), timestamp=object()) -> list:
posts = Post.query.all()
filter_posts = []
for post in posts:
if (type(title) is not object) and (post.title is not title):
continue
if (type(body) is not object) and (post.body is not body):
continue
if (type(slug) is not object) and (post.slug is not slug):
continue
if (type(is_active) is not object) and (post.is_active is not is_active):
continue
if (type(timestamp) is not object) and (post.timestamp is not timestamp):
continue
filter_posts.append(post)
return filter_posts
A
@staticmethod
def get(title=object(), body=object(), slug=object(), is_active=object(), timestamp=object()) -> list:
posts = Post.query.all()
filter_posts = []
for post in posts:
if (type(title) is not object) and (post.title is not title):
continue
if (type(body) is not object) and (post.body is not body):
continue
if (type(slug) is not object) and (post.slug is not slug):
continue
if (type(is_active) is not object) and (post.is_active is not is_active):
continue
if (type(timestamp) is not object) and (post.timestamp is not timestamp):
continue
filter_posts.append(post)
return filter_posts
A
if type(title) is not object
- WTFA
A
object()
?T
@staticmethod
def get(title=object(), body=object(), slug=object(), is_active=object(), timestamp=object()) -> list:
posts = Post.query.all()
filter_posts = []
for post in posts:
if (type(title) is not object) and (post.title is not title):
continue
if (type(body) is not object) and (post.body is not body):
continue
if (type(slug) is not object) and (post.slug is not slug):
continue
if (type(is_active) is not object) and (post.is_active is not is_active):
continue
if (type(timestamp) is not object) and (post.timestamp is not timestamp):
continue
filter_posts.append(post)
return filter_posts
A
T
object()
?A
T
A
DEFAULT
или UNDEFINED