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

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

src/c/y/cyn.in-HEAD/src/ubify.coretypes/ubify/coretypes/utils.py   cyn.in(Download)
 
from archetypes.schemaextender.extender import set_schema_order
from archetypes.schemaextender.extender import get_schema_order
 
from Products.ATContentTypes.interface import IATContentType

src/a/r/archetypes.schemaextender-2.1.3/archetypes/schemaextender/tests/testOrdering.py   archetypes.schemaextender(Download)
import unittest
from Products.Archetypes.public import Schema
from Products.Archetypes.public import ManagedSchema
from Products.Archetypes.utils import OrderedDict
from archetypes.schemaextender.extender import get_schema_order
    def testSchemataOrdering(self):
        schema=ManagedSchema()
        schema.addField(MockField("one", "one"))
        schema.addField(MockField("two", "two"))
        order=get_schema_order(schema)
        self.assertEqual(order, {"two": ["two"], "one": ["one"]})
        self.assertEqual(order.keys(), ["one", "two"])
 
        schema.moveSchemata("two", -1)
        order=get_schema_order(schema)
    def testFieldOrdering(self):
        schema=Schema()
        schema.addField(MockField("one"))
        schema.addField(MockField("two"))
        order=get_schema_order(schema)
        self.assertEqual(order, {"default": ["one", "two"]})
 
        schema.moveField("one", 1)
        order=get_schema_order(schema)