Skip to content

Django Management Utility for statically creating and updating database entries

License

Notifications You must be signed in to change notification settings

velitasali/django-mom

Repository files navigation

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 

About

Django Management Utility for statically creating and updating database entries

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages