Skip to content

Commit

Permalink
Switch to using cached_property from functools aways from Django's no…
Browse files Browse the repository at this point in the history
…w deprecated implementation
  • Loading branch information
robert102 committed Dec 11, 2024
1 parent 4fed864 commit af70d2a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion mibios/glamr/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
GLAMR-specific modeling
"""
from functools import cached_property

from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.contenttypes.fields import GenericForeignKey, \
Expand All @@ -15,7 +17,6 @@
from django.db.models import Index
from django.urls import reverse
from django.utils.dateparse import parse_datetime, parse_date, parse_time
from django.utils.functional import cached_property

from mibios import __version__ as mibios_version
from mibios.omics.models import AbstractDataset, AbstractSample
Expand Down
3 changes: 2 additions & 1 deletion mibios/glamr/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from functools import cached_property
from itertools import groupby
from logging import getLogger
import pprint
Expand All @@ -15,7 +16,7 @@
from django.db.models import Count, Exists, Field, OuterRef, Prefetch, URLField
from django.http import Http404, HttpResponse
from django.urls import reverse
from django.utils.functional import cached_property, classproperty
from django.utils.functional import classproperty
from django.utils.html import format_html
from django.views.decorators.cache import cache_control, cache_page
from django.views.generic import DetailView
Expand Down
3 changes: 2 additions & 1 deletion mibios/ncbi_taxonomy/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from functools import cached_property

from django.db import models
from django.utils.functional import cached_property

from mibios.umrad.model_utils import ch_opt, fk_opt, fk_req, opt
from mibios.umrad.model_utils import Model as UmradModel
Expand Down
3 changes: 1 addition & 2 deletions mibios/omics/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from collections import defaultdict
from contextlib import ExitStack
from datetime import date
from functools import partial
from functools import cached_property, partial
from itertools import groupby, islice
from logging import getLogger
import os
Expand All @@ -18,7 +18,6 @@
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db.transaction import atomic, set_rollback
from django.utils.functional import cached_property
from django.utils.module_loading import import_string

from mibios import __version__ as version
Expand Down
2 changes: 1 addition & 1 deletion mibios/omics/tracking.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from enum import Enum
from functools import cached_property
from importlib import import_module
import inspect
import sys

from django.db.transaction import atomic
from django.utils.functional import cached_property

from .models import SampleTracking

Expand Down
2 changes: 1 addition & 1 deletion mibios/tables.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from functools import cached_property
import re

from django.db.models import DecimalField
from django.urls import reverse
from django.utils.functional import cached_property
from django.utils.html import format_html

import django_tables2 as tables
Expand Down
2 changes: 1 addition & 1 deletion mibios/umrad/fields.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from functools import cached_property
from pathlib import Path

from django.core.exceptions import ValidationError
from django.db.models import Field, CharField
from django.utils.functional import cached_property


def path_exists_validator(value):
Expand Down

0 comments on commit af70d2a

Please sign in to comment.