Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(6)  |  Derive(0)  |  Import(2)

src/c/y/cyn.in-HEAD/src/ubify.coretypes/ubify/coretypes/utils.py   cyn.in(Download)
from archetypes.schemaextender.interfaces import ISchemaModifier
 
from archetypes.schemaextender.extender import set_schema_order
from archetypes.schemaextender.extender import get_schema_order
 

src/a/r/archetypes.schemaextender-2.1.3/archetypes/schemaextender/tests/testOrdering.py   archetypes.schemaextender(Download)
from Products.Archetypes.utils import OrderedDict
from archetypes.schemaextender.extender import get_schema_order
from archetypes.schemaextender.extender import set_schema_order
from archetypes.schemaextender.tests.mocks import MockField
 
    def testEmptySchema(self):
        schema=Schema()
        before=schema.signature()
        set_schema_order(schema, {})
        self.assertEqual(schema.signature(), before)
    def testIdentityFieldReorder(self):
        schema=Schema()
        schema.addField(MockField("one"))
        schema.addField(MockField("two"))
        set_schema_order(schema, {"default": ["one", "two"]})
    def testSwapTwoFields(self):
        schema=Schema()
        schema.addField(MockField("one"))
        schema.addField(MockField("two"))
        set_schema_order(schema, {"default": ["two", "one"]})
        command["one"]=["one"]
        command["two"]=["two"]
        set_schema_order(schema, command)
        self.assertEqual(schema.getSchemataNames(), ["one", "two"])