Skip to content

Commit 9b699c5

Browse files
committed
Updated readme, and added MIT license
1 parent 82bb511 commit 9b699c5

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2010 Ben Dowling
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
13+
all 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
21+
THE SOFTWARE.

README

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ the way in which it gets cleaned up.
88

99
Includes 234 counties, 2,610 regions, 97,949 cities and 606 districts
1010

11+
For more information and examples see http://www.coderholic.com/django-cities-countries-regions-cities-and-districts-for-django/
12+
1113
Examples:
1214
=========
1315
Finding all London boroughs:
1416

1517
>>> london = City.objects.filter(country__name='United Kingdom').get(name='London')
16-
>>> boroughs = Districts.objects.filter(city=london)
18+
>>> boroughs = District.objects.filter(city=london)
1719

1820
Nearest city to a given lat,lon:
1921

@@ -23,4 +25,4 @@ Nearest city to a given lat,lon:
2325
5 Nearest cities to London:
2426

2527
>>> london = City.objects.filter(country__name='United Kingdom').get(name='London')
26-
>>> nearest = City.objects.distance(london.location).exclude(id=london.id).orderby('distance')[:5]
28+
>>> nearest = City.objects.distance(london.location).exclude(id=london.id).order_by('distance')[:5]

0 commit comments

Comments
 (0)