Metadata-Version: 2.1
Name: django-mom
Version: 0.0.5
Summary: Maps plain text data to a model, creating, updating, or removing it as it changes
Home-page: https://github.com/velitasali/django-mom
Author: Veli Tasalı
Author-email: me@velitasali.com
License: MIT
Project-URL: Source, https://github.com/velitasali/django-mom/
Project-URL: Tracker, https://github.com/velitasali/django-mom/issues/
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django :: 2.2
Classifier: Framework :: Django :: 3.0
Classifier: Framework :: Django :: 3.1
Classifier: Topic :: Database :: Front-Ends
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

[![View the Docs](https://readthedocs.org/projects/django-mom/badge/?version=latest&style=plastic)](https://django-mom.readthedocs.org/)

# 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

```python3
# 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 

```YAML
# File: mom.yaml

mom:
  map:
    post:
      model: home.models.Post
      lookupField: slug
```

### Object

```YAML
# File: post.my-awesome-post.mom.yaml
#            ^^^^^^^^^^^^^^^ is `slug` 

field:
  title: My Awesome Title
  date: 2021-06-25 13:00:00+3
```

### Result

```YAML
title: My Awesome Title
date: 2021-06-25 13:00:00+3
slug: my-awesome-post 
```


