Empty Thoughts - Home: Vim Macros Screencast
1 Recommend

My good friend Justin Lilly just posted a great short screencast on using Vim macros. In the screencast he walks you through using the Vim macro commands to record and play back key sequences. Justin, several other friends, and I have been helping each other get the most out of MacVim. I highly recommend you take one minute and give it a viewing.

Since I forgot to blog about it earlier he has also created a excellent post on his Vim setup called Vim: My new IDE. If you’re into Vim or want to get going on it, this post contains an awesome collection of stuff that Justin has found useful.

Ryan Berg's blog: Ryan Berg: The basics of creating a tumblelog with Django
1 Recommend 7 Inbound
On my new homepage, a combined list of my tweets, bookmarks, and user comments on my site appear underneath my latest blog entries. I use a fun bit of Django code to pull these various items together, sorted by publication date, and I'd like to share how this bit of tumblelog-like functionality works.
Published 2 months ago Link Short Link
Eric Florenzano's Blog: [Link] git-issues: A distributed issue tracker built-in to Git.
1 Recommend 1 Inbound

I predicted this back in March--can't believe a solution has surfaced so soon. It makes so much sense to build in an issue tracker to a revision control system. Since you're working with the code, might as well track the issues in the same system and take advantage of the extra metadata. This is really cool (and as a bonus, it's written in Python) so I hope to see it really grow and flourish!

Comment at Eric Florenzano's Blog Published about 1 month ago Link Short Link
Empty Thoughts - Home: This Week in Django 17 - 2008-04-06

This Week in Django is a weekly podcast about all things Django.

This week we talk about EuroPython 2008, some cool posts and projects from the community, the Tip of the Week, and a question from the IRC.

Plus, we are fortunate to have a special appearance by Mike Axiak to discuss streaming uploads and ticket 2070.

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (45.3 MB, 55:54, AAC)

MP3 Edition (38.4 MB, 55:54, MP3)

OGG Edition (30.5 MB, 55:54, Vorbis)

The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.

Feeds Available

iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.

iTunes Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

Regular RSS Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

This Week in Django – OGG Edition

Give Us Feedback

Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__ thisweekindjango.com.

Show Notes

Big News (1:01)

  • EuroPython 2008 – To be held in Vilnius, Lithuania from Monday July 7th – Saturday July 12th. No Django sprint officially announced as of yet.

Tracking Trunk (3:55)

  • Quite a few interesting changes in the GIS branch.
  • Thank you to all the translators
  • We’re working on an i18N show

Community Catchup (7:37)

  • Refactoring the DocumentationJacob Kaplan-Moss posted to the Django-Developers discussion list that he is doing a ton of work to refactor the Django documentation structure, breaking it up based on stakeholders.
    • Sphinx – excellent Python documentation generator
  • Streaming Uploads DiscussionMike Axiak started a great discussion on some work he’s doing to handle streaming uploads. It’s been a very active discussion thread. I know that Mike is spending a ton of time working on this along with Ticket 2070 as he’s hanging out in IRC all hours of the day and night.
  • json_encode – a great JSON encoding module by Wolfram Kriesing which he states is improved and simplified. If you are doing AJAX work you should really check this out.
  • DjangoFriendly – is a community resource for finding the friendliest Django hosting environments. Designed and developed by Ryan Berg.
  • Django Djblets – The Review Board team abstracted a set of useful helpers. Included are Authentication improvements, Flexible datagrids, Decorators, Caching functions, and Unit testing utility classes.
    • Clarification, in the show I said decorators for doing tagging, what I meant was decorator for doing a template tag. See the docs.

Tip of the Week (42:21)

  • Last week’s Tip came from Alex Gaynor. Apologies for not mentioning it.

This week’s tip is for users of the newforms-admin branch. Even if you are not using newforms-admin, this might be something to make you look at newforms-admin or just keep in the back of your mind once it is merged into trunk.

It is very possible to define your own form for both the main form and any inlines. A FormSet class is used to make inlines work which is simply some abstraction to using more than one form around some data.



# your ModelForm (probably in forms.py)
class AdminPostForm(forms.ModelForm):

    class Meta:
        model = Post

    def clean_title(self):
        value = self.cleaned_data.get("title")
        # custom validation with value here
        return value

# your ModelAdmin (probably in admin.py)
class PostAdmin(admin.ModelAdmin):
    form = AdminPostForm
admin.site.register(Post, PostAdmin)

# your model
class Post(models.Model):
    title = models.CharField(max_length=100)
    body = models.TextField()

IRC Ad Nauseam (46:41)

Django IRC FAQ

Backwards Incompatible Changes Information

  • DjangoBot Updates
    • Fixed the Time Zone bug caused by configuring settings manually because it doesn’t set the environment correctly.
    • Corrected caching problems by using file-based caching.
    • Urlize filter is very slow as detected by hotshot
    • Eric Florenzano is working on an optimized version. For more information on Eric listen to our interview with him on This Week in Django 11.

I just created a post for my new blog but the post is not showing up for about an hour. I’m using a date-based generic view. Is there some kind of caching going on?

It is possible that you have not set your time zone information appropriately in your settings file.

Thank You! (54:30)

Empty Thoughts - Home: This Week in Django 19 - 2008-04-20

This Week in Django is a weekly podcast about all things Django.

SPECIAL FEATURE – Internationalisation

This is the first part of a two part series on Internationalisation. This week we are privileged to talk to Malcolm Tredinnick, Django core developer. Malcolm educates us on what internationalisation is all about, how it is implemented in Django, and some of the areas that can be improved in the future.

Additionally, we also discuss a lot of changesets in the Queryset Refactor Branch, and a couple of blog posts from the Django community.

It is our longest show yet, but definitely worth your attention. This is a must listen podcast.

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (79.3 MB, 1:41:32, AAC)

MP3 Edition (69.8 MB, 1:41:32, MP3)

OGG Edition (56.8 MB, 1:41:32, Vorbis)

The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.

Feeds Available

iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.

iTunes Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

Regular RSS Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

This Week in Django – OGG Edition

Give Us Feedback

Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__ thisweekindjango.com.

Show Notes

Special Feature – Internationalization (1:39)

Malcolm Tredinnick, Django core developer, joins us to discuss internationalisation. Malcolm has often played the role of expert on internationalization / localization issues, speaks several languages, and works closely with the Django translators.

To learn more about Malcolm Tredinnick, be sure to add his blog, Defying Classification, to your RSS feeds and listen to our interview with Malcolm on This Week in Django 13

  • What is the difference between internationalisation and localisation?
  • Python 3.0 will feature full unicode support. What does that mean for Django? Will there be any benefits?
  • I attended a discussion by Tim Bray, who I suppose is a recognized internationalisation expert, and by the end of the discussion I felt like the idea of creating truly internationlised applications is somewhat hopeless. What are your thoughts about this?
  • How does translation support appear to the end-user in something like Django? (how they set which language to use, what Django does, etc).
  • Justin Lilly, a Django user and rabid fan of the show, wanted to ask, “I’m curious how many different ways there are to declare gettext-like things.. ugettext, gettext, (as a commonly used alias).. any more I don’t know?” So what about it? What’s the differences?
  • What is the difference between unicode and utf-8? Is there a difference?
  • What sort of things do developers need to watch out for when writing code for an international audience?
  • What can we do to improve the support in third-party applications for Internationalisation?
    • People learn differently so maybe we need to explore as many ways as possible to educate people. We can use things like tutorials or screencasts.
    • James Bennett’s apps are internationalised.
  • Goal is to get Django to pass the Turkey test yet, but it’s a goal.
  • How do you handle sorting in Django?

Tracking Trunk (59:37)

  • Updated Markdown Filter to Support v1.7 (7423) – From the mailing list, “Additionally, the encoding argument has been removed from both markdown and Markdown. Markdown expects unicode (or ascii) input and it is the users responsibility to ensure that’s what is provided. Therefore, all output is in unicode. Only markdownFromFile accepts an encoding.”

Branching & Merging (1:01:57)

Community Catchup (1:24:12)

  • The limits of Django – Interesting post by Alberto García Hierro where he discusses the process he used to optimize queries. His final solution ended up being a C library. The post received tons of interest and he provided a followup, The limits of Django: the answers, where he addresses some of the questions he received.

Thank You! (1:38:43)

Empty Thoughts - Home: This Week in Django 24 - 2008-06-01

This Week in Django is a weekly podcast about all things Django.

This week Eric Florenzano fills in while Michael is out. We talk to James Tauber about who he is and what Pinax is. A few trunk changes and some community bits.

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (32.7 MB, 44:47, AAC)

MP3 Edition (41.7 MB, 44:47, MP3)

OGG Edition (53.7 MB, 44:47, Vorbis)

The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.

Quick note, Brian Rosner did the audio in Michael’s absence. Its not as good as what Michael produces, but he is getting better with it :)

