Skip to main content

Group Django objects by similarity

Project description

Group Django model instances based on similar fields

Installation

  1. add django_grouper to your INSTALLED_APPS
  2. add path("", include("django_grouper.urls")) to your urlpatterns
  3. go to /grouper and add the param group_content_type to specify which ContentType to group and the params group_fields to specify which fields to group by

Configuration

If you define a GROUP_FILTER in you settings, the queryset in the /grouper view will be passed through this filter. The filter is expected to be a callable and will receive the queryset and the request as parameters. This means you can pass the queryset together with the request to a django-filter filter.

The /group view lets you select which objects of a list should be merged. If you double click an object, it will become the primary, a single click marks an object as secondary. There can be one primary and multiple secondaries. The primary and the list of secondaries are then passed to the trigger_merge signal. You can use this method to implement a custom merge method.

from django_grouper.signals import trigger_merge


@receiver(trigger_merge)
def react_on_merge_trigger(sender, primary, secondaries, **kwargs):
    primary.merge(secondaries)

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

django_grouper-0.4.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_grouper-0.4.0-py2.py3-none-any.whl (7.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django_grouper-0.4.0.tar.gz.

File metadata

  • Download URL: django_grouper-0.4.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_grouper-0.4.0.tar.gz
Algorithm Hash digest
SHA256 b57401edd03d4acca4366432c213a612fdd187e94275e8603d59c1da8a12a5a5
MD5 1b81584060e7913869d31fd3e7de384b
BLAKE2b-256 d8d938f1b045a652142c948a9d12f5e8dbdebd2d218628889c37fee3b4da8ccc

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_grouper-0.4.0.tar.gz:

Publisher: publish.yml on acdh-oeaw/django-grouper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_grouper-0.4.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_grouper-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b49c032506bd647feda302726bd588c23a08c79fcd5683228235b0098568309f
MD5 1276b701609951b291b8a5008598a2e8
BLAKE2b-256 6899a1f56dd0b788c8a03dbaf60bff90ae2651e040a0df768290bb46015a3af5

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_grouper-0.4.0-py2.py3-none-any.whl:

Publisher: publish.yml on acdh-oeaw/django-grouper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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