add ID field to post dto
This commit is contained in:
@@ -68,6 +68,7 @@ class RedditConnector(BaseConnector):
|
|||||||
for item in data['data']['children']:
|
for item in data['data']['children']:
|
||||||
post_data = item['data']
|
post_data = item['data']
|
||||||
post = Post(
|
post = Post(
|
||||||
|
id=post_data['id'],
|
||||||
author=post_data['author'],
|
author=post_data['author'],
|
||||||
title=post_data['title'],
|
title=post_data['title'],
|
||||||
content=post_data.get('selftext', ''),
|
content=post_data.get('selftext', ''),
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
class Post:
|
class Post:
|
||||||
def __init__(self, author: str,
|
def __init__(self,
|
||||||
|
id: str,
|
||||||
|
author: str,
|
||||||
title: str,
|
title: str,
|
||||||
content: str,
|
content: str,
|
||||||
url: str,
|
url: str,
|
||||||
timestamp: float,
|
timestamp: float,
|
||||||
source: str):
|
source: str):
|
||||||
|
self.id = id
|
||||||
self.author = author
|
self.author = author
|
||||||
self.title = title
|
self.title = title
|
||||||
self.content = content
|
self.content = content
|
||||||
|
|||||||
Reference in New Issue
Block a user