示例#1
0
 def perform(self, obj, app_class):
     app_class._permits.register(
         methodify(obj, selfname="app"),
         identity=self.identity,
         obj=self.model,
         permission=self.permission,
     )
示例#2
0
    def perform(self, obj, app_class, datasource_registry: DataSourceRegistry):
        def factory(name):
            return obj

        app_class.get_datasource_factory.register(reg.methodify(factory),
                                                  name=self.name)
        datasource_registry.register(name=self.name, **self.cache_config)
示例#3
0
 def perform(self, obj, app_class):
     app_class.get_structure_column.register(
         reg.methodify(obj),
         model=self.model,
         request=morepath.Request,
         name=self.name,
     )
示例#4
0
    def perform(self, obj, app_class, type_registry: TypeRegistry):
        def factory(name):
            return obj

        app_class.get_typeinfo_factory.register(reg.methodify(factory),
                                                name=self.name)
        type_registry.register_type(name=self.name)
示例#5
0
    def perform(self, obj, app_class, behavior_registry: BehaviorRegistry):
        def factory(name):
            return obj

        app_class.get_behavior_factory.register(reg.methodify(factory),
                                                name=self.name)
        behavior_registry.register_behavior(name=self.name)
示例#6
0
    def perform(self, obj, app_class,
                default_factory_registry: DefaultFactoryRegistry):
        def factory(name):
            return obj

        app_class.get_default_factory.register(reg.methodify(factory),
                                               name=self.name)
        default_factory_registry.register(name=self.name)
示例#7
0
    def perform(self, obj, app_class):
        def get_provider(model, name):
            return PortletProvider(obj, self.permission, self.name)

        app_class.get_contextportletprovider.register(
            reg.methodify(get_provider),
            model=self.model,
            name=self.name,
        )
示例#8
0
文件: path.py 项目: morepath/morepath
    def register_path_variables(self, model, func):
        """Register variables function for a model class.

        :param model: model class
        :param func: function that gets a model instance argument and
          returns a variables dict.
        """
        self.app_class._path_variables.register(
            methodify(func, selfname='app'), obj=model)
示例#9
0
    def register_path_variables(self, model, func):
        """Register variables function for a model class.

        :param model: model class
        :param func: function that gets a model instance argument and
          returns a variables dict.
        """
        self.app_class._path_variables.register(methodify(func,
                                                          selfname='app'),
                                                obj=model)
示例#10
0
 def perform(self, obj, app_class):
     app_class.get_breadcrumb.register(
         reg.methodify(obj),
         model=self.model,
         request=morepath.Request,
     )
示例#11
0
 def perform(self, obj, app_class):
     app_class.get_license_key.register(
         reg.methodify(obj),
         request=morepath.Request,
     )
示例#12
0
    def perform(self, obj, app_class):
        def factory(name):
            return obj

        app_class.get_index_resolver.register(reg.methodify(factory),
                                              name=self.name)
示例#13
0
 def perform(self, obj, app_class):
     app_class.get_restricted_module.register(reg.methodify(obj),
                                              name=self.name)
示例#14
0
 def perform(self, obj, app_class):
     app_class._dump_json.register(
         methodify(obj, selfname='app'),
         obj=self.model)
示例#15
0
 def perform(self, obj, app_class):
     app_class.get_dataprovider.register(reg.methodify(obj),
                                         schema=self.schema,
                                         obj=self.obj,
                                         storage=self.storage)
示例#16
0
 def perform(self, obj, app_class):
     app_class._verify_identity.register(methodify(obj, selfname='app'),
                                         identity=self.identity)
示例#17
0
 def perform(self, obj, app_class):
     app_class._permits.register(
         methodify(obj, selfname='app'),
         identity=self.identity,
         obj=self.model,
         permission=self.permission)
示例#18
0
 def perform(self, obj, app_class):
     app_class.get_static_components = reg.methodify(obj, selfname='app')
示例#19
0
 def perform(self, obj, app_class):
     app_class.get_xattrprovider.register(reg.methodify(obj),
                                          model=self.model)
示例#20
0
 def perform(self, obj, app_class):
     app_class._get_authn_provider.register(reg.methodify(obj))
示例#21
0
 def perform(self, obj, app_class):
     app_class.get_identifierfields.register(reg.methodify(obj),
                                             schema=self.schema)
示例#22
0
 def perform(self, obj, app_class):
     app_class.get_jsonprovider.register(reg.methodify(obj), obj=self.obj)
示例#23
0
 def perform(self, obj, app_class):
     app_class.get_copyright_notice.register(
         reg.methodify(obj),
         request=morepath.Request,
     )
示例#24
0
 def perform(self, obj, app_class):
     app_class._load_json = methodify(obj, selfname='app')
示例#25
0
 def perform(self, obj, app_class):
     app_class.get_formvalidators.register(reg.methodify(obj),
                                           schema=self.schema)
示例#26
0
 def perform(self, obj, app_class):
     app_class._verify_identity.register(
         methodify(obj, selfname='app'),
         identity=self.identity)
示例#27
0
 def perform(self, obj, app_class):
     app_class._link_prefix = methodify(obj, selfname='app')
示例#28
0
 def perform(self, obj, app_class):
     app_class.get_statemachine.register(reg.methodify(obj),
                                         model=self.model)
示例#29
0
 def perform(self, obj, app_class):
     app_class.get_messagingprovider.register(reg.methodify(obj),
                                              request=morepath.Request,
                                              name=self.name)
示例#30
0
 def perform(self, obj, app_class):
     app_class._get_blobstorage.register(reg.methodify(obj),
                                         model=self.model,
                                         request=morepath.Request)
示例#31
0
 def perform(self, obj, app_class):
     app_class.get_schemaextender.register(reg.methodify(obj),
                                           schema=self.schema)
示例#32
0
 def perform(self, obj, app_class):
     app_class.get_vocabulary.register(reg.methodify(obj),
                                       request=morepath.Request,
                                       name=self.name)
示例#33
0
 def perform(self, obj, app_class):
     app_class._dump_json.register(methodify(obj, selfname='app'),
                                   obj=self.model)
示例#34
0
 def perform(self, obj, app_class):
     app_class.get_indexer.register(
         reg.methodify(obj),
         model=self.model,
         name=self.name,
     )
示例#35
0
 def perform(self, obj, app_class):
     app_class._link_prefix = methodify(obj, selfname='app')
示例#36
0
 def perform(self, obj, app_class):
     app_class.get_static_components = reg.methodify(obj, selfname='app')