Django Management Utility for statically creating and updating database entries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Veli Tasalı 76dd95ba16
README: Add github actions status badge
5 months ago
.github/workflows ci: Set up github actions 5 months ago
django_mom test: Set up 5 months ago
test_app test: Set up 5 months ago
test_core test: Set up 5 months ago
test_data test: Set up 5 months ago
.drone.yml ci: Set up drone 5 months ago
.gitignore test: Set up 5 months ago
LICENSE Initial release 5 months ago
README.md README: Add github actions status badge 5 months ago
manage.py test: Set up 5 months ago
pyproject.toml Initial release 5 months ago
requirements.txt Initial release 5 months ago
setup.cfg test: Set up 5 months ago

README.md

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