Feeds Available

iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.

iTunes Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

Regular RSS Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

This Week in Django – OGG Edition

Give Us Feedback

Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__ thisweekindjango.com.

Show Notes

Big News (0:25)

We’re back! Apologizes for last week’s cancellation. Michael’s wife gave birth to their 2nd child, Lucas Matthew Trier. Welcome to the world, Lucas!

James Tauber Interview (1:12)

  • James is the CTO at US-based startup mValent.
    • Tell us a little about mValent? Is Django involved?
  • How did you come to find and use Django?

Tracking Trunk (31:51)

Community Catchup (35:09)

  • sleepy-django – Sleepy, allows you to create a static site by rendering Django templates to HTML.

Thank You! (39:08)

  • Special thanks to Brian Rosner for handling the show production this week. You did an awesome job man.
Empty Thoughts - Home: This Week in Django 20 - 2008-04-27

This Week in Django is a weekly podcast about all things Django. This week’s show is a huge show with lots of great features.

This is the second part of a two part series on Internationalisation. This week we are privileged to talk to Marc Garcia, Django’s Catalan translator, among many other things. Marc discusses the localisation side of things, helping us understand what’s required to get your web site localised.

Additionally, we also talk about QuerySet Refactor branch having been merged to trunk.

Finally, we have a special full length song by Django’s own Adrian Holovaty. It’s amazingly beautiful, so I encourage you to stay tuned for it.

