Make Tastypie Respect blank=False

More Tastypie pain, documented in several issues. Tastypie's blank attribute simply doesn't work. Add this to your Resource as a workaround:

class MyResource(ModelResource):
    # Workaround for this issue:
    def hydrate(self, bundle):
        for field_name, field_obj in self.fields.items():
            if field_name == 'resource_uri':
            if not field_obj.blank and not
                raise ApiFieldError("The '%s' field has no data and doesn't allow a default or null value." % field_name)
        return bundle