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
lookupField: slug
Object
# File: post.my-awesome-post.mom.yaml
# ^^^^^^^^^^^^^^^ is `slug`
field:
title: My Awesome Title
date: 2021-06-25 13:00:00+3
Result
title: My Awesome Title
date: 2021-06-25 13:00:00+3
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.6.tar.gz
(9.0 kB
view details)
Built Distribution
File details
Details for the file django-mom-0.0.6.tar.gz
.
File metadata
- Download URL: django-mom-0.0.6.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d82319d9ca418c61a397f62a47c8b5fd77a7942bbb3f58134ba52d1481d4aa39 |
|
MD5 | 6772d4495a24a17e09f4f26de7f386f9 |
|
BLAKE2b-256 | 6acc8e793e6008abb8eef1eb7f03ebf97939a1fe8997d3444b3ed18483f22c4a |
File details
Details for the file django_mom-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: django_mom-0.0.6-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 560f29042839daa8424ed8874b5dfb2661be9aed0036617b3e2f6b6612fd4051 |
|
MD5 | f45c21bff0384f821ed0d61ef24f6ef9 |
|
BLAKE2b-256 | 104669d889d1a24291171a07ec906edcd26deb55eca2ddc236a51344bb2f4a7b |