Show More
@@ -345,7 +345,6 b' class PullRequestModel(BaseModel):' | |||||
345 | if only_created: |
|
345 | if only_created: | |
346 | q = q.filter(PullRequest.pull_request_state == PullRequest.STATE_CREATED) |
|
346 | q = q.filter(PullRequest.pull_request_state == PullRequest.STATE_CREATED) | |
347 |
|
347 | |||
348 | if order_by: |
|
|||
349 |
|
|
348 | order_map = { | |
350 |
|
|
349 | 'name_raw': PullRequest.pull_request_id, | |
351 |
|
|
350 | 'id': PullRequest.pull_request_id, | |
@@ -353,6 +352,7 b' class PullRequestModel(BaseModel):' | |||||
353 |
|
|
352 | 'updated_on_raw': PullRequest.updated_on, | |
354 |
|
|
353 | 'target_repo': PullRequest.target_repo_id | |
355 |
|
|
354 | } | |
|
355 | if order_by and order_by in order_map: | |||
356 | if order_dir == 'asc': |
|
356 | if order_dir == 'asc': | |
357 | q = q.order_by(order_map[order_by].asc()) |
|
357 | q = q.order_by(order_map[order_by].asc()) | |
358 | else: |
|
358 | else: | |
@@ -499,13 +499,13 b' class PullRequestModel(BaseModel):' | |||||
499 | pull_request_alias.description.ilike(like_expression), |
|
499 | pull_request_alias.description.ilike(like_expression), | |
500 | )) |
|
500 | )) | |
501 |
|
501 | |||
502 | if order_by: |
|
|||
503 |
|
|
502 | order_map = { | |
504 |
|
|
503 | 'name_raw': pull_request_alias.pull_request_id, | |
505 |
|
|
504 | 'title': pull_request_alias.title, | |
506 |
|
|
505 | 'updated_on_raw': pull_request_alias.updated_on, | |
507 |
|
|
506 | 'target_repo': pull_request_alias.target_repo_id | |
508 |
|
|
507 | } | |
|
508 | if order_by and order_by in order_map: | |||
509 | if order_dir == 'asc': |
|
509 | if order_dir == 'asc': | |
510 | q = q.order_by(order_map[order_by].asc()) |
|
510 | q = q.order_by(order_map[order_by].asc()) | |
511 | else: |
|
511 | else: | |
@@ -585,13 +585,14 b' class PullRequestModel(BaseModel):' | |||||
585 | PullRequest.title.ilike(like_expression), |
|
585 | PullRequest.title.ilike(like_expression), | |
586 | PullRequest.description.ilike(like_expression), |
|
586 | PullRequest.description.ilike(like_expression), | |
587 | )) |
|
587 | )) | |
588 | if order_by: |
|
588 | ||
589 |
|
|
589 | order_map = { | |
590 |
|
|
590 | 'name_raw': PullRequest.pull_request_id, | |
591 |
|
|
591 | 'title': PullRequest.title, | |
592 |
|
|
592 | 'updated_on_raw': PullRequest.updated_on, | |
593 |
|
|
593 | 'target_repo': PullRequest.target_repo_id | |
594 |
|
|
594 | } | |
|
595 | if order_by and order_by in order_map: | |||
595 | if order_dir == 'asc': |
|
596 | if order_dir == 'asc': | |
596 | q = q.order_by(order_map[order_by].asc()) |
|
597 | q = q.order_by(order_map[order_by].asc()) | |
597 | else: |
|
598 | else: | |
@@ -665,13 +666,13 b' class PullRequestModel(BaseModel):' | |||||
665 | pull_request_alias.description.ilike(like_expression), |
|
666 | pull_request_alias.description.ilike(like_expression), | |
666 | )) |
|
667 | )) | |
667 |
|
668 | |||
668 | if order_by: |
|
|||
669 |
|
|
669 | order_map = { | |
670 |
|
|
670 | 'name_raw': pull_request_alias.pull_request_id, | |
671 |
|
|
671 | 'title': pull_request_alias.title, | |
672 |
|
|
672 | 'updated_on_raw': pull_request_alias.updated_on, | |
673 |
|
|
673 | 'target_repo': pull_request_alias.target_repo_id | |
674 |
|
|
674 | } | |
|
675 | if order_by and order_by in order_map: | |||
675 | if order_dir == 'asc': |
|
676 | if order_dir == 'asc': | |
676 | q = q.order_by(order_map[order_by].asc()) |
|
677 | q = q.order_by(order_map[order_by].asc()) | |
677 | else: |
|
678 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now