Exemple #1
0
    def class_init(cls):
        """Called internally at site startup. Don't override.

        """
        # if str(cls) == 'courses.Pupils':
        #     print("20160329 class_init")
        if hasattr(cls, 'required'):
            raise ChangedAPI(
                "{0} must convert `required` to `required_roles`".format(cls))
        master = getattr(cls, 'master', None)
        if isinstance(master, string_types):
            cls.master = resolve_model(master)

        actions.install_layout(cls, 'detail_layout', layouts.DetailLayout)
        actions.install_layout(cls,
                               'insert_layout',
                               layouts.InsertLayout,
                               window_size=(cls.insert_layout_width, 'auto'))

        if cls.parameters is None:
            params = cls.get_parameter_fields()
            if len(params):
                cls.parameters = params
        else:
            cls.parameters = cls.get_parameter_fields(**cls.parameters)

        cls.simple_parameters = cls.get_simple_parameters()
Exemple #2
0
    def class_init(cls):
        """Called internally at site startup. Don't override.

        """
        # if str(cls) == 'courses.Pupils':
        #     print("20160329 class_init")
        if hasattr(cls, 'required'):
            raise ChangedAPI(
                "{0} must convert `required` to `required_roles`".format(cls))
        master = getattr(cls, 'master', None)
        if isinstance(master, string_types):
            cls.master = resolve_model(master)

        actions.install_layout(cls, 'detail_layout', layouts.DetailLayout)
        actions.install_layout(
            cls, 'insert_layout', layouts.InsertLayout,
            window_size=(cls.insert_layout_width, 'auto'))

        if cls.parameters is None:
            params = cls.get_parameter_fields()
            if len(params):
                cls.parameters = params
        else:
            cls.parameters = cls.get_parameter_fields(**cls.parameters)

        cls.simple_parameters = cls.get_simple_parameters()
Exemple #3
0
    def class_init(cls):
        """
        Called internally a site startup. Don't override.
        """
        master = getattr(cls, 'master', None)
        if master is not None:
            cls.master = resolve_model(master)

        actions.install_layout(cls, 'detail_layout', layouts.FormLayout)
        actions.install_layout(
            cls, 'insert_layout', layouts.FormLayout,
            window_size=(cls.insert_layout_width, 'auto'))