Design question?
- by Mohamed
I am building music app, where user can do several tasks including but not limited to listening song, like song, recommend song to a friend and extra.
currently I have this model:
class Activity(models.Model):
activity = models.TextField()
user = models.ForeignKey(User)
date = models.DateTimeField(auto_now=True)
so far I thought about two solutions.
1. saving a string to database. e.g "you listened song xyz"
2. create a dictionary about the activity and save to the database using pickle or json. e.g.
dict_ = {"activity_type":"listening", "song":song_obj}
I am leaning to the second implementation, but not quite sure.
so what do you think about those two methods? do you know better way to achieve the goal?