Add basic "mobile index" master view, plus support for demo mode

This commit is contained in:
Lance Edgar 2017-03-19 11:21:00 -05:00
parent 9808bb3a91
commit 581a21bd9d
16 changed files with 301 additions and 16 deletions

View file

@ -111,6 +111,16 @@ class EmployeesView(MasterView):
q = q.filter(model.Employee.status == self.enum.EMPLOYEE_STATUS_CURRENT)
return q
def editable_instance(self, employee):
if self.rattail_config.demo():
return not bool(employee.user and employee.username == 'chuck')
return True
def deletable_instance(self, employee):
if self.rattail_config.demo():
return not bool(employee.user and employee.username == 'chuck')
return True
def _preconfigure_fieldset(self, fs):
fs.append(forms.AssociationProxyField('first_name'))
fs.append(forms.AssociationProxyField('last_name'))