source: products/quintagroup.gdocs.spreadsheet/trunk/quintagroup/gdocs/spreadsheet/content/gspreadsheet.py @ 2646

Last change on this file since 2646 was 2646, checked in by liebster, 14 years ago

Add contenttype using paster

File size: 1.3 KB
Line 
1"""Definition of the GSpreadsheet content type
2"""
3
4from zope.interface import implements, directlyProvides
5
6from Products.Archetypes import atapi
7from Products.ATContentTypes.content import base
8from Products.ATContentTypes.content import schemata
9
10from quintagroup.gdocs.spreadsheet import spreadsheetMessageFactory as _
11from quintagroup.gdocs.spreadsheet.interfaces import IGSpreadsheet
12from quintagroup.gdocs.spreadsheet.config import PROJECTNAME
13
14GSpreadsheetSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((
15
16    # -*- Your Archetypes field definitions here ... -*-
17
18))
19
20# Set storage on fields copied from ATContentTypeSchema, making sure
21# they work well with the python bridge properties.
22
23GSpreadsheetSchema['title'].storage = atapi.AnnotationStorage()
24GSpreadsheetSchema['description'].storage = atapi.AnnotationStorage()
25
26schemata.finalizeATCTSchema(GSpreadsheetSchema, moveDiscussion=False)
27
28class GSpreadsheet(base.ATCTContent):
29    """Lets you select google spreadsheet and worksheet id"""
30    implements(IGSpreadsheet)
31
32    meta_type = "GSpreadsheet"
33    schema = GSpreadsheetSchema
34
35    title = atapi.ATFieldProperty('title')
36    description = atapi.ATFieldProperty('description')
37
38    # -*- Your ATSchema to Python Property Bridges Here ... -*-
39
40atapi.registerType(GSpreadsheet, PROJECTNAME)
Note: See TracBrowser for help on using the repository browser.