Skip to content

Instantly share code, notes, and snippets.

@imsickofmaps
Created December 5, 2013 12:18
Show Gist options
  • Select an option

  • Save imsickofmaps/7804326 to your computer and use it in GitHub Desktop.

Select an option

Save imsickofmaps/7804326 to your computer and use it in GitHub Desktop.
self.get_farmer = function(username) {
var p = self.api_call("farmer/", {
actor__user__username: username
});
p.add_callback(function(result){
if (result.objects.length === 0){
return null;
} else {
return result.objects[0];
}
});
return p;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment