jet-admin / jet-bridge

Consider decorating method with @staticmethod PYL-R0201
Performance
Major
a month ago4 years old
Method doesn't use the class instance and could be converted into a static method
 206
 207        return queryset
 208
 209    def get_relationships(self, request, MappedBase, draft): 210        result = {}
 211        relationships_overrides = {}
 212
Method doesn't use the class instance and could be converted into a static method
 181        self.model_lookups_relationship_types = dict()
 182        self.model_sort_types = dict()
 183
 184    def get_queryset(self, request, Model, only_columns=None): 185        mapper = inspect(Model)
 186        pks = mapper.primary_key
 187
Method doesn't use the class instance and could be converted into a static method
 841
 842        return type('Model{}RecordAttrsType'.format(name), (ModelAttrsType,), attrs)
 843
 844    def get_selections(self, info, path): 845        i = 0
 846        current_field = info.field_asts[0]
 847
Method doesn't use the class instance and could be converted into a static method
 830        self.model_sort_types[cls_name] = cls
 831        return graphene.List(cls)
 832
 833    def get_model_attrs_type(self, MappedBase, mapper): 834        table_name = get_table_name(MappedBase.metadata, mapper.selectable)
 835        name = clean_name(table_name)
 836        attrs = {}
Method doesn't use the class instance and could be converted into a static method
 322
 323        return dict(map(lambda x: map_models(x), relationships.items()))
 324
 325    def get_model_columns_by_clean_name(self, MappedBase, mapper): 326        table = mapper.tables[0]
 327        name = get_table_name(MappedBase.metadata, table)
 328        Model = MappedBase.classes.get(name)