Merge branch 'bbmaster' of ssh://git.cy55.de/home/git/loops into bbmaster

This commit is contained in:
hplattner 2012-03-19 10:13:27 +01:00
commit aa8bc152ba
4 changed files with 21 additions and 17 deletions

View file

@ -541,6 +541,8 @@ class BaseView(GenericView, I18NView):
@Lazy
def typeOptions(self):
if self.typeProvider is None:
return DummyOptions()
return IOptions(adapted(self.typeProvider))
def getPredicateOptions(self, relation):

View file

@ -1,5 +1,5 @@
#
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
# Copyright (c) 2012 Helmut Merz helmutm@cy55.de
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -207,7 +207,9 @@ class ResourceView(BaseView):
data = context.data
if useAttachment:
filename = adapted(self.context).localFilename or getName(self.context)
if not self.typeOptions('no_normalize_download_filename'):
if self.typeOptions('no_normalize_download_filename'):
filename = '"%s"' % filename
else:
filename = NameChooser(getParent(self.context)).normalizeName(filename)
response.setHeader('Content-Disposition',
'attachment; filename=%s' % filename)

View file

@ -93,7 +93,7 @@ class VocabularyField(Field):
return value
items = self.getVocabularyItems(row)
for item in items:
if item['token'] == value:
if str(item['token']) == str(value):
return item['title']
def getVocabularyItems(self, row):
@ -197,4 +197,4 @@ class SubReportField(Field):
def getValue(self, row):
ri = self.getReportInstance(row)
return ResultSet(ri, ri.getResults())
return ri.getResults()

View file

@ -130,18 +130,6 @@ state = Field('state', u'State',
description=u'The state of the work.',
executionSteps=['query', 'output'])
# task/event report fields
taskTitle = UrlField('title', u'Title',
description=u'The short description of the task.',
executionSteps=['output'])
taskDescription = TextField('description', u'Description',
description=u'The long description of the task.',
executionSteps=['output'])
workItems = SubReportField('workItems', u'Work Items',
description=u'A list of work items belonging to the task.',
executionSteps=['output'])
# basic definitions and work report instance
@ -249,6 +237,18 @@ class WorkReportInstance(ReportInstance):
# meeting minutes
taskTitle = UrlField('title', u'Title',
description=u'The short description of the task.',
executionSteps=['output'])
taskDescription = TextField('description', u'Description',
description=u'The long description of the task.',
executionSteps=['output'])
workItems = SubReportField('workItems', u'Work Items',
description=u'A list of work items belonging to the task.',
reportFactory=WorkReportInstance,
executionSteps=['output'])
class TaskRow(BaseRow):
pass