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
238            field = desc(field)
239        return field
240
241    def get_column(self, session, name, **kwargs):242        if get_session_engine(session) == 'oracle':
243            name = quoted_name(name, True)
244        return column(name, **kwargs)
Method doesn't use the class instance and could be converted into a static method
216
217        return queryset
218
219    def paginate_queryset(self, queryset, data):220        if 'offset' in data:
221            queryset = queryset.offset(data['offset'])
222
Method doesn't use the class instance and could be converted into a static method
167        self.lookup = lookup
168        self.exclude = exclude
169
170    def clean_value(self, value):171        return value
172
173    def get_lookup_criterion(self, qs, value):
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)
Method doesn't use the class instance and could be converted into a static method
 313
 314        return result
 315
 316    def clean_relationships_by_name(self, relationships): 317        def map_model_relations(x):
 318            return clean_name(x[0]), x[1]
 319