This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync branches master -> release -> develop | |
on: | |
push: | |
branches: | |
- release | |
- master | |
jobs: | |
sync-release: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db.models import Q | |
from django.db.models.constants import LOOKUP_SEP | |
from django_filters import rest_framework as django_filters | |
from django_filters.constants import EMPTY_VALUES | |
class GroupFilterSet(django_filters.FilterSet): | |
def filter_queryset(self, queryset): | |
""" | |
Group the fitlers by the first join table to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db.backends.mysql import schema | |
class DatabaseSchemaEditor(schema.DatabaseSchemaEditor): | |
@property | |
def _supports_limited_data_type_defaults(self): | |
# MariaDB >= 10.2.1 supports defaults for BLOB and TEXT. | |
if self.connection.mysql_is_mariadb: | |
return self.connection.mysql_version >= (10, 2, 1) | |
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```python3 | |
from contextlib import contextmanager | |
from django.db.models.signals import * | |
@contextmanager | |
def disable_signals(sender, receiver, *signals): | |
if not signals: | |
signals = [pre_init, post_init, pre_save, post_save, pre_delete, post_delete] | |
disconnected_signals = [] |