Same as Django JSONField but represent it as YAML (internally stores as JSON)
pip install django-yaml-field
from django.db import models
from django_yaml_field import YAMLField
class ModelName(models.Model):
yaml = YAMLField()
Allows querying the stored data using lookups in the same way described in Django documentation
If you want a nice syntax highlight in form, you can use with django-ace
from django_ace import AceWidget
@admin.register(ModelName)
class ModelName(admin.ModelAdmin):
formfield_overrides = {YAMLField: {"widget": AceWidget(mode="yaml")}}
MIT