Sektionen
Benutzerspezifische Werkzeuge
Sie sind hier: Startseite Support Dokumentation docs DataGridField

DataGridField

Methoden eines DataGridFields, Schema-Beispiel, ...

Beispiel

 


# Plone imports
from Products.Archetypes.public import DisplayList
from Products.Archetypes.public import *

# Local imports

from Products.DataGridField import DataGridField, DataGridWidget
from Products.DataGridField.Column import Column
from Products.DataGridField.SelectColumn import SelectColumn

class DataGridDemoType(BaseContent):

"""A simple archetype"""

schema = BaseSchema + Schema( (
DataGridField('DemoField',
searchable = True,
columns=("column1", "column2", "select_sample"),
widget = DataGridWidget(
columns={
'column1' : Column("Toholampi city rox"),

'column2' : Column("My friendly name"),

'select_sample' : SelectColumn(

"Friendly name",

vocabulary="getSampleVocabulary")
},
),
),

) )

def getSampleVocabulary(self):
""" Get list of possible taggable features from ATVocabularyManager """
return DisplayList(

( ("sample", "Sample value 1",),
("sample2", "Sample value 2",),) )

(Quelle: http://plone.org/products/datagridfield/)