Skip to content
Snippets Groups Projects
Commit afb83d08 authored by Jonas Braathen's avatar Jonas Braathen
Browse files

Remove unused Like lookup type

parent 893f58c9
No related branches found
No related tags found
1 merge request!215Add CSRF_TRUSTED_ORIGINS to development settings
...@@ -6,26 +6,12 @@ from typing import Optional ...@@ -6,26 +6,12 @@ from typing import Optional
from dirtyfields import DirtyFieldsMixin from dirtyfields import DirtyFieldsMixin
from django.conf import settings from django.conf import settings
from django.db import models from django.db import models
from django.db.models import Lookup, Q from django.db.models import Q
from django.db.models.fields import Field
from django.utils import timezone from django.utils import timezone
from greg.managers import PersonManager from greg.managers import PersonManager
@Field.register_lookup
class Like(Lookup):
"""Allows doing LIKE comparisons when querying."""
lookup_name = "like"
def as_sql(self, compiler, connection):
lhs, lhs_params = self.process_lhs(compiler, connection)
rhs, rhs_params = self.process_rhs(compiler, connection)
params = lhs_params + rhs_params
return "%s LIKE %s" % (lhs, rhs), params
class BaseModel(DirtyFieldsMixin, models.Model): class BaseModel(DirtyFieldsMixin, models.Model):
"""Common fields for all models.""" """Common fields for all models."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment