Note: You should consider when to use ancestor/key design with care. You'll get a limit of 1 write/sec for each entity group.
First, map your entity endpoints:
@Endpoint(path = "/users")
public class User {
@Id
IdRef<User> id;
module MacrosBase | |
def self.included(base) | |
base.extend(GroupMethods) | |
end | |
module GroupMethods | |
def mock(model_name) | |
class_eval <<-EOFMOCK | |
def mock_#{model_name}(stubs={}) | |
(@mock_#{model_name} ||= mock_model(#{model_name.to_s.classify}).as_null_object).tap do |#{model_name}| |
module ControllerMacros | |
def self.included(base) | |
base.extend(GroupMethods) | |
end | |
def mock_access(user = mock_model(User)) | |
controller.stub('require_user').and_return(true) | |
controller.stub('current_user').and_return(user) | |
end |
require 'spec_helper' | |
describe CustomersController do | |
before(:each) do | |
mock_filter(:require_user_owner) | |
end | |
# GET /customers | |
get :index do |
require 'spec_helper' | |
describe LineItemsController do | |
mock :order | |
mock :customer | |
# GET /orders/11/line_items | |
get :index, :order_id => 11 do | |
default :stub => :off |
http://rubyonrails.org/ | |
http://guides.rubyonrails.org/ | |
http://pragprog.com/book/rails4/agile-web-development-with-rails (excelente livro) | |
http://www.slideshare.net/dextra/minicurso-ruby-on-rails-dextra (palestra introdutória) |
// See qunit-pages: https://github.com/murer/qunit-page | |
function login(page, user) { | |
page.step('login', function() { | |
page.stop(); | |
$.get("/_ah/logout?continue=/blank.html", function(data) { | |
console.info("logout"); | |
$.post('/_ah/login?continue=/blank.html', { | |
'email' : user + '@wavez', | |
'continue' : '/blank.html', | |
'action' : 'Log In' |
from google.appengine.ext import ndb | |
from google.appengine.api import datastore | |
from google.appengine.api import datastore_types | |
from google.appengine.api import datastore_errors | |
from functools import partial | |
# import yawp from yawp | |
# yawp('/people').query().fetch() | |
# http://stackoverflow.com/questions/10709893/ndb-expando-model-with-dynamic-textproperty | |
# http://stackoverflow.com/questions/19842671/migrating-data-when-changing-an-ndb-fields-property-type/19848970#19848970 |
Note: You should consider when to use ancestor/key design with care. You'll get a limit of 1 write/sec for each entity group.
First, map your entity endpoints:
@Endpoint(path = "/users")
public class User {
@Id
IdRef<User> id;
module(maps, function() { | |
function AreaMap(selector, lat, lng, radius) { | |
var WINKEE_SQUARE = new google.maps.LatLng(-22.865964, -47.054778); | |
var center = WINKEE_SQUARE; | |
if (lat) { | |
center = new google.maps.LatLng(lat, lng); | |
} |