Add support for "full" schedule and time sheet views
Temporarily removes support for viewing current user's time sheet; that will be added back in soon.
This commit is contained in:
parent
181123dfaa
commit
123f5ce0c6
11 changed files with 327 additions and 165 deletions
|
@ -48,7 +48,18 @@ class ModelValidator(fe.validators.FancyValidator):
|
|||
obj = Session.query(self.model_class).get(value)
|
||||
if obj:
|
||||
return obj
|
||||
raise formencode.Invalid("{} not found".format(self.model_name), value, state)
|
||||
raise fe.Invalid("{} not found".format(self.model_name), value, state)
|
||||
|
||||
def _from_python(self, value, state):
|
||||
obj = value
|
||||
if not obj:
|
||||
return ''
|
||||
return obj.uuid
|
||||
|
||||
def validate_python(self, value, state):
|
||||
obj = value
|
||||
if obj is not None and not isinstance(obj, self.model_class):
|
||||
raise fe.Invalid("Value must be a valid {} object".format(self.model_name), value, state)
|
||||
|
||||
|
||||
class ValidStore(ModelValidator):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue