-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
組織名が特定可能な場合にテンプレートで取得できるようにする #163
Conversation
@@ -48,6 +48,24 @@ def search(): | |||
id, keyword, approval, admin_owner_orgs, org_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: GETのクエリに含まれる id
は Resource.id
又は Package.id
である事が想定されている。
query = query.filter(or_(Resource.id == id, Package.id == id)) |
# set it as a global variable accessible from templates. | ||
if id and not org_name: | ||
resource = registration_service.get_resource(id) | ||
package: model.Package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
型定義のためかもしれませんが、代入もせずにぽつんと変数名だけがあるのはなかなか違和感のある記述ですね。
どこか参考にしたコードなどありますでしょうか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
参考にしたコードはありません。
コードの文脈を意識して読みやすくするための記述のつもりでしたが、違和感をご指摘いただいたので削除いたします。
以下のテンプレート内で
{% c.pkg_dict['organization']['name'] %}
にて組織名を取得できるように修正。※ 組織名取得元DBカラム:ckan.model.group.name