Add basic "mobile index" master view, plus support for demo mode
This commit is contained in:
parent
9808bb3a91
commit
581a21bd9d
16 changed files with 301 additions and 16 deletions
|
@ -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'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue