{"id":13673329,"url":"https://github.com/knipknap/django-find","last_synced_at":"2025-12-30T06:03:30.139Z","repository":{"id":57420096,"uuid":"156128759","full_name":"knipknap/django-find","owner":"knipknap","description":"Easily add search/filter functionality to Django projects","archived":false,"fork":false,"pushed_at":"2024-07-11T12:18:46.000Z","size":156,"stargazers_count":65,"open_issues_count":1,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-22T18:11:43.188Z","etag":null,"topics":["django","json","python","query","search"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knipknap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-04T21:53:11.000Z","updated_at":"2024-11-20T07:28:23.000Z","dependencies_parsed_at":"2024-04-10T02:55:55.694Z","dependency_job_id":"2c5086fc-2d5b-45a2-8fd6-033367464998","html_url":"https://github.com/knipknap/django-find","commit_stats":{"total_commits":104,"total_committers":3,"mean_commits":"34.666666666666664","dds":"0.038461538461538436","last_synced_commit":"6fd9f8aa766477e8648fdbed720e966af1b216b7"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knipknap%2Fdjango-find","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knipknap%2Fdjango-find/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knipknap%2Fdjango-find/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knipknap%2Fdjango-find/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knipknap","download_url":"https://codeload.github.com/knipknap/django-find/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251284858,"owners_count":21564681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","json","python","query","search"],"created_at":"2024-08-02T10:00:35.228Z","updated_at":"2025-12-30T06:03:30.055Z","avatar_url":"https://github.com/knipknap.png","language":"Python","funding_links":[],"categories":["Resources"],"sub_categories":["Other notes"],"readme":"# django-find\n\n[![Build Status](https://travis-ci.org/knipknap/django-find.svg?branch=master)](https://travis-ci.org/knipknap/django-find)\n[![Coverage Status](https://coveralls.io/repos/github/knipknap/django-find/badge.svg?branch=master)](https://coveralls.io/github/knipknap/django-find?branch=master)\n[![Code Climate](https://lima.codeclimate.com/github/knipknap/django-find/badges/gpa.svg)](https://lima.codeclimate.com/github/knipknap/django-find)\n[![Documentation Status](https://readthedocs.org/projects/django-find/badge/?version=latest)](http://django-find.readthedocs.io/en/latest/?badge=latest)\n\n## Summary\n\n**django-find** is a Django app that makes it easy to add complex\nsearch/filter functionality for the models in your project.\nIt supports two different ways to search your Django models:\nQuery-based, or JSON-based.\n\n**django-find** is not a full text search engine, it searches the fields\nof your models. In other words, it filters on your models and provides\ntabular data as a result.\n\n## Features\n\n### Query-based search\n\nBy query-based, we mean that you can use statements like these\nto search your models:\n\n```\nauthor:\"robert frost\" and (title:road or chapter:2)\n```\n\n### Add a search field to your template using a single tag\n\n```\n{% load find_tags %}\n{% find object_list %}\n{% for obj in object_list %}\n  {{ obj.name }}\n{% endfor %}\n```\n\n(object\\_list is a queryset that is passed to the template)\n\n### Query in your code\n\nJust add the Searchable mixin:\n\n```python\nfrom django_find import Searchable\n\nclass Author(models.Model, Searchable):\n    name = models.CharField(\"Author Name\", max_length=10)\n    ...\n```\n\nAnd you are good to go:\n\n```python\n# Query-based search returns a standard Django QuerySet that you\n# can .filter() and work with as usual.\nquery = Book.by_query('author:\"robert frost\" and title:\"the road\"')\n\n# You can also get a Django Q object for the statements.\nq_obj = Book.q_from_query('author:\"robert frost\" and title:\"the road\"')\n```\n\n### Query using JSON\n\nTo make it easy to do complex searches spanning multiple models, JSON-based\nquery method is provided. It allows your to make custom searches like these:\n\n![Custom Search](https://raw.githubusercontent.com/knipknap/django-find/master/docs/_static/custom.png)\n\nFor this, a JSON-based search functionality is provided:\n\n```\n{\n    \"Author\":{\"name\":[[[\"equals\",\"test\"]]]},\n    \"Book\": {\"title\":[[[\"notcontains\",\"c\"]]]},\n    \"Chapter\": {\"content\":[[[\"startswith\",\"The \"]]]}\n}\n```\n\ndjango-find is smart in figuring out how to join those models\ntogether and return a useful result.\nIn your code, you can load the JSON and get back the search\nresult:\n\n```python\n# JSON-based search exhausts what Django's ORM can do, so it does\n# not return a Django QuerySet, but a row-based PaginatedRawQuerySet:\nquery, field_list = Book.by_json_raw('''{\n    \"Chapter\": {\"title\":[[[\"contains\",\"foo\"]]]}\n}''')\nprint('|'.join(field_list))\nfor row in query:\n    print('|'.join(row))\n```\n\n## Documentation\n\nFull documentation, including installation instructions, is here:\n\nhttp://django-find.readthedocs.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknipknap%2Fdjango-find","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknipknap%2Fdjango-find","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknipknap%2Fdjango-find/lists"}