Changeset 2667 in products for quintagroup.gdocs.spreadsheet/trunk/quintagroup/gdocs/spreadsheet/content/gspreadsheet.py
- Timestamp:
- Jul 13, 2010 3:47:05 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.gdocs.spreadsheet/trunk/quintagroup/gdocs/spreadsheet/content/gspreadsheet.py
r2661 r2667 7 7 from Products.ATContentTypes.content import base 8 8 from Products.ATContentTypes.content import schemata 9 10 from Products.DataGridField import DataGridField, DataGridWidget 11 from Products.DataGridField.SelectColumn import SelectColumn 9 12 10 13 from quintagroup.gdocs.spreadsheet import spreadsheetMessageFactory as _ … … 48 51 ), 49 52 53 DataGridField( 54 name='title_column', 55 searchable = True, 56 languageIndependent=True, 57 storage=atapi.AnnotationStorage(), 58 columns=("select_title",), 59 widget = DataGridWidget( 60 label = _( 61 u'label_title_column', 62 default=u'Titles of columns'), 63 description=_( 64 u'help_title_column', 65 default=u"Choose titles of columns"), 66 columns={ 67 'select_title' : SelectColumn("Titles of columns", vocabulary="getTitleColumnVocabulary"), 68 }, 69 ), 70 ), 71 50 72 # -*- Your Archetypes field definitions here ... -*- 51 73 … … 61 83 62 84 class GSpreadsheet(base.ATCTContent): 63 """ Lets you select google spreadsheet and worksheet id"""85 """ Lets you select google spreadsheet worksheet id and choose title of columns """ 64 86 implements(IGSpreadsheet) 65 87 … … 67 89 schema = GSpreadsheetSchema 68 90 91 order_columns = [] 69 92 title = atapi.ATFieldProperty('title') 70 93 description = atapi.ATFieldProperty('description') 71 94 spreadsheet_id = atapi.ATFieldProperty('spreadsheet_id') 72 95 worksheet_id = atapi.ATFieldProperty('worksheet_id') 96 title_column = atapi.ATFieldProperty('title_column') 73 97 74 98 # -*- Your ATSchema to Python Property Bridges Here ... -*- 75 99 100 def getTitleColumnVocabulary(self): 101 """ Get a list of titles of columns """ 102 return atapi.DisplayList( 103 ([('%s'%i, t) for i,t in enumerate(self.order_columns)]) 104 ) 105 76 106 atapi.registerType(GSpreadsheet, PROJECTNAME)
Note: See TracChangeset
for help on using the changeset viewer.