Django icontains doesnt work with line beakes

im using django 2.1.8

model.py

class Article(models.Model):
    title = models.CharField("title", default="", max_length=20)
    text = models.CharField("comment", default="", max_length=120)

the one object i have

[
    {
        "id": 1,
        "title": "test",
        "comment": "there is a
linebrake"
    }
]

views.py

a = Article.objects.filter(text__icontains="\r\n").all()
b = Article.objects.filter(text__icontains="there").all()

It finds a but not b.

As long as icontains includes the "\r\n" i can find all things normal. But a user wont search for "\r\n linebrake". how does it work without "\r\n"?

Back to Top