Don't manually construct JSON as strings, just use dicts. The modernity!
This commit is contained in:
parent
ddc52b969e
commit
45a44d08eb
@ -40,10 +40,10 @@ def posts_view(project_id=None, project_url=None, url=None):
|
||||
'where': {'node_type': 'blog', 'project': project_id},
|
||||
}, api=api)
|
||||
|
||||
status_query = "" if blog.has_method('PUT') else ', "properties.status": "published"'
|
||||
status_query = {} if blog.has_method('PUT') else {'properties.status': 'published'}
|
||||
posts = Node.all({
|
||||
'where': '{"parent": "%s" %s}' % (blog._id, status_query),
|
||||
'embedded': '{"user": 1}',
|
||||
'where': {'parent': blog._id, **status_query},
|
||||
'embedded': {'user': 1},
|
||||
'sort': '-_created'
|
||||
}, api=api)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user