-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1188 remove x total #1290
1188 remove x total #1290
Conversation
97e6fb0
to
6f68cd1
Compare
@@ -132,42 +132,34 @@ def data(self, request, **kwargs): | |||
qs_kwargs.update({'id__gt': gt_id}) | |||
|
|||
instances = Instance.objects.filter(**qs_kwargs).order_by('pk') | |||
length = self.total_count = instances.count() | |||
self.total_count = instances.count() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be in-lined into the count
conditinoal on line 138 so we don't calculate it by default
|
||
if count: | ||
self.total_count = instances.count() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we even need to set a class variable here? Why not put instances.count()
inline as the value below?
onadata/libs/utils/common_tools.py
Outdated
""" | ||
Generator function to stream JSON data | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove blank line, other functions do not have a line between docstring and code
4dac099
to
54df22b
Compare
- Replace count query with xform.submission_count
…removing the need for queryset.count()
…a_viewset to use iter.next instead of length to place commas
6bef64f
to
a943f75
Compare
Part of #1188