Skip to content

Commit

Permalink
Merge pull request #1 from akvo/django4-lts-upgrade
Browse files Browse the repository at this point in the history
Upgrade to postgres 14.11 for dev env
  • Loading branch information
zuhdil authored Mar 12, 2024
2 parents 014a911 + 027ce2e commit bf41eaa
Show file tree
Hide file tree
Showing 191 changed files with 3,584 additions and 2,402 deletions.
14 changes: 7 additions & 7 deletions akvo/cache/memcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
from functools import reduce
from typing import List, Tuple, Dict

import memcache
from django.core.cache.backends.memcached import MemcachedCache
import pymemcache
from django.core.cache.backends.memcached import PyMemcacheCache


class AkvoMemcacheClient(memcache.Client):
class AkvoMemcacheClient(pymemcache.HashClient):

def get_slabs(self) -> List[Tuple[str, Dict[str, dict]]]: # pragma: no cover
"""
Override to fix decoding error in super().get_slabs
Slabs are memory regions in memcache where data is stored.
They have a unique ID (number).
FIXME: Needs to be rewritten because the dependency is changed to pymemcache
"""
data = []
for s in self.servers:
Expand Down Expand Up @@ -45,16 +47,14 @@ def get_slabs(self) -> List[Tuple[str, Dict[str, dict]]]: # pragma: no cover
return data


class AkvoMemcachedCache(MemcachedCache):
class AkvoMemcachedCache(PyMemcacheCache):

@property
def _cache(self):
"""Provide our AkvoMemcacheClient for cache access"""

if getattr(self, '_client', None) is None:
client_kwargs = dict(pickleProtocol=pickle.HIGHEST_PROTOCOL)
client_kwargs.update(self._options)
self._client = AkvoMemcacheClient(self._servers, **client_kwargs)
self._client = AkvoMemcacheClient(self._servers, **self._options)
return self._client

def list_keys(self) -> List[str]:
Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/activity_date_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/activity_scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/activity_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/aid_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/aid_type_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/aid_type_flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/aid_type_vocabulary.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/base_codelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _


class BaseCodelist(models.Model):
Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/budget_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/budget_identifier_sector.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/budget_identifier_sector_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/budget_identifier_vocabulary.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/budget_not_provided.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/budget_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/budget_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/cashand_voucher_modalities.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/collaboration_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/condition_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/contact_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/country.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/crs_add_other_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/crs_channel_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/description_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/disbursement_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/document_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/document_category_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/earmarking_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/file_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/finance_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/finance_type_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/flow_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/gazetteer_agency.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/geographic_exactness.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/geographic_location_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/geographic_location_reach.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/geographic_vocabulary.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/geographical_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/humanitarian_scope_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
Loading

0 comments on commit bf41eaa

Please sign in to comment.