Skip to main content

Search index for Django.

Project description

Pony Indice is a Django re-usable app to create a simple search engine for your project.

Install

Install it as usual (pip coming):

pip install pony-indice

Add the app in your INSTALLED_APPS:

INSTALLED_APPS = (
   ...
   'pony_indice',
   ...
)

And launch the migration to create the table:

./manage.py migrate

Usage

The usage is quite simple:

from pony_indice import registry as indice_registry

@indice_registry.register()
class YourModel(models.Models):
   rank = models.IntegerField()

Now your model is tagged as “tracked” and the following behaviors are added:

  • On post_save signals a Link will be created/updated in database

  • On post_delete the Link will be mark as “removed”

(Update aren’t taken in account and may lead to broken URLs)

Basicaly this app is based on the other decorated models, but you can easily import pony_indice.models.Link and add the link which you want, especialy external ones.

Tools

QuerySet

The Link’s queryset has the method filter_q method, which is a simple filter looking if fields display or description contain a string. Useful to create easily any search tool.

Admin

Of course the admin interface is already configured.

REST Framework

pony_indice.contrib.rest_framework.serializers.LinkSerializer and pony_indice.contrib.rest_framework.viewsets.LinkViewsets are here to play quickly with Django REST Framework.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pony-indice-0.0.4.tar.gz (7.9 kB view details)

Uploaded Source

File details

Details for the file pony-indice-0.0.4.tar.gz.

File metadata

  • Download URL: pony-indice-0.0.4.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.4 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.2

File hashes

Hashes for pony-indice-0.0.4.tar.gz
Algorithm Hash digest
SHA256 2f8d6e266238d8d89a39b6900ebce92714005357b24ff788872727eddc0dce6a
MD5 410d79c34da12bcc259d905096a19c7d
BLAKE2b-256 deb9305d645767e9236e75eedda067a57457e4cd2783f18c8941b276c5c2b38b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page