You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Product(AbstractProduct):
name = models.CharField(
max_length=500, verbose_name='Product', unique=True
)
default_photo_url = models.ImageField(
max_length=500,
storage=S3Boto3Storage(),
upload_to=product_upload_to_default,
)
is_active = models.BooleanField(default=True, null=False)
history = HistoricalRecords(
bases=[
DiffsHistoricalModel,
]
)
A historical model is being created. The default_photo_url field becomes a TextField. And when saving the product model an error occurs
File /lib/python3.11/site-packages/simple_history/models.py", line 662, in post_save
self.create_historical_record(instance, created and "+" or "~", using=using)
File lib/python3.11/site-packages/simple_history/models.py", line 780, in create_historical_record
history_instance.save(using=using)
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type ImageFieldFile is not JSON serializable
The text was updated successfully, but these errors were encountered:
Describe the bug
A historical model is being created. The default_photo_url field becomes a TextField. And when saving the product model an error occurs
The text was updated successfully, but these errors were encountered: