-
Notifications
You must be signed in to change notification settings - Fork 3
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
Resolve duplicate memberships, superiors/subordinates, and areas of operation #775
Changes from 4 commits
044bfaf
4e10855
eb3aeec
d34691d
4a37057
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,3 +76,16 @@ def get_spreadsheet_source_field_name(cls, field_name): | |
# If no source field name is specified, the default is usually | ||
# the spreadsheet field name with ":source" appended on | ||
return cls.get_spreadsheet_field_name(field_name) + ':source' | ||
|
||
|
||
class SuperlativeDateMixin: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
@property | ||
def first_startdate(self): | ||
return self.startdate.field_model.objects.filter(object_ref=self)\ | ||
.order_by('value').first() | ||
|
||
@property | ||
def last_enddate(self): | ||
return self.enddate.field_model.objects.filter(object_ref=self)\ | ||
.order_by('-value').first() |
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.
if role_name can have whitespace in it, seems safest to do the strip before evaluating the truthyness of role_name.
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.
Great call, @fgregg, done for both role and rank in 4a37057.