Skip to content
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

Get Post #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Get Post #4

wants to merge 3 commits into from

Conversation

BigBorg
Copy link
Contributor

@BigBorg BigBorg commented Apr 22, 2017

获取专栏文章

Copy link
Owner

@lzjun567 lzjun567 left a comment

Choose a reason for hiding this comment

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

不错,不过提几个建议

  1. 专栏文章我们可以把它抽象成一个 叫 Article 的类出现(叫Post 看起来容易混淆)
  2. 把一些我们常见的字段写到 Article 类中作为它的属性。
  3. 写完之后补充一下相应的TestCase

@BigBorg
Copy link
Contributor Author

BigBorg commented Apr 24, 2017

@lzjun567 Article类,获取文章,测试

@lzjun567
Copy link
Owner

对于 Article 类,其实我更倾向于用一种更加OO的方式来写,例如:

class Article(Model):
     def __init__(self, id):
           self.id=x
           self.title=x
           self.content=x
           .....

就是它的属性在 init方法中先初始化。

另外,对于request方法,其实我也还没想好该怎么弄,是初始化的时候就去请求知乎就把数据初始化,还是等调用 request 方法的再把属性填充到Arctile中。

另外,request这个名字也值得商榷。

@zhaoqingqing
Copy link

这个获取专栏文章的修改还没有合并到master中

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants