Skip to main content

Anonymize specific django model for specific instance - support for wagtail

Project description

wagtail-neuralyzer

Pairs with django-neuralyzer, with wagtail support.

Install

pip install wagtail-neuralyzer

Register a model to have neuralyze action

Add wagtail_neuralyzer to your INSTALLED_APP:

INSTALLED_APP = [
    ...
    "django_neuralyzer",
    "wagtail_neuralyzer",
    ...
]

Add item action

Add the NeuralyzeSnippetViewSetMixin to your snippet class:

from wagtail_neuralyzer.views import NeuralyzeSnippetViewSetMixin
from wagtail_neuralyzer.views import NeuralyzeView

from my_app.neuralyzers import PersonNeuralyzer

# Create a new view that handle url and action as well as neuralyzer class
class OperatorNeuralyzeView(NeuralyzeView):
    neuralyzer_class = OperatorNeuralyzer


# inherit NeuralyzeSnippetViewSetMixin to register new url and neuralyze view
class PersonSnippetViewSet(NeuralyzeSnippetViewSetMixin, SnippetViewSet):
    model = Person
    neuralyze_view_class = OperatorNeuralyzeView
    ...

And Tada, your model should have an "Anonymize" action together with save/delete/publish/...

Add bulk action

You can also add bulk action to the index view by registering wagtail hook

from wagtail import hooks

from wagtail_neuralyzer.action import NeuralyzeBulkAction

from my_app.models import Person
from my_app.neuralyzers import StudentNeuralyzer

@hooks.register("register_bulk_action")
class PersonNeuralyzerBulkAction(NeuralyzeBulkAction):
    models = [Person] # specify model here
    neuralyzer_class = PersonNeuralyzer # and neuralyzer to use here

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

wagtail_neuralyzer-0.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

wagtail_neuralyzer-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file wagtail_neuralyzer-0.1.0.tar.gz.

File metadata

  • Download URL: wagtail_neuralyzer-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for wagtail_neuralyzer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4ac4222d720c867b47e7e740f26d57f497ee6500671f5262d97db27be56a4211
MD5 bd46a72dd259e43154257282b7b8b7f5
BLAKE2b-256 8b32b9f9118449cd7dbd50cc13c439b3f794508e4322a37703479911242d7ee8

See more details on using hashes here.

File details

Details for the file wagtail_neuralyzer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wagtail_neuralyzer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2bf64ca4e1de0f482a714a7dd7eaa3900466fa2b8b474d11806e0190a70a7a44
MD5 73dac24f501a8f0b1d54a2daf62a2b38
BLAKE2b-256 248af6581fb0d5eb555494eb9e6a10bd9ad0f7db9897eece6becccd4c3bc28a8

See more details on using hashes here.

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