Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Like/dislike feature#115

Open
killpanda wants to merge 6 commits intopython-cn:master from
killpanda:like-feature
Open

Like/dislike feature #115
killpanda wants to merge 6 commits intopython-cn:master from
killpanda:like-feature

Conversation

@killpanda
Copy link
Contributor

@killpanda killpanda commented Sep 14, 2015

  • Add a pluggable Likes model
  • Add ajax api for this feature
  • Add some test

Copy link
Contributor Author

This PR is done.

@killpanda killpanda changed the title (削除) WIP: basic pluggable like model (削除ここまで) (追記) Like/Unlike feature (追記ここまで) Sep 15, 2015
@killpanda killpanda changed the title (削除) Like/Unlike feature (削除ここまで) (追記) Like/dislike feature (追記ここまで) Sep 15, 2015
Copy link
Member

@mozillazg mozillazg Sep 15, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里等价于 return str(self._instance) 应该不是你预期的结果吧?

Copy link
Contributor Author

@killpanda killpanda Sep 15, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mozillazg 不是呀 这里是要通过 productidgetter 来拿到 product_id

Copy link
Contributor

@dongweiming dongweiming Sep 15, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@killpanda 其实我也没看懂. 在productidgetter 里面 直接返回了参数 不就是 @mozillazg 说的意思么

其次 productidgetter这个方法名字 不是应该用下划线分词的么 比如 product_id_getter

Copy link
Contributor

@killpanda 辛苦

Copy link
Contributor

@dongweiming dongweiming Sep 15, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete 应该也是204

Copy link
Contributor Author

大家看看现在怎么样?

Copy link
Member

@killpanda 现在清楚了不少。有一点,likes这个类,我觉得除了add delete方法要操作数据库,是不是还可以在内部维护一个list/set便于直接取用户

Copy link
Contributor Author

@halfcrazy 可以举个例子来说说用法吗?

Copy link
Member

@killpanda 知乎问题右边的,xxx,xxx关注了本问题

Copy link
Contributor Author

@halfcrazy 加了个 __getitem__,其它功能随用随加吧 XD

Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Comments

AltStyle によって変換されたページ (->オリジナル) /