+ @classmethod
+ def get_visible_for(cls, user):
+ qs = cls.objects.all()
+ if not user.is_authenticated:
+ qs = qs.filter(public=True)
+ return qs
+
+ @staticmethod
+ def q_dc(field, field_plural, value, prefix=''):
+ if connection.features.supports_json_field_contains:
+ return models.Q(**{f'{prefix}dc__{field_plural}__contains': value})
+ else:
+ return models.Q(**{f'{prefix}dc__{field}': value})
+
+