Skip to content

Commit

Permalink
Merge pull request #26 from ambitioninc/develop
Browse files Browse the repository at this point in the history
Functional interface for manager utils
  • Loading branch information
wesleykendall committed May 23, 2014
2 parents 88264aa + b93e818 commit 814cb51
Show file tree
Hide file tree
Showing 6 changed files with 329 additions and 309 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
include manager_utils/VERSION
include README.md
include LICENSE
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ django-manager-utils

Additional utilities for Django model managers.

## A Brief Overview
# A Brief Overview
Django manager utils allows a user to perform various functions not natively supported by Django's model managers. To use the manager in your Django models, do:

from manager_utils import ManagerUtilsManager
Expand Down Expand Up @@ -225,5 +225,15 @@ A signal that is emitted at the end of a bulk operation. The current bulk operat
TestModel.objects.all().update(int_field=1)
<type 'TestModel'>

## License
# Calling Manager Utils as Standalone Functions
All of the main manager utils functions listed can also be called as standalone functions so that third-party managers can take advantage of them. For example:

```python
from manager_utils import bulk_update


bulk_update(TestModel.objects, [model_obj1, model_obj2], ['int_field', 'float_field'])
```

# License
MIT License (See the LICENSE file included in this repository)
1 change: 0 additions & 1 deletion manager_utils/VERSION

This file was deleted.

5 changes: 4 additions & 1 deletion manager_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# flake8: noqa
from .version import __version__
from .manager_utils import ManagerUtilsMixin, ManagerUtilsManager, ManagerUtilsQuerySet, post_bulk_operation
from .manager_utils import (
ManagerUtilsMixin, ManagerUtilsManager, ManagerUtilsQuerySet, post_bulk_operation,
upsert, bulk_update, single, get_or_none, bulk_upsert, id_dict
)
Loading

0 comments on commit 814cb51

Please sign in to comment.