I would like to register user activity in my application for presentation to users, as well as for administrative purposes. My clients are companies, so there are three levels at which I can represent activities:
- Single user activity
- Activities of all users of the company
- All activities
To complete the logging, I would create a model for storing log entries. I see several ways to do this.
At first, I could store each registered activity in my own entity and then query as needed:
class Activity(ndb.Model):
activity = ndb.StringProperty()
user_id = ndb.StringProperty()
company_id = ndb.StringProperty()
Secondly, I could store all user activity in one object:
class UserActivity(ndb.Model):
activity = ndb.StringProperty(repeated=True)
company_id = ndb.StringProperty()
Thirdly, I could store all the activities of the company in one object:
class CompanyActivity(ndb.Model):
activity = ndb.StringProperty(repeated=True)
? , , , , .
( )? ?