Add basic str() method for WorkedShift model
This commit is contained in:
parent
c182ee80e2
commit
de61364c8e
2 changed files with 8 additions and 1 deletions
|
@ -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 '')
|
||||
|
|
1
setup.py
1
setup.py
|
@ -66,6 +66,7 @@ requires = [
|
|||
'humanize', # 0.5.1
|
||||
'lockfile', # 0.9.1
|
||||
'progressbar', # 2.3
|
||||
'six', # 1.10.0
|
||||
|
||||
# TODO: make FormEncode optional? only used for email validator
|
||||
# For now, let's restrict FormEncode to 1.2 since the 1.3 release
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue