Example #1
0
 def addSchema(self, id, title='', defaults=None):
     """ add a new property schema """
     ob = Schema(id, title)
     self._setObject(id, ob)
     ob = self._getOb(id)
     if defaults is not None:
         ob.populateSchema(defaults)
Example #2
0
 def afterSetUp(self):
     schema = Schema(id="my_schema", title="my_schema")
     self.schema = schema
     # patch the schema instance so we can add widgets
     schema.gl_get_selected_language = lambda: "en"
     schema.gl_add_languages = lambda a: None
     schema.addWidget("my_str", widget_type="String")
     schema.addWidget("my_local_str", widget_type="String", localized=True)
     schema._getOb("my_str-property").required = True
     schema.addWidget("my_date", widget_type="Date", data_type="date")
Example #3
0
 def afterSetUp(self):
     schema = Schema(id='my_schema', title='my_schema')
     self.schema = schema
     # patch the schema instance so we can add widgets
     schema.gl_get_selected_language = lambda: 'en'
     schema.gl_add_languages = lambda a: None
     schema.addWidget('my_str', widget_type='String')
     schema.addWidget('my_local_str', widget_type='String', localized=True)
     schema._getOb('my_str-property').required = True
     schema.addWidget('my_date', widget_type='Date', data_type='date')
Example #4
0
def _create_test_schema():
    schema = Schema(id='my_schema', title='my_schema')
    # patch the schema instance so we can add widgets
    schema.gl_get_selected_language = lambda: 'en'
    schema.gl_add_languages = lambda a: None
    schema.addWidget('title', widget_type='String', localized=True)
    schema.addWidget('my_str', widget_type='String')
    schema.addWidget('my_local_str', widget_type='String', localized=True)
    schema.addWidget('my_int', widget_type='String', data_type='int')
    return schema
Example #5
0
 def afterSetUp(self):
     schema = Schema(id='interval_schema', title='Interval Schema')
     self.schema = schema.__of__(self.portal.portal_schemas)
     addIntervalWidget(self.schema,
                       'theint-property',
                       title='Interval Wid.')
 def afterSetUp(self):
     schema = Schema(id='interval_schema', title='Interval Schema')
     self.schema = schema.__of__(self.portal.portal_schemas)
     addIntervalWidget(self.schema, 'theint-property', title='Interval Wid.')
Example #7
0
def _create_test_schema():
    schema = Schema(id='my_schema', title='my_schema')
    # patch the schema instance so we can add widgets
    schema.gl_get_selected_language = lambda: 'en'
    schema.gl_add_languages = lambda a: None
    schema.addWidget('title', widget_type='String', localized=True)
    schema.addWidget('my_str', widget_type='String')
    schema.addWidget('my_local_str', widget_type='String', localized=True)
    schema.addWidget('my_int', widget_type='String', data_type='int')
    return schema
Example #8
0
 def afterSetUp(self):
     schema = Schema(id='my_schema', title='my_schema')
     self.schema = schema
     # patch the schema instance so we can add widgets
     schema.gl_get_selected_language = lambda: 'en'
     schema.gl_add_languages = lambda a: None
     schema.addWidget('my_str', widget_type='String')
     schema.addWidget('my_local_str', widget_type='String', localized=True)
     schema._getOb('my_str-property').required = True
     schema.addWidget('my_date', widget_type='Date', data_type='date')
Example #9
0
 def afterSetUp(self):
     schema = Schema(id='geo_schema', title='Geo Schema')
     self.schema = schema.__of__(self.portal.portal_schemas)
     addGeoWidget(self.schema, 'thegeo-property', title='Geo Location')
Example #10
0
 def afterSetUp(self):
     schema = Schema(id='geo_schema', title='Geo Schema')
     self.schema = schema.__of__(self.portal.portal_schemas)
     addGeoWidget(self.schema, 'thegeo-property', title='Geo Location')