Login

Snippets by chrj

Snippet List

Serializing booleans correctly when doing dumpdata from a MySQL database using Django 0.96

Django 0.96 seems to have a bug when serializing from MySQL. BooleanFields are encoding as 0/1 instead of true/false. Hacking the python serializer seems to fix that. The bug shows up as (fx. when using loaddata on a dump from MySQL in PostgreSQL): Problem installing fixture '/tmp/data.json': ERROR: column "is_staff" is of type boolean but expression is of type integer HINT: You will need to rewrite or cast the expression.

  • dumpdata
  • 0.96
  • seralization
Read More

WTForm (What The Form)

WTForm is an extension to the django newforms library allowing the developer, in a very flexible way, to layout the form fields using fieldsets and columns WTForm was built with the well-documented [YUI Grid CSS](http://developer.yahoo.com/yui/grids/) in mind when rendering the columns and fields. This should make it easy to implement WTForm in your own applications. Here is an image of an [example form rendered with WTForm](http://www.gmta.info/files/wtform.png).

  • newforms
  • html
  • css
  • fieldset
  • form
  • yui
  • rendering
  • grid
  • columns
  • layout
Read More
Author: chrj
  • 23
  • 101

chrj has posted 3 snippets.