Django Fixtures and Dumping Test Data

I do quite a bit of work with the Python based Django framework.  Django is a flexible framework that leverages the Python programming language.  A typical development scenario for development using Django involves writing models and/or views then running unit tests to see if these changes break the application.  If you create test data for the unit tests using Django’s fixtures then you might have used Django’s “manage.py dumpdata” to export test and development data to one of your application’s fixtures.  If you have used the dumpdata command then you may be experience an error message when running the unit tests that indicates a primary key error when loading “contenttypes”.  The unit tests will run, but this warning can be troublesome.  There is a simple solution. When using dumpdata specify the “-e contenttypes” switch to exclude the “contenttypes” model.  I also suggest specifying “-e contenttypes -e auth”.  This should eliminate the primary key error or warning message when you run the unit test.

Refer to this link for more information.

Posted in Django, Python | Tagged , , | Leave a comment

Ecosystem Web Services

Over the last few months I’ve been volunteering some of my time to develop web services that deliver geospatial data for eco-systems. My eco-system web services help support the AFS Standard Methods for Sampling North American Fishes website. The initial version of the eco-services site can be found here. Right now the eco-services site only provides level 1 eco-region data as described here. The eco-service is accessed through a REST and JSONP call. Future enhancements are on the horizon.

Posted in Uncategorized | Tagged , , , , , , , , , , | Leave a comment

Grails 2.0 – PostgreSQL

I’ve been working on a Grails 2.0 app that uses PostgreSQL as the back-end db. One of the tables I have been designing is a Users table, which I named “user”. PostgreSQL doesn’t seem to like “User” as a table name, at least not in the context of the Grails/Hibernate sql generation tools. Consequently, in the domain model for the User class I had to set the table name to something other than “user”. In the model’s Groovy class I set the following:


static mapping = { table "tblUser" }

Posted in Uncategorized | Tagged , , | Leave a comment

HTML Output from Rails Helper

In order to render html returned from a Rails (3) helper the returning string should have the .safe_html method. Here is an example:

def my_custom_tag
html = ''
html Hello'
html.safe_html
end

 

Posted in Uncategorized | Tagged , , | Leave a comment

Moving Window Between Monitors in Windows (7)

If using a laptop connected to an external monitor and an application window is displaying on one monitor, but you want it on another you can press SHIFT + WINDOW + LEFT/RIGHT ARROW to move the window between monitors.

 

Posted in Uncategorized | Tagged | Leave a comment

OGR2GUI – GUI Tool for Ogr2Ogr

Inventis has a nice windows based GUI tool for manipulating spatial data using Ogr2Ogr.

http://www.ogr2gui.ca/en/index.php

 

Posted in Uncategorized | Tagged , | Leave a comment

Interesting Blog Article on Web Fonts

Posted in Uncategorized | Tagged , | Leave a comment

Web Safe Fonts

Posted in Uncategorized | Tagged , | Leave a comment

Displaying Google Fonts on Drupal Site

Posted in Uncategorized | Tagged , , , | Leave a comment

Google Web Fonts

Web page for google web fonts.

http://code.google.com/apis/webfonts/

Posted in CSS, Drupal, HTML, Javascript, Programming | Tagged , , , | Leave a comment