excess.org

Ian Ward

Consulting
Generic Consulting Inc.
Software
Urwid 2011-11-28 (1.0.1)
Speedometer 2011-12-08 (2.8)

Writing
Moving to Python 3
2011-02-17

Presentations
Unfortunate Python
2011-12-19
Django 1.1
2009-05-16
Tags

Home

Ian Ward's email:
first name at this domain

wardi on OFTC, freenode and github

Locations of visitors to this page

Articles Tagged “Django” rss icon

Django Widget data flow
Posted on 2011-09-19.

In any web application user data must be translated from HTML form data to native types and database types, and back again. Django web applcations are no different.

The "right way" to handle custom types is to extend Django's widgets, form fields and model fields. However, understanding exactly how these types perform each step of the conversion can be confusing. This post will attempt to explain how the data is converted at each stage and offer some advice about creating custom widgets, form fields and model fields.

This article is based on Django 1.3 and assumes the reader has experience creating and using Django forms, models and validation.

Read More …

Tags: Django Software Python


Arevco Lighting 2011
New Arevco Site Launched link
Posted on 2011-09-06.

The third iteration the Arevco Lighting web site is now up.

The old site was simple HTML and images generated from a script, which I quite liked but wasn't the easiest thing for other people to update. The new site has been professionally skinned and is now running a Django CMS with some custom index code for product pages. I used the following:

I've used Gerbi now for a few public web sites. It's a well designed and usable CMS that is quite easy to extend. It also has good multilingual support that will make translating content as easy as editing the pages.

Tags: Django Ottawa Python


Python on Android, Django Unit Testing at OPAG link
Posted on 2011-05-25.

Ottawa Python Authors Group meeting tomorrow Thursday May 26 at 8p.m. Best of all it's not me talking this time!

Hope you can make it out.

Tags: Django Ottawa Software Python OPAG


Django Hides (some) Widget Exceptions link
Posted on 2010-12-13.

If you write any custom Django widgets or admin list_display callable functions you have probably run into this: Everything looks ok, except the place where your widget should be is just blank. Nothing. No traceback or any clue as to what went wrong.

It seems that Django suppresses all the exceptions sent by widgets rendering except for AssertionError and TypeError. Debugging under those conditions is tricky, so I wrote a function decorator to help. Just import this and put @assert_on_exception before your render method or admin list_display callable function:

def assert_on_exception(fn):
    import sys
    def wrap(*args, **kwargs):
        try:
            return fn(*args, **kwargs)
        except (AssertionError, TypeError):
            raise
        except:
            assert 0, sys.exc_info()[0].__name__ + ": " + str(sys.exc_info()[1])
    wrap.__name__ = fn.__name__
    wrap.__dict__.update(fn.__dict__)
    wrap.__doc__ = fn.__doc__
    wrap.__module__ = fn.__module__
    return wrap

Tags: Django Software Python


Non-trivial Django Forms slide
Posted on 2010-04-16.

This is the text from the Nontrivial Django Forms talk I gave last Tuesday at the April meeting of the Ottawa Python Authors Group.

This talk starts where the Django forms documentation leaves off.

Read More …

Tags: Django Ottawa Software Python OPAG


Posted on 2009-07-21, last modified 2009-11-19.

Django's forms have fields like models, but you access them in a completely different way. I've found it hard to remember the correct way to access form field data properly, so this is a summary of the things I need to do with forms and how to do them. In particular these are useful in the form's __init__ method after calling super() to set up the form the way you want to.

Read More …

Tags: Django


Ian Ward talking about Django 1.1
Posted on 2009-06-10, last modified 2010-08-29.

This is a video of the Django 1.1 talk I gave last night for the Ottawa Python Authors Group. We were bumped out of our reserved room so I did the talk in the pub. The timing worked out quite well, I just finished answering questions as game 6 was starting in the background.

Thank you to Andrew Ross and FOSSLC for doing the recording and setting everything up.

You will need Flash 10 to hear the audio for this presentation. If you don't like flash, please send a polite note to the ePresence people asking for them to support other formats.

Update: "we got screwed by the company we were dealing with for the software & hosting and the talk is lost" And sorry, I have no back-up either. The text from this talk is still available.

Read More …

Tags: Django Ottawa Software Video Python FOSSLC OPAG


Django 1.1 Talk at Ottawa Python Authors Group link
Posted on 2009-06-07, last modified 2009-06-10.

I will be giving my Django 1.1 talk at The Ottawa Python Authors Group meeting on Tuesday.

UPDATE: A video of my talk is now available

Tags: Django Ottawa Software Python OPAG


Django 1.1 Layers
Posted on 2009-05-16, last modified 2009-05-19.

This is the text from the Django 1.1 talk I gave on Friday May 15 at Algonquin College for FOSSLC's Geocamp/Summercamp 2009.

I have tried to format this in a way that is well suited to skimming and easier to access from the web than reading the original slides. If you find this useful, please let me know.

Read More …

Tags: Django Ottawa Software Python FOSSLC


Django Logo
Django talk at FOSSLC Summercamp/Geocamp 2009 link
Posted on 2009-03-31.

I will be giving an introductory Django talk at The Free and Open Source Software Learning Centre (FOSSLC) Summercamp/Geocamp 2009 Conference. The conference is taking place on May 13, 14, and 15 at Algonquin College, Ottawa, Ontario, Canada, and early bird pricing is available until April 5.

Tags: Django Ottawa Linux Python FOSSLC


« page 1 2 page »