Add basic str() method for WorkedShift model
This commit is contained in:
parent
c182ee80e2
commit
de61364c8e
|
@ -2,7 +2,7 @@
|
|||
################################################################################
|
||||
#
|
||||
# Rattail -- Retail Software Framework
|
||||
# Copyright © 2010-2016 Lance Edgar
|
||||
# Copyright © 2010-2017 Lance Edgar
|
||||
#
|
||||
# This file is part of Rattail.
|
||||
#
|
||||
|
@ -26,6 +26,8 @@ Data models for employee work shifts
|
|||
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
|
||||
import six
|
||||
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy import orm
|
||||
|
||||
|
@ -111,6 +113,7 @@ class ScheduledShift(Base, ShiftMixin):
|
|||
""")
|
||||
|
||||
|
||||
@six.python_2_unicode_compatible
|
||||
class WorkedShift(Base, ShiftMixin):
|
||||
"""
|
||||
Represents a shift actually *worked* by an employee. (Either ``punch_in``
|
||||
|
@ -159,3 +162,6 @@ class WorkedShift(Base, ShiftMixin):
|
|||
# 'punch' columns at some point..?
|
||||
start_time = orm.synonym('punch_in')
|
||||
end_time = orm.synonym('punch_out')
|
||||
|
||||
def __str__(self):
|
||||
return unicode(self.employee or '')
|
||||
|
|
Loading…
Reference in a new issue