Monday, August 25, 2008

This Week in Django 35

with hosts Brian Rosner and Michael Trier

Bookmark and Share

Big News (0:42)

  • TWiD Updates
    • TWiD Shirts Available – check them out, let us know what you think. We’ll have a supply of them at DjangoCon.
    • We have feeds on the site now and it has been submitted to the Django Community Aggregator.
    • SXSW Podcast Panel – We’re hoping to do a podcast showdown at SXSW. Please vote for our panel to make it all possible. Panel will feature podcasters that will each do a lightning talk revealing how they produce, publicize, and publish their podcasts. We’ll also find out what podcasts they admire and what advice they would pass on to fellow podcasters.
    • Final DjangoCon Slot Filled by TWiD Live – We’re very excited to be able to do the show live at DjangoCon.

Interview – Robert Lofthouse talks about DjangoCon (7:47)

Robert Lofthouse is the Technical Director and co-founder of Siu Design, which is a design/development agency in London. Siu Design uses Python / Django for all of their sites / applications. He’s also the co-founder of DJUGL (Django User Group London) and the Chairman of DjangoCon and EuroDjangoCon, as well as a Django software engineer at GCap.

Tracking Trunk (34:05)

  • GeoDjango Test Runner in Place (8434) – allows users to run tests for GIS apps that require the creation of a spatial database. Modify the TEST_RUNNER setting to point to django.contrib.gis.tests.run_tests.

Community Catchup (45:36)

  • GeoDjango Basic Apps – Simple Django Apps highlighting GeoDjango integration. These projects aim to be a useful starting point for both experienced Django programmers who are new to GIS (Geographical Information Systems), as well as those with some background in mapping but who learn best through tangible examples.
  • django-mailfriend – A very cool reusable app by Jeff Croft that allows you to include an “e-mail this to a friend” link (as seen on many newspaper websites) on any page available via a get_absolute_url.

Tip of the Week (53:48)

Sometimes you need to filter the Change List in the admin based on the user that is logged in. This can be accomplished easily by overriding the queryset method in the ModelAdmin class for your model.


class StoryAdmin(admin.ModelAdmin):
...
    def queryset(self, request):
        qs = super(StoryAdmin, self).queryset(request)
        if not request.user.is_superuser:
            qs = qs.filter(author=request.user)
        return qs

admin.site.register(Story, StoryAdmin)

Note this doesn’t affect the Change View or the Delete View. There is Ticket 7510 that addresses this by causing all the views to use the ModelAdmin queryset.

Thank You! (57:29)

  • Running Time: 1:00:45
  • Download: AAC, MP3, OGG

Comments - 101 people have already said something. Join the discussion.