Merged
Conversation
f150332 to
78183f6
Compare
1b8b92a to
4bf6d9e
Compare
kbeker
previously approved these changes
Feb 6, 2019
Contributor
kbeker
left a comment
There was a problem hiding this comment.
Please apply changes and for me OK
employees/serializers.py
Outdated
| ) | ||
|
|
||
| def to_representation(self, instance): | ||
| data = super(ReportSerializer, self).to_representation(instance) |
Contributor
There was a problem hiding this comment.
As far as I know in python3 you don't have to write super(Class, self). super() should be enough
Collaborator
Author
There was a problem hiding this comment.
I've seen it around the web. Thought that maybe it's some sort of good practise, like explicit parametrising in function calls.
employees/serializers.py
Outdated
| def to_representation(self, instance): | ||
| data = super(ReportSerializer, self).to_representation(instance) | ||
| # SELF NOTE: For some reason, tests for list get methods got a Queryset as instance in serializer and I dunno why... | ||
| if type(self.instance) is Report: |
Contributor
There was a problem hiding this comment.
change it to
if isinstance(self.instance, Report):
employees/serializers.py
Outdated
|
|
||
| def to_representation(self, instance): | ||
| data = super(ReportSerializer, self).to_representation(instance) | ||
| # SELF NOTE: For some reason, tests for list get methods got a Queryset as instance in serializer and I dunno why... |
Contributor
There was a problem hiding this comment.
Add it as a issue and in have to be investigate later. After adding issue please delete comment.
78183f6 to
9d0c9b3
Compare
802317d to
620bd5b
Compare
9d0c9b3 to
8db2993
Compare
942cd4b to
3386a7d
Compare
3386a7d to
78535dd
Compare
f6fa52a to
da2a61a
Compare
693846b to
1af60a5
Compare
da2a61a to
b6b32a5
Compare
kbeker
previously approved these changes
Mar 28, 2019
180bb5d to
409cb70
Compare
Adds method returning report's work hours value to string with propper formatting. The method has @Property tag included for easier access through HTML templates. The method is thus treated as a read-only field rather than a function.
Replaced `work_hours` with `work_hours_str` for accurate time display format.
Adds custom field derived from `DecimalField` with overriden `to_internal_value` method. If field input contains *:* symbol, it will be converted to a *.* symbol before being processed through validation.
Overrides `to_representation` method in serializer in a way, that allows displaying work hours value in proper format.
Supply custom messages to display hour in proper format in validation error messages.
409cb70 to
1aa1e00
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Resolves #46
Related #106