Skip to content

Commit 8687b13

Browse files
authored
Merge pull request #8 from novafloss/update-readme
Update README.rst + Add License Reviewed by @aRkadeFR.
2 parents 3a8c32f + 98954a3 commit 8687b13

File tree

2 files changed

+44
-11
lines changed

2 files changed

+44
-11
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 PeopleDoc
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.rst

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,51 @@
1+
================
12
django-chunkator
23
================
34

45

5-
Chunk large querysetsinto small chunks, and iterate over them without killing
6+
Chunk large QuerySets into small chunks, and iterate over them without killing
67
your RAM.
78

89
.. image:: https://travis-ci.org/novafloss/django-chunkator.svg
910

10-
Usage::
11+
Usage
12+
=====
13+
14+
.. code:: python
1115
1216
from chunkator import chunkator
1317
for item in chunkator(LargeModel.objects.all(), 200):
1418
do_something(item)
1519
1620
This tool is intended to work on Django querysets.
17-
Your model **must** define a pk field (this is done by default, but sometimes
18-
it can be overridden) and this pk has to be unique. ``django-chunkator`` has
19-
been tested with Postgresql and SQLite, using regular PKs and UUIDs as primary
20-
keys.
2121

22-
You can also use ``values()``::
22+
Your model **must** define a ``pk`` field (this is done by default, but
23+
sometimes it can be overridden) and this pk has to be unique. ``django-
24+
chunkator`` has been tested with PostgreSQL and SQLite, using regular PKs and
25+
UUIDs as primary keys.
26+
27+
You can also use ``values()``:
28+
29+
.. code:: python
2330
2431
from chunkator import chunkator
2532
for item in chunkator(LargeModel.objects.values('pk', 'name'), 200):
2633
do_something(item)
2734
2835
.. important::
2936

30-
If you're using ``values`` you **have** to add at least your "pk" field to
31-
the values, otherwise, the chunkator will throw a `MissingPkFieldException`.
32-
33-
----
37+
If you're using ``values()`` you **have** to add at least your "pk" field
38+
to the values, otherwise, the chunkator will throw a
39+
``MissingPkFieldException``.
3440

3541
.. warning::
3642

3743
This will not **accelerate** your process. Instead of having one BIG query,
3844
you'll have several small queries. This will save your RAM instead, because
3945
you'll not load a huge queryset result before looping on it.
46+
47+
48+
License
49+
=======
50+
51+
MIT License.

0 commit comments

Comments
 (0)