1 | """Definition of the GSpreadsheet content type |
---|
2 | """ |
---|
3 | |
---|
4 | from zope.interface import implements, directlyProvides |
---|
5 | |
---|
6 | from Products.Archetypes import atapi |
---|
7 | from Products.ATContentTypes.content import base |
---|
8 | from Products.ATContentTypes.content import schemata |
---|
9 | |
---|
10 | from quintagroup.gdocs.spreadsheet import spreadsheetMessageFactory as _ |
---|
11 | from quintagroup.gdocs.spreadsheet.interfaces import IGSpreadsheet |
---|
12 | from quintagroup.gdocs.spreadsheet.config import PROJECTNAME |
---|
13 | |
---|
14 | GSpreadsheetSchema = 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 | |
---|
23 | GSpreadsheetSchema['title'].storage = atapi.AnnotationStorage() |
---|
24 | GSpreadsheetSchema['description'].storage = atapi.AnnotationStorage() |
---|
25 | |
---|
26 | schemata.finalizeATCTSchema(GSpreadsheetSchema, moveDiscussion=False) |
---|
27 | |
---|
28 | class 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 | |
---|
40 | atapi.registerType(GSpreadsheet, PROJECTNAME) |
---|