Dynamic model definition and alteration (evolving schemas)
Project description
# django-mutant
## Overview
[Django](https://www.djangoproject.com/) provides a great ORM and with the power of [South](http://south.aeracode.org/) one can easily perform schema alteration.
However, some projects may require _runtime_ schema alteration and that's what _django-mutant_ provides.
The main concept was inspired by those projects:
- Will Hardy [dynamic-models](https://github.com/willhardy/dynamic-models) with [doc](http://dynamic-models.readthedocs.org/en/latest/index.html) and [talk](http://2011.djangocon.eu/talks/22/#talkvideo).
- And even more by [django-dynamo](http://pypi.python.org/pypi/django-dynamo)
## Direction of the project
The project is still in an early phase but a couple of complex things already works such as declaration of `RelatedField` (`ForeignKey`, `ManyToManyField`) between models and an easy way of declaring subclasses of `FieldDefinition` which allow any [`Field`](https://docs.djangoproject.com/en/dev/howto/custom-model-fields/) subclass to be be represented easily:
class DateFieldDefinition(FieldDefinition):
auto_now = fields.BooleanField(_(u'auto now'), default=False)
auto_now_add = fields.BooleanField(_(u'auto_now_add'), default=False)
class Meta:
app_label = 'mutant'
defined_field_class = fields.DateField
defined_field_options = ('auto_now', 'auto_now_add',)
defined_field_category = _(u'datetime')
This approach also allows projects such as [django-non-rel](https://github.com/django-nonrel/django-nonrel) to be truly useful since both your schema and your ORM wrapper around it are flexible.
## Get in touch and contribute
From now on I think the best way to contribute and get in touch is using github messaging system (issues and pull requests)
[![Build Status](https://secure.travis-ci.org/charettes/django-mutant.png)](http://travis-ci.org/charettes/django-mutant)
[Development version](https://github.com/charettes/django-mutant/tarball/master#egg=mutant-dev) can be installed from pip: `pip install django-mutant==dev`.
## Overview
[Django](https://www.djangoproject.com/) provides a great ORM and with the power of [South](http://south.aeracode.org/) one can easily perform schema alteration.
However, some projects may require _runtime_ schema alteration and that's what _django-mutant_ provides.
The main concept was inspired by those projects:
- Will Hardy [dynamic-models](https://github.com/willhardy/dynamic-models) with [doc](http://dynamic-models.readthedocs.org/en/latest/index.html) and [talk](http://2011.djangocon.eu/talks/22/#talkvideo).
- And even more by [django-dynamo](http://pypi.python.org/pypi/django-dynamo)
## Direction of the project
The project is still in an early phase but a couple of complex things already works such as declaration of `RelatedField` (`ForeignKey`, `ManyToManyField`) between models and an easy way of declaring subclasses of `FieldDefinition` which allow any [`Field`](https://docs.djangoproject.com/en/dev/howto/custom-model-fields/) subclass to be be represented easily:
class DateFieldDefinition(FieldDefinition):
auto_now = fields.BooleanField(_(u'auto now'), default=False)
auto_now_add = fields.BooleanField(_(u'auto_now_add'), default=False)
class Meta:
app_label = 'mutant'
defined_field_class = fields.DateField
defined_field_options = ('auto_now', 'auto_now_add',)
defined_field_category = _(u'datetime')
This approach also allows projects such as [django-non-rel](https://github.com/django-nonrel/django-nonrel) to be truly useful since both your schema and your ORM wrapper around it are flexible.
## Get in touch and contribute
From now on I think the best way to contribute and get in touch is using github messaging system (issues and pull requests)
[![Build Status](https://secure.travis-ci.org/charettes/django-mutant.png)](http://travis-ci.org/charettes/django-mutant)
[Development version](https://github.com/charettes/django-mutant/tarball/master#egg=mutant-dev) can be installed from pip: `pip install django-mutant==dev`.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-mutant-0.0.1.tar.gz
(28.8 kB
view details)
File details
Details for the file django-mutant-0.0.1.tar.gz
.
File metadata
- Download URL: django-mutant-0.0.1.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a79a5fdad2af37768655add634720ccf5e2a6184a1f8b68110db139a42a5c48 |
|
MD5 | 46332b2399f237e42c2ee04cbe1a4526 |
|
BLAKE2b-256 | 879f26bb6ae3875bb9c594f53d12a435ccc4c0ee155e6cb534cce8e5c9611ac9 |