Created
November 14, 2012 21:44
-
-
Save mauler/4075039 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(function(){ | |
var Model = {} | |
Model.make = function(model_name) { | |
var model = {} | |
model.getByID = function(id, fn) { | |
JSONP.getByID(model_name, id, fn); | |
} | |
model.list = function(params, fn){ | |
// NOTE: brasiltotal | |
params.exclude__codigonoticia__exact = ''; | |
params.exclude__codigonoticia__isnull= true; | |
if (params.destino != null) | |
{ | |
params.destino__nome = params.destino; | |
params.destino = null; | |
} | |
JSONP.list(model_name, params, fn) | |
} | |
return model; | |
} | |
window.Hotel = Model.make("hotel"); | |
window.Passeio = Model.make("passeio"); | |
window.Pacote = Model.make("pacote"); | |
window.Ingresso = Model.make("ingresso"); | |
window.Restaurante = Model.make("restaurante"); | |
window.Transfer = Model.make("transfer"); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment