Skip to main content

Adsocket transport

Install

pip install adsocket-transport-django

Usage

Using django.db.singals is very easy...

from django.apps import AppConfig
from adsocket_transport_django.apps import ADSocketConfig


class VideosConfig(ADSocketConfig, AppConfig):
    """
    Basic application config
    """
    name = "myapp"
    verbose_name = "My App"

    adsocket_signals = [
        'myapp.ws_message_creator.VideoMessageCreator'

    ]
from adsocket_transport_django.creator import ADSocketCreator
from adsocket_transport_django import CREATE, UPDATE, DELETE, Message

from myapp import models


class VideoMessageCreator(ADSocketCreator):

    class Meta:
        model = models.Todo

    def create(self, model):
        return Message(
            type='publish',
            channel=f'todos:{model.pk}',
            data={'obj': model.pk, 'action': 'create'}
        )

    def update(self, model):
        return Message(
            type='publish',
            channel=f'todos:{model.pk}',
            data={'obj': model.pk, 'action': 'update'}
        )

    def delete(self, model):
        return Message(
            type='publish',
            channel=f'todos:{model.pk}',
            data={'obj': model.pk, 'action': 'delete'}
        )

Metadata

Release files for adsocket-transport-django 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adsocket-transport-django 0.1.3
File Size Uploaded Provenance
adsocket-transport-django-0.1.3.tar.gz 2.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for adsocket-transport-django 0.1.3
File Interpreter ABI Platform
adsocket_transport_django-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 11.8 kB

Release files / adsocket-transport-django-0.1.3.tar.gz

Download URL adsocket-transport-django-0.1.3.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ce812e80ccef2658bd1dec1a3c53d595c0d96ca593ae75fd8df882429da5a8d4
BLAKE2b-256 checksum
How to use checksums
817b03acd418e53441064f2c849427e48191d522f2aa0f34a2c822db75adb8e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

Release files / adsocket_transport_django-0.1.3-py3-none-any.whl

Download URL adsocket_transport_django-0.1.3-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7303097cbcf412eea9c288d47a11a6cc56976cb74aff6aafadd75a636320db1
BLAKE2b-256 checksum
How to use checksums
1c47e332b10a56ad2a2274e36d9f70c17840958a9cb4e370d78ff7dc298289dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

Security for adsocket-transport-django 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page