Registers CategoryList objects to handle their requests.

        :param list category_lists: CategoryList objects
        :param dict lists_init_kwargs: Attributes to apply to each of CategoryList objects
760936
def register_lists(self, category_lists, lists_init_kwargs=None, editor_init_kwargs=None):
        
        lists_init_kwargs = lists_init_kwargs or {}
        editor_init_kwargs = editor_init_kwargs or {}

        for lst in category_lists:
            if isinstance(lst, string_types):  # Spawn CategoryList object from base category alias.
                lst = self.list_cls(lst, **lists_init_kwargs)
            elif not isinstance(lst, CategoryList):
                raise SitecatsConfigurationError(
                    '`CategoryRequestHandler.register_lists()` accepts only '
                    '`CategoryList` objects or category aliases.'
                )

            if self._obj:
                lst.set_obj(self._obj)

            for name, val in lists_init_kwargs.items():  # Setting CategoryList attributes from kwargs.
                setattr(lst, name, val)

            lst.enable_editor(**editor_init_kwargs)

            self._lists[lst.get_id()] = lst
931132
def init_widget(self):
        
        super(AndroidListView, self).init_widget()
        d = self.declaration
        self.set_arrangement(d.arrangement)
661368
def _initialize_lists(model_class, name, bases, attrs):
    """"""
    model_class._lists = {}
    for k, v in attrs.iteritems():
        if isinstance(v, ListField):
            model_class._lists[k] = v
            v.name = v.name or k
297318
def set_category(self, infohash_list, category):
        
        data = self._process_infohash_list(infohash_list)
        data['category'] = category
        return self._post('command/setCategory', data=data)
1344008
def create(self, parent_id, data, store_view=None):
        
        return int(self.call(
            'catalog_category.create', [parent_id, data, store_view])
        )
893188
def register(self, preference_class):
        
        preference = preference_class(registry=self)
        self.section_objects[preference.section.name] = preference.section

        try:
            self[preference.section.name][preference.name] = preference

        except KeyError:
            self[preference.section.name] = collections.OrderedDict()
            self[preference.section.name][preference.name] = preference

        return preference_class
235528
def set_categories(self):
        """"""
        self.categories = []
        temp_categories = self.soup.findAll('category')
        for category in temp_categories:
            category_text = category.string
            self.categories.append(category_text)
492459
def register_models(**kwargs):
    
    [setattr(models, k, v) for k, v in kwargs.items()]
1150407
def register_serializers(self, serializers):
        
        for new_serializer in serializers:

            if not isinstance(new_serializer, serializer.Base):
                msg = "registered serializer %s.%s does not inherit from prestans.serializer.Serializer" % (
                    new_serializer.__module__,
                    new_serializer.__class__.__name__
                )
                raise TypeError(msg)

        self._serializers = self._serializers + serializers
449096
def listify(*args):
    
    if (len(args) == 1) and callable(args[0]):
        func = args[0]

        @wraps(func)
        def _inner(*args, **kwargs):
            return list(func(*args, **kwargs))
        return _inner
    else:
        return list(args)
284318
def register_defs(self, def_list, **kwargs):
        
        for item in def_list:
            if isinstance(item, tuple):
                self.register_rml_def(*item, **kwargs)
            elif isinstance(item, dict):
                cp_kwargs = kwargs.copy()
                item.update(kwargs)
                self.register_rml_def(**item)
1370870
def register_model(self, app, model_name, field_type, field_definitions):
        
        from django.apps import apps
        import collections

        app_label = app

        if isinstance(field_definitions, str):
            field_definitions = [field_definitions]
        elif not isinstance(field_definitions, collections.Iterable):
            raise ImproperlyConfigured(_('Field configuration for %(app)s should be a string or iterable') % {'app': app})

        if field_type not in ('ForeignKey', 'ManyToManyField'):
            raise ImproperlyConfigured(_('`field_type` must be either `"ForeignKey"` or `"ManyToManyField"`.'))

        try:
            if not hasattr(model_name, "_meta"):
                app_config = apps.get_app_config(app)
                app_label = app_config.label
                model = app_config.get_model(model_name)
            else:
                model = model_name
                model_name = model._meta.model_name
            opts = model._meta
            if app_label not in self._model_registry:
                self._model_registry[app_label] = []
            if model not in self._model_registry[app_label]:
                self._model_registry[app_label].append(model)
        except LookupError:
            raise ImproperlyConfigured('Model "%(model)s" doesn\'t exist in app "%(app)s".' % {'model': model_name, 'app': app})

        if not isinstance(field_definitions, (tuple, list)):
            field_definitions = [field_definitions]

        for fld in field_definitions:
            extra_params = {'to': 'categories.Category', 'blank': True}
            if field_type != 'ManyToManyField':
                extra_params['on_delete'] = CASCADE
                extra_params['null'] = True
            if isinstance(fld, str):
                field_name = fld
            elif isinstance(fld, dict):
                if 'name' in fld:
                    field_name = fld.pop('name')
                else:
                    continue
                extra_params.update(fld)
            else:
                raise ImproperlyConfigured(
                    _("%(settings)s doesn't recognize the value of %(app)s.%(model)s") % {
                        'settings': 'CATEGORY_SETTINGS',
                        'app': app,
                        'model': model_name})
            registry_name = ".".join([app_label, model_name.lower(), field_name])
            if registry_name in self._field_registry:
                continue

            try:
                opts.get_field(field_name)
            except FieldDoesNotExist:
                self._field_registry[registry_name] = FIELD_TYPES[field_type](**extra_params)
                self._field_registry[registry_name].contribute_to_class(model, field_name)
717733
def add_category(self, category):
        
        self._categories = self._ensure_append(category, self._categories)
197012
private void initializeList() {
		FavouritesCommService.getSearchFavourites(new DataCallback<List<SearchFavourite>>() {
			public void execute(List<SearchFavourite> result) {
				favouriteItems.getDataAsRecordList().removeList(favouriteItems.getRecords());
				for (SearchFavourite sf : result) {
					favouriteItems.addData(new FavouriteListRecord(sf));
				}
			}
		});
	}
197726
def create(self, request, *args, **kwargs):
        
        return self.list(request, *args, **kwargs)
37532
def register(self, category):
        
        def decorator(func):
            name = func.__name__
            key = f'{category}.{name}'
            self._metrics[key] = func
            return func
        return decorator
422378
def register(self, klass, callback, name="default"):
        
        if klass not in self._definitions:
            self._definitions[klass] = {}

        self._definitions[klass][name] = callback