Skip to content

null-none/django-yaml-field

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-yaml-field

Same as Django JSONField but represent it as YAML (internally stores as JSON)

Pip install

pip install django-yaml-field

Example

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

Syntax Highlight

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")}}

License

MIT

About

Same as Django JSONField but represent it as YAML (internally stores as JSON)

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages