appy.gen: bugfixes.

This commit is contained in:
Gaetan Delannay 2012-03-03 23:29:32 +01:00
parent 91d3887847
commit 431511026c
3 changed files with 15 additions and 7 deletions

View file

@ -136,8 +136,9 @@ class User(ModelClass):
# All methods defined below are fake. Real versions are in the wrapper. # All methods defined below are fake. Real versions are in the wrapper.
title = gen.String(show=False, indexed=True) title = gen.String(show=False, indexed=True)
gm = {'group': 'main', 'multiplicity': (1,1), 'width': 25} gm = {'group': 'main', 'multiplicity': (1,1), 'width': 25}
name = gen.String(**gm) def showName(self): pass
firstName = gen.String(**gm) name = gen.String(show=showName, **gm)
firstName = gen.String(show=showName, **gm)
def showLogin(self): pass def showLogin(self): pass
def validateLogin(self): pass def validateLogin(self): pass
login = gen.String(show=showLogin, validator=validateLogin, login = gen.String(show=showLogin, validator=validateLogin,

View file

@ -521,7 +521,7 @@ function updateRowNumber(row, rowIndex, action) {
var nSuffix = name.lastIndexOf('_'); var nSuffix = name.lastIndexOf('_');
var nameSuffix = ''; var nameSuffix = '';
if (nSuffix != -1) { if (nSuffix != -1) {
nameSuffix = id.substring(nSuffix); nameSuffix = name.substring(nSuffix);
name = name.substring(0, nSuffix); name = name.substring(0, nSuffix);
} }
// Compute the current row index if not already done. // Compute the current row index if not already done.

View file

@ -9,6 +9,10 @@ class UserWrapper(AbstractWrapper):
if self.o.isTemporary(): return 'edit' if self.o.isTemporary(): return 'edit'
return 'view' return 'view'
def showName(self):
'''Name and first name, by default, are always shown.'''
return True
def showEmail(self): def showEmail(self):
'''In most cases, email is the login. Show the field only if it is not '''In most cases, email is the login. Show the field only if it is not
the case.''' the case.'''
@ -178,8 +182,11 @@ class ZopeUserPatches:
if self._check_context(object): return 1 if self._check_context(object): return 1
return return
try:
from AccessControl.User import SimpleUser from AccessControl.User import SimpleUser
SimpleUser.getRoles = getRoles SimpleUser.getRoles = getRoles
SimpleUser.getRolesInContext = getRolesInContext SimpleUser.getRolesInContext = getRolesInContext
SimpleUser.allowed = allowed SimpleUser.allowed = allowed
except ImportError:
pass
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------