Skip to content

Commit

Permalink
oneline fix
Browse files Browse the repository at this point in the history
  • Loading branch information
guoshijiang committed Mar 25, 2024
1 parent e1bfd99 commit ddb7084
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion website/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,15 @@ def __str__(self):

def as_dict(self):
tz = pytz.timezone(settings.TIME_ZONE)
tags_list = self.tags.split(",")
return {
'id': self.id,
'title': self.title,
'cat_name': self.cat.name,
'image': settings.IMG_URL + str(self.image),
'describe': self.describe,
'link_url': self.link_url,
'tags': self.tags,
'tags': tags_list,
'created_at': self.created_at.astimezone(tz).strftime("%Y-%m-%d %H:%M:%S")
}

Expand Down

0 comments on commit ddb7084

Please sign in to comment.