[gen] Bugfixes; for Ref field, replaced render mode 'titles' with 'minimal', allowing to display all fields defined in shownInfo.

This commit is contained in:
Gaetan Delannay 2014-05-19 12:12:33 +02:00
parent 57bab29447
commit b3a72ade24
4 changed files with 17 additions and 18 deletions

View file

@ -419,7 +419,7 @@ class ToolMixin(BaseMixin):
def quote(self, s):
'''Returns the quoted version of p_s.'''
if not isinstance(s, basestring): s = str(s)
s = s.replace('\r\n', '').replace('\n', '').replace("'", "\\'")
s = s.replace('\r\n', '').replace('\n', '').replace("'", "'")
return "'%s'" % s
def getLayoutType(self):
@ -962,7 +962,7 @@ class ToolMixin(BaseMixin):
# c. Identify the user from the authentication form.
if not login:
login = req.get('__ac_name', None)
password = req.get('__ac_password', None)
password = req.get('__ac_password', '')
# Stop identification here if we don't need to return a special user
if not alsoSpecial: return login, password
# d. All the identification methods failed. So identify the user as

View file

@ -324,12 +324,6 @@ class BaseMixin:
self.say(self.translate('action_done'))
self.goto(urlBack)
def onCreateWithoutForm(self):
'''This method is called when a user wants to create a object from a
reference field, automatically (without displaying a form).'''
rq = self.REQUEST
self.appy().create(rq['fieldName'])
def intraFieldValidation(self, errors, values):
'''This method performs field-specific validation for every field from
the page that is being created or edited. For every field whose

View file

@ -74,7 +74,7 @@ class UserWrapper(AbstractWrapper):
'''Sets a p_newPassword for self. If p_newPassword is not given, we
generate one. This method returns the generated password (or simply
p_newPassword if no generation occurred).'''
if newPassword:
if newPassword != None:
msgPart = 'changed'
else:
newPassword = self.getField('password1').generatePassword()