At the Rocky, we were beginning to create a number of geographically oriented applications (see our Holiday Lights). Lucky for us, GeoDjango had been recently rolled into the official release of Django. By simply installing the PostGIS extension to PostgreSQL, we had built-in geographic proximity search and much more. Here’s a sample that finds all addresses within 5 miles of the current address:
nearby = Address.objects.filter( point__dwithin=(self.point, D(mi=5)) ).exclude( id=self.id )
if len(nearby) > 0:
raise SomeException('Uh Oh...')
This type of feature not only makes it easy to find people who live near each other (presumably by small-group staff), it allows for improving data quality. When storing an address in the database, you can check to see if there is a likely duplicate (i.e. an address that is within a meter or so of another address) and prompt the user for an override if necessary. I have built this into Sheepology.
Something I have always been interested in is AI and natural language processing. So I was somewhat interested in making searches more fault tolerant. One problem we had at Crossroads was that we ended up with a lot of duplicate people in our database because searches failed. I wanted to improve the situation. I did a little reasearch and discovered an algorithm called soundex. While many databases have this built in, they do it on the fly, so doing a search becomes very slow. I decided to simply make an extra field that contained the soundex codes for people’s names. This way I am able to index the field and make the search fast. Python has a module called AdvaS that has the soundex algorithm and several other similar algorithms. So in just a couple lines of code I was able to have phonetic search. Try it in the demo if you want. Search for bryan and you’ll find brian as well. Or search for sherri and you’ll still find shari. In the main settings file you can choose your phonetic algorithm, but it defaults to soundex.
There is also a nice tagging module available for Django. It was remarkably easy for me to plunk this in and magically have tagging enabled on models I chose. In about 5 lines in my template I was able to create a tag cloud.
I had originally decided to develop my own UI for Sheepology, but decided to work on building the basic models first. What I found is that the built-in Django admin facilities are so extensible, that I may stick with the built-in admin rather than building a UI from scratch. I also added the Grappelli theme to jazz it up a bit. While I’d like to take credit for the look of the admin, for the most part it is a packaged theme designed by someone else.
What I have found with Django and Sheepology is that I am most effective as a systems integrator. While I have written a fair amount of custom code, what I am really doing is tying together a number of different open-source pieces to make a whole package. I can focus on my area of expertise (i.e. churchy stuff) and worry less about details.
I was able to build what you see as a one-man team in about 2 months. What I see down the road is nearly limitless. There are a number of Django open-source packages for doing such things as content management or accounting that could potentially be integrated into Sheepology for a comprehensive ChMS package.
On the immediate horizon I will be working on a graphical group hierarchy tool. I also see a need for an inventory tracker (portable churches desparately need this) and contact management.