Setting up a trigger-based channel with a model containing a geometric field type returns a serialization error.
TypeError: Cannot set Location SpatialProxy (POINT) with value of type: <class 'dict'>
from dataclasses import dataclass
from django.contrib.gis.db.models import PointField
from django.db import models
from pgpubsub.channel import TriggerChannel
# models.py
class Location(models.Model):
name = models.CharField(max_length=255)
point = PointField(srid=4326)
# channels.py
@dataclass
class LocationTriggerChannel(TriggerChannel):
model = Location
lock_notifications = True
@a4f8b807445a4622 Thanks for raising. I'm hoping to have time to take a look at existing issues this month at some point. Hopefully I will be able to get this into the next release.
Setting up a trigger-based channel with a model containing a geometric field type returns a serialization error.
TypeError: Cannot set Location SpatialProxy (POINT) with value of type: <class 'dict'>