Tuesday, June 17, 2008

Abstract Base Classes vs Model Table Inheritance

by Kevin Fricovsky

With the recent QuerySet-Refactor branch merged into trunk the django developer community is finally gifted with one of the more popular, outstanding ticket requests they've been waiting for... model inheritance. Funny thing is people don't really seem to care, aren't ready to try it yet, or some don't fully grok it yet. Well, that's no good because it promotes code reuse, code reduction, and increases developer productivity. So let's take a look at the three existing options for extending your model classes, take a peek at what's going on in our database, and what type of syntactical sugar (or magic) are we gaining? Then you can make the decision as to which is best for you.

Bookmark and Share

Continue reading… Join the Discussion, 0 people have left comments.

Friday, December 21, 2007

Retrieving Selective Fields with Django

by Michael Trier

Today there was a question on the #django IRC channel from a user name “Joe” about how to go about retrieving selective fields from a table. The issue is that Joe wants to be able to get all Links that are tied to a specific Category but only retrieve select fields. You might want to do something like this if you needed to retrieve a subset of information and you wanted to keep from pulling particularly large fields like BLOBs or Text fields.

Bookmark and Share

Continue reading… Join the Discussion, 2 people have left comments.

Recent Blog Posts view all

  1. Time For a Change

    January 7, 2009 / 21 Comments

    Brian Rosner takes over as host of This Week in Django and joining him will be Eric Florenzano.

  2. This Week in Django Delayed

    January 6, 2009 / 0 Comments

    We're running behind on getting Episode 49 out to everyone.

Incoming Links view all

  1. NEWA Detailed Django Tutorial: Blog Basics Part

    March 30, 2009 / 0 Comments

    Jeff Hui begins what appears to be the first of a lengthy, detailed series in getting your first (blog) Django applicati...

  2. Static Google Map Generator

    March 25, 2009 / 0 Comments

    This isn't a truly pluggable reusable Django app (meaning no Django related code is required, this could be used on any...

Recent Callcast view all

Discussion with Corey Oordt talking OpenSource Washington Times

A conversation with Corey Oordt discussing the new OpenSource Washington Times project and their forthcoming collection of reusable apps, along with greater goals for becoming a platform for Django newspaper/media applications.

Listen now.

Featured Screencasts view all

  1. Django From the Ground Up: Episode 13

    October 29, 2008 / 10 Comments

    Deployment, Part I

  2. Django From the Ground Up: Episode 12

    October 13, 2008 / 7 Comments

    Media and AJAX

Recent Articles view all

  1. Abstract Base Classes vs Model Table Inheritance

    June 17, 2008 / 0 Comments

    With the recent QuerySet-Refactor branch merged into trunk the django developer community is finally gifted with one of the more popular, outstanding ticket requests they've been waiting for... model inheritance.

  2. Retrieving Selective Fields with Django

    December 21, 2007 / 2 Comments

    This article discusses how to retrieve only selective fields instead of everything at once.