Maps plain text data to a model, creating, updating, or removing it as it changes
Project description
Model Object Mapper for Django
Map YAML files to a database and add/update/delete them as they change.
Installation
For Fresh Builds
pip install -i https://test.pypi.org/simple/ django-mom
For Milestone Builds
pip install django-mom
Usage
Model
# File: home/models.py
from django.db import models
class Post(models.Model):
title = models.CharField(max_length=100, )
date = models.DateTimeField()
slug = models.SlugField(unique=True, )
Map
# File: mom.yaml
mom:
map:
post:
model: home.models.Post
field: slug
Object
# File: post.my-awesome-post.mom.yaml
# ^^^^^^^^^^^^^^^ is `slug`
field:
title: My Awesome Title
date: 2021-06-25 13:00
Result
title: My Awesome Title
date: 2021-06-25 13:00
slug: my-awesome-post
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-mom-0.0.4.tar.gz
(7.9 kB
view hashes)
Built Distribution
Close
Hashes for django_mom-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 572700e2fb1e967b47edc7517f42131c8db3aaa3869d06516c8e6348f8e53cd6 |
|
MD5 | 5d59a2e70245e0915d214759b9aa8a8f |
|
BLAKE2b-256 | 3b1237ade51c274f85bfb9645ec42495ee50f7bf85addf3e274cd8db3d1226b1 |