Beispiel #1
0
	def follow(self):
		db.following.save(vars(self))

		# Notification for the Followee
		notification = Notification(uid=self.followee)
		notification.make_follow(follower_id=self.follower)
		notification.save()
		
		return self
Beispiel #2
0
def add_like_to_sheet(sheet_id, uid):
	"""
	Add uid as a liker of sheet_id.
	"""
	db.sheets.update({"id": sheet_id}, {"$addToSet": {"likes": uid}})
	sheet = get_sheet(sheet_id)

	notification = Notification(uid=sheet["owner"])
	notification.make_sheet_like(liker_id=uid, sheet_id=sheet_id)
	notification.save()