Note: We apologize for the occasional audio drops during the interview with Marc Garcia. That’s just how these things go when calling across the globe.

Also, We’ve modified the compression scheme a bit, so let us know if the sound is better or worse.

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (57.5 MB, 1:12:02, AAC)

MP3 Edition (49.5 MB, 1:12:02, MP3)

OGG Edition (38.5 MB, 1:12:02, Vorbis)

The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.

Feeds Available

iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.

iTunes Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

Regular RSS Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

This Week in Django – OGG Edition

Give Us Feedback

Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__ thisweekindjango.com.

Show Notes

Big News (0:55)

QuerySet-Refactor Branch Merged!

As Malcolm Tredinnick mentioned on last week’s show, the Queryset-Refactor branch has been merged into trunk. Changeset 7477 makes that happen.

Over the past several months we have giving you a lot of information on the changes that contained in the Queryset Refactor modifications. We plan to get into those things more in next weeks show.

Adrian Holovaty Special Song

At the end of the program we will be presenting a special song by Adrian Holovaty. So stay tuned for that.

Special Feature – Localisation (5:21)

This week we are honored to be able to speak with Marc Garcia. Marc is the founder and CTO of Accopensys, a software development solutions company. Marc also maintains a blog called the The Best of Marc Garcia.

Marc has also been heavily involved in doing:

  • many translations on Catalan and Spanish languages,
  • main development of Spanish localflavor,
  • development of Transdb (http://code.google.com/p/transdb/) that allows Django field translations on database, and
  • development of some small multilanguage web sites using Django

On last week’s program Malcolm Tredinnick gave us some great information on internationalisation. This week we are going to get into localisation, which as I understand it is the process of translating a product into different languages or adapting a language for a specific country or region.

Translating Django

  • Let us start off with looking at translating Django itself. What is the process involved for localising Django internals?
  • What specific language elements cause you problems? Malcolm had touched on difficulty with pluralisation. Would you comment on that and possibly other areas that present special challenges?
  • What sort of resources are available to translators?
  • In the area of translating Django, are there specific changes that you feel should be made in order to make the whole process better and easier for translators?
  • Last week we discussed some problems with Django documentation and slang that is used, etc… causing problems for getting things translated. What perspective do you have about this?

Translating Websites

  • There’s two template tags, trans and blocktrans for translating strings in the template. What is the difference between the two and how would you decide to use one or the other?
  • What about translating database content? How is that achieved?
  • I recently ran across the django-rosetta project on google code. It is a very impressive admin screen for doing translation. Have you used this project? Are there any similar types of tools to assist translators?
    • Poedit – a cross-platform gettext catalogs (.po files) editor.
    • Msgfmt – a Unix utility that creates message object files from portable object files.

Miscellaneous

  • Anything else that we didn’t cover that you would like to mention?

Community Catchup (48:49)

Thank You! (1:05:50)

Special Song by Adrian Holovaty

Radiohead is holding a “contest” called Radiohead Remix, in which they’re inviting fans to remix the song called “Nude” from their latest album. They’ve released the raw tracks and are encouraging people to remix the tracks to create something different.

So Adrian sat down and did his own jazzy acoustic mix, and we asked him if we could play it for the show. His remix is called “Nude (jazzy acoustic),” and if you like it, please vote for it.

More Information

Keep track of Brian Rosner at his website

Empty Thoughts - Home: This Week in Django 21 - 2008-05-04

This Week in Django is a weekly podcast about all things Django.

This week we have a couple of special guests. First, Eric Florenzano joins us for most of the show, and provides special insight into a few conversation items. Secondly we privileged to have Francis Cleary on the program to discuss a couple Tip of the Week items. We also cover all the regular stuff plus stream the program live on ustream.

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (33.2 MB, 1:01:14, AAC)

MP3 Edition (42.1 MB, 1:01:14, MP3)

OGG Edition (31.9 MB, 1:01:14, Vorbis)

The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.

Feeds Available

iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.

iTunes Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

Regular RSS Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

This Week in Django – OGG Edition

Give Us Feedback

Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__ thisweekindjango.com.

Show Notes

Tracking Trunk (2:50)

Branching & Merging (8:53)

Community Catchup (19:38)

  • Django l10n – Marc Garcia, who was on last week’s show provides a followup post that does a great job of pulling together the information we discussed as well as stuff we did not get time to cover.

Tip of the Week (36:16)

Francis Cleary is on the show with us this week to present his tip that he entered in the Win Cool Stuff Contest and was our grand prize winner.

Multiple view prefixes

Rather then have complex and long urls like so


urlpatterns += patterns('',
   (r'^$', 'mySite.Project.views.mainpage' ),
   (r'^custom/view/$', 'mySite.Project.views.'view_function'),
   (r'^lookup/tag/(?P<tag>\w+)/$', 'mySite.Project.views.tag_list'),
   (r'^users/$' , 'django.views.generic.list_detail.object_list', user_dict),
   (r'^recent/$','django.views.generic.list_detail.object_list', all_dict),
   (r^text/$', 'django.views.generic.date_based.object_detail', object_dict),
)

Take advantage of the first argument to the patterns() function to specify a prefix to apply to each view function. just make sure you have the += not just =.


urlpatterns += patterns('mySite.Project.views',
   (r'^$', 'mainpage'),
   (r'^custom/view/$', 'view_function'),
   (r'^lookup/tag/(?P<tag>\w+)/$', 'tag_list'),
)

urlpatterns += patterns('django.views.generic',
   (r'^users/$' , 'list_detail.object_list', user_dict),
   (r'^recent/$', 'list_detail.object_list', all_dict),
   (r'^(?P<year>\d{4})/$', 'date_based.archive_year', object_dict),
)

Advanced Generic Views

If you don’t want your urls.py filling up with dictionary or would like to do more complicated filtering or extra work to a list. Define view functions that return your generic view and dictionary.

In this example from the Django Book. We will use a generic view to display an author but we want to update the last_accessed data.


urls.py

from mysite.books.views import author_detail

urlpatterns = patterns('',
   #...
   (r'^authors/(?P<author_id>d+)/$', author_detail),
)

views.py

import datetime
from mysite.books.models import Author
from django.views.generic import list_detail
from django.shortcuts import get_object_or_404

def author_detail(request, author_id):
   # Look up the Author (and raise a 404 if she's not found)
   author = get_object_or_404(Author, pk=author_id)

   # Record the last accessed date
   author.last_accessed = datetime.datetime.now()
   author.save()

   # Show the detail page
   return list_detail.object_detail(
       request,
       queryset = Author.objects.all(),
       object_id = author_id,
   )

Rather then calling the generic view from the urls.py you can once again see how uncoupled things are in django and just return the generic view from your own wrapped view.

  • Are you generic? – Great earlier post by Wilson Miner on using Generic Views for non-programmers.

IRC Ad Nauseam (45:33)

Django IRC FAQ

Backwards Incompatible Changes Information

  • We have discussed the changes to the Paginator that occured during the PyCon 2008 sprints, but we are still seeing people tripping up over it. Paginator originally worked only on QuerySets, but has now been abstracted out. Paginiator is now generalized enough to work on lists. This is the reason for QuerySetPaginator. It special cases certain things to prevent performing the wrong operation on the QuerySet.

>>> from cameras.models import CameraImage
>>> CameraImage.objects.all().count()
248788L
>>> from django.core.paginator import Paginator 
>>> paginator = Paginator( CameraImage.objects.all(), 48, True)
>>> import time;start=time.time(); page = paginator.page(50); print time.time()-start
17.4773068428

Some questions about general IRC

We get lots of questions about IRC in general, so maybe a few little tidbits here and there:

Why don’t you use manners? When I say Thank You, you don’t respond.

Okay here’s the deal, there’s no reason to increase the noise level on IRC. That means although we appreciate the thanks, often we will not acknowledge it. So don’t take it personally.

I asked a question and no one responded. Why is that?

People will answer if they know. You can re-ask but please wait a bit. Don’t use the #django-dev channel, that’s the wrong thing to do.

It might be good to think about how you can rephrase the question.

Use the Django-Users Mailing list. It’s another avenue available.

Can anyone help with a NewForms-Admin Question?

Don’t ask to ask. Just ask straight away. It depends often on the area of the question. So it’s best to just ask your question.

Will “blank” work?

Try it. Often the best thing to do is try it. That’s what anyone will end up doing.

Couple other tips, read the FAQ, Backwards Incompatible Changes, and the Freenode FAQ.

Thank You! (58:20)

Empty Thoughts - Home: This Week in Django 18 - 2008-04-13

This Week in Django is a weekly podcast about all things Django.

This week we talk about Google App Engine, some changes to the QuerySet Refactor branch, the documentation refactor sprint, some cool projects from the community, the Tip of the Week, and a question from the IRC.

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (31.0 MB, 52:51, AAC)

MP3 Edition (36.3 MB, 52:51, MP3)

OGG Edition (29.0 MB, 52:51, Vorbis)

The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.

Feeds Available

iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.

iTunes Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

Regular RSS Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

This Week in Django – OGG Edition

Give Us Feedback

Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__ thisweekindjango.com.

Show Notes

Big News (1:23)

Tracking Trunk (14:55)

Branching & Merging (16:40)

Community Catchup (24:14)

  • Minor Correction – The Django book