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) _queryForQuotes { | |
// #1. Make a query object | |
// #2. Use the service to execute the query | |
// #3. Use a callback block to handle the response | |
GTLQueryMoviequotes* query = [GTLQueryMoviequotes queryForMoviequoteList]; | |
query.order = @"-last_touch_date_time"; | |
query.limit = 30; | |
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; | |
[self.service executeQuery:query |
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) _insertQuote:(GTLMoviequotesMovieQuote*) newQuote { | |
// Make a query object | |
// Use the service to execute the query | |
// Use a callback block to handle the response | |
GTLQueryMoviequotes* query = [GTLQueryMoviequotes queryForMoviequoteInsertWithObject:newQuote]; | |
if (kLocalhostTesting) { | |
query.JSON = newQuote.JSON; | |
query.bodyObject = nil; | |
} |
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) _deleteQuote:(NSString*) entityKeyToDelete { | |
// Make a query object | |
// Use the service to execute the query | |
// Use a callback block to handle the response | |
GTLQueryMoviequotes* query = [GTLQueryMoviequotes queryForMoviequoteDeleteWithEntityKey:entityKeyToDelete]; | |
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; | |
[self.service executeQuery:query completionHandler:^(GTLServiceTicket* ticket, | |
GTLMoviequotesMovieQuote* returnedMovieQuote, | |
NSError* error) { | |
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; |
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
// Within RHDetailViewController.m | |
#pragma mark - Endpoints | |
- (void) _updateQuote { | |
// Make a query object | |
// Use the service to execute the query | |
// Use a callback block to handle the response | |
GTLQueryMoviequotes* query = [GTLQueryMoviequotes queryForMoviequoteInsertWithObject:self.movieQuote]; |
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
#pragma mark - Sign in / sign out utils | |
// Revoke the authorizer and clear the saved authorizer. | |
+ (void) signOut { | |
[GTMOAuth2ViewControllerTouch removeAuthFromKeychainForName:kKeychainItemName]; | |
[GTMOAuth2ViewControllerTouch revokeTokenForGoogleAuthentication:__authorizer]; | |
[RHOAuthUtils _setAuthorizer:nil]; | |
} | |
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) _queryForStudentsWithPageToken:(NSString*) pageToken withCallback:(void (^)()) callback { | |
GTLServiceGraderecorder* service = [RHOAuthUtils getService]; | |
GTLQueryGraderecorder* query = [GTLQueryGraderecorder queryForStudentList]; | |
query.limit = 10; | |
query.pageToken = pageToken; | |
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; | |
[service executeQuery:query completionHandler:^(GTLServiceTicket* ticket, | |
GTLGraderecorderStudentCollection* studentCollection, | |
NSError* error){ | |
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; |
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
import os | |
from google.appengine.ext import ndb | |
import jinja2 | |
from models import MovieQuote | |
import webapp2 | |
jinja_env = jinja2.Environment( | |
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), |
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
body { | |
background: url('/static/images/noise.jpg'); | |
font: 14px Helvetica, serif; | |
} | |
input[name=quote] { | |
width: 300px; | |
} | |
input[name=movie] { |
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
import os | |
import jinja2 | |
import webapp2 | |
# Jinja Environment instance necessary to use Jinja templates. | |
jinja_env = jinja2.Environment( | |
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), | |
autoescape=True) |
OlderNewer