django-smart-save 0.1

Smart saving of Django models
django-smart-save is a Django app that provides a simple abstract model that will only save your model object if it is new, one or more fields have been changed locally, or it is specifically instructed to do so. Every field type is inspected for changes aside from ManyToManyFields which do not require a separate call to save. Using django-smart-save can be a provide great performance improvements in the right situations.

Installation

Install from PyPI:

 pip install django-smart-save

Install from GitHub:

 git clone git://github.com/derek-schaefer/django-smart-save.git

 pip install -e git+git://github.com/derek-schaefer/django-smart-save.git#egg=smart_save

Configuration

Add smart_save to your PYTHONPATH and INSTALLED_APPS setting:

INSTALLED_APPS = (
 ...
 'smart_save',
 ...
)


(Optional) Use the model-specific configuration settings:

class MyModel(SmartSaveModel):

 SMART_SAVE_FORCE = True # skips dirty field checking
 SMART_SAVE_IGNORE_FIELDS = ('last_updated',) # will not mark these fields as dirty
 ...


Usage

Simply subclass SmartSaveModel. Model-specific options are documented above.:

from smart_save.models import SmartSaveModel

class MyModel(SmartSaveModel):
 ...


Aside from the SMART_SAVE_FORCE model attribute, you can also pass force=True to your model's save method to skip field checking.

last updated on:
April 26th, 2012, 7:30 GMT
price:
FREE!
developed by:
Derek Schaefer
homepage:
github.com
license type:
BSD License 
category:
ROOT \ Internet \ HTTP (WWW)
django-smart-save
Download Button

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

Rate it!

Add your review!

SUBMIT