Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class EndpointLog(Model, ModelLoggerMixing):
- id = UUIDField(auto=True, primary_key=True)
- when_created = DateTimeField(default=get_default_time, db_index=True)
- site_id = CharField(
- max_length=24,
- db_column='site',
- db_index=True,
- )
- session_id = UUIDField()
- values = JSONField()
- name = CharField(max_length=20)
- ended_with_success = BooleanField(default=False)
- # Co potrzebuję:
- # Filtrowanie po site_id (widok będzie pokazywał tylko 1 site na raz).
- # Groupowanie po name.
- # Wyliczenie ile w danym name było ended_with_success==True a ile ended_with_success==False.
- #chyba się udało:
- EndpointLog.objects.values('name', 'ended_with_success').annotate(Count('id'))
Advertisement
Add Comment
Please, Sign In to add comment