My first looks into Savoy
Sunday, 14th September, 2008 // 10:08 p.m.In case you have not heard of Savoy. It is a framework(set of reusable apps infact) which runs jeffcroft
I was lucky enough to be invited by jeffcroft to beta test savoy. Here are a few quick facts regarding savoy. Savoy is basically divided into 2 categories:
Core - All the core apps which should be installed
Contrib - All the optional apps which can be installed
Why should all the core apps be installed?
Simple because they have a lot of dependencies among themselves. For Eg. there is an app 'media' which contains models 'Photo', 'FlickrPhoto' etc. Every Photo has a foreign key to Person model in people app and every Person has a foreign key to Place which is a other model in 'geo' app. Rather than identifying the dependencies among these model have a look at this database dependency diagram. Dont freak out by looking at the diagram its only 75% of the apps in Savoy. There's even more!!!
Another app I loved the most is 'Pages'. You can think if it as an extended 'FlatPages' app. You can choose your own markup, template, photos, primary and secondary content.
Contrib is set of optional apps which may/ may not be used. It consists of apps like blogs, comments, bookmarks, events, code_snippets, podcasts, search(based on djangosearch), aggregator, statuses(tweets), etc. These are the apps that drives jeffcroft.com. I particularly think the geocoding is soo cool. Lets take a look at this photo which is geocoded and shown on a google map. Even cool is it shows the nearby places to that location and how far is it.
Very nice use of urbanmapping neighbourhoood api which grabs all the nearby locations which are in your database. When a new photo is created through a cronjob, it checks if the photo owner is present in people model, if not create it, syncs location data for a photo, if it doesn't exists it creates a place as well and that's how all the dependencies are satisfied. I was trying to do similar functionality for the Brightkite like app I wrote. However I adopted a different mechanism for that.
Comments, they sure deserve a special mention. You have the ability to blacklist comments basing on Name, EmailAddress, Url. This way we can prevent spam from blacklisting some common keywords. Has support for Akismet spam detection. You can whitelist some Emails and Url's and skip spam check on them. Almost all the models written for Savoy have Model Managers where we can filter querysets basing on various conditions. This makes it easy to work with Savoy.
Search is a very cool app. All you need to do is set the Models which needs to be searched in the settings.py.
SEARCH_MODELS = [ { 'model': 'blogs.entry', 'fields': ['title', 'tags'], 'manager': 'live_entries', }, { 'model': 'bookmarks.bookmark', 'fields': ['title', 'tags'], }, ]
Looks so simple right. We just mention the app.model and specify the attributes on which search should work on. If there is a model manager which performs a certain query like Live posts in a blog app, we can pass the manager as well. If it is not provided it takes the default Model.objects.all(). To know more regarding this search check out djangosearch.
Hmm, I hope I covered some the cool features of Savoy.
To put it all togeather Savoy can be considered as a sub-framework which needs to be put on python-path where we can import the required apps and overwrite some functionalities to match our requirements.
Watch out for it.
Comment Form
4 comments:
001// Joseph// Monday, 15th September, 2008, 8:54 a.m.
This is an interesting project. With the Django maturing, I'm sure lots of such sub-frameworks will be built which will bring in lots of possibilities for the end-users.
002// yashh// Tuesday, 16th September, 2008, 8:58 a.m.
@Joseph You are right. I think in an year or two there will be django apps for every possible niche. Proud to be a part of the community..
003// Edward// Thursday, 18th September, 2008, 9:16 p.m.
When is savoy going be to be released?
004// Yashh// Thursday, 18th September, 2008, 10:10 p.m.
@Edward I think it would take a while. Currently we are beta testing the savoy framework. Keep checking this blog, I will keep you updated.