-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add tracking logs #1
base: open-release/maple.master
Are you sure you want to change the base?
Conversation
b5e3d4d
to
c450d9f
Compare
329502f
to
d0f60e3
Compare
d0f60e3
to
ead8f61
Compare
return obj, is_new | ||
|
||
@staticmethod |
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.
The idea of this static method is to reuse the function class in whatever place?
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.
The method doesn't need the self(instance) or cls(class reference) therefore by definition it's a static method, so when I implemented that I didn't intend to create a function to be used in multiple places it's just a static method that could be used in other context
completion_aggregator/models.py
Outdated
updated_aggregators: List of Aggregator intances | ||
|
||
""" | ||
for obj in updated_aggregators: |
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.
Why you change to obj
if in other places is agregator
.
for aggregator in updated_aggregators: |
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.
I understand your concern and IMO it's much better aggregator
however your argument is not valid since in other places is obj
obj, is_new = self.update_or_create( |
aggregation_data = [obj.get_values() for obj in updated_aggregators] |
completion_aggregator/models.py
Outdated
"created": obj.created, | ||
"earned": obj.earned, | ||
"possible": obj.possible, | ||
"percent": obj.percent, |
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 doesnt need anything change.
I mean this serializer is ok?
percent = models.FloatField(validators=[validate_percent]) |
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.
Beetween [0,1]?
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.
That method just validates the kind of event (progress or completion) the data that is sent must be as accurate as possible
@@ -13,18 +13,18 @@ def plugin_settings(settings): | |||
# This setting controls which type of event will be published to change the default behavior | |||
# the block type should be removed or added from the progress or completion list. | |||
settings.ALLOWED_COMPLETION_AGGREGATOR_EVENT_TYPES = { | |||
"progress": [ | |||
"progress": { |
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.
Why do you change from list to set ?
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.
Description:
This pr adds the capability of publishing aggregator events
Testing instructions:
Reviewers:
Merge checklist:
Post merge:
finished.
Author concerns: List any concerns about this PR - inelegant
solutions, hacks, quick-and-dirty implementations, concerns about
migrations, etc.