changes to scaffold.py to ensure compatibility with 1.5

Modified as per Django 1.5 requirements. Recommended.