This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def wrap_view(self, view): | |
@csrf_exempt | |
def wrapper(request, *args, **kwargs): | |
try: | |
...(bunch of standard stuff here)... | |
return response | |
except (BadRequest, ApiFieldError), e: | |
message = e.args[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void) alertBasedOnCode:(int)errorCode message:(NSString*)message | |
{ | |
if (errorCode == 3) { | |
[self showAlertViewWithTitle:@"Authentication" message:message]; | |
LoginViewController* loginVC = [[[LoginViewController alloc] | |
initWithNibName:@"LoginViewController" bundle:nil] autorelease]; | |
[self.navigationController presentModalViewController:loginVC animated:YES]; | |
} | |
else if (errorCode == 12) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name":"jazztpt", | |
"days": | |
[ | |
{ | |
"date":"2011-06-20", | |
"tweets":"18", | |
"mentions":"4", | |
"pm":"2", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST http://oursocialbloggingsite.com/api/article | |
{ | |
"title":"Exciting Blog Post", | |
"text":"To make an exciting post, talk about explosions. It works for Hollywood!" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title":"Food", | |
"articles": | |
[ | |
"/articles/111", | |
"/articles/123" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title":"Food", | |
"articles": | |
[ | |
{ | |
"url":"http://oursocialbloggingsite.com/api/articles/111", | |
"title":"Why Food Is Delicious", | |
"author":"Abe Adams" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"title":"Exciting Blog Post", | |
"text":"To make an exciting post, talk about explosions. Works for Hollywood....", | |
"guid":"9876" | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"guid":"9876", | |
"url":"http://oursocialbloggingsite.com/api/articles/125" | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"users_by_total_hits": | |
[ | |
{ | |
"name":"Betty Black", | |
"total_hits":"1205" | |
}, | |
{ | |
"name":"Abe Adams", | |
"total_hits":"835" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"url":"http://oursocialbloggingsite.com/api/articles/125" | |
} |