Skip to main content

Maps plain text data to a model, creating, updating, or removing it as it changes

Project description

PyPI version View the Docs example workflow

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 hashes)

Uploaded source

Built Distribution

django_mom-0.0.6-py3-none-any.whl (8.8 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page