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
{ | |
"_id" : ObjectId("56dddbda8a09bc202b05fb47"), | |
"FIELD1" : "ASINC0000710793", | |
"HPD_SUBMITTER" : "blah", | |
"person_id" : "PPL000000021124", | |
"Resolved_date" : "2014-04-17 05:07:19.000", | |
"owner_group" : "Service Desk - Incident Management Team", | |
"submitter" : "blah", | |
"submit_date" : "2014-04-17 05:07:32.000", | |
"reported_date" : "2014-04-17 05:06:06.000", |
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
if (Meteor.isClient) { | |
Template.chart.rendered = function () { | |
var yelp_data, ndx; | |
var template = this; | |
console.log('autorun is called'); | |
template.subscribe("yelp", function(){ | |
}); |
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
app.post('/salesforce_update', function(req, res){ | |
console.log('Salesforce DC update Request Received'); | |
console.log('request body: ' + req.body); | |
MongoClient.connect(url, function (err, db) { | |
if (err) { | |
console.log('Unable to connect to the mongoDB server. Error:', err); | |
} else { |
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
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div style="position: absolute; top: 5px;left:5px; height: 50px;width: 793px; background-color: #3c2a59;color: #efefef">Header</div> | |
<div style="position: absolute; top: 60px;left: 5px; height: 140px;width: 150px; background-color: #efefef"></div> | |
<div style="position: absolute; top: 210px;left: 5px; height: 40px;width: 150px; background-color: #3c2a59;color: #efefef"></div> |
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
'use strict'; | |
/** | |
* Module dependencies. | |
*/ | |
var fs = require('fs'), | |
http = require('http'), | |
https = require('https'), | |
express = require('express'), | |
morgan = require('morgan'), |
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
'use strict'; | |
/** | |
* Module dependencies. | |
*/ | |
var fs = require('fs'), | |
http = require('http'), | |
https = require('https'), | |
express = require('express'), | |
morgan = require('morgan'), |
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
module.exports = function(grunt) { | |
// Unified Watch Object | |
var watchFiles = { | |
serverViews: ['app/views/**/*.*'], | |
serverJS: ['gruntfile.js', 'server.js', 'config/**/*.js', 'app/**/*.js'], | |
clientViews: ['public/modules/**/views/**/*.html'], | |
clientJS: ['public/js/*.js', 'public/modules/**/*.js'], | |
clientCSS: ['public/modules/**/*.css'], | |
mochaTests: ['app/tests/**/*.js'] | |
}; |
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
I have the following two models: Blueprint and Workload. | |
The Blueprint model instance should have a collection of Workloads associated with it. | |
Initially, bot the Blueprint and Workload instances should be allowed to be created independently. | |
A complete typical scenario as follows: | |
1) a new Blueprint instance is created | |
2) a new Workload instance is created | |
3) the created Workload instance is added to the Blueprint's 'workloads' collection | |
The python REPL version is this: |
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
models: | |
class Blueprint(models.Model): | |
id = models.AutoField(primary_key=True) | |
name = models.CharField(max_length=120) | |
description = models.TextField() | |
# workloads = models.ManyToManyField('Workload', db_constraint=False) | |
# workloads = models.ManyToManyField('self', null=True) | |
class Meta: |
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
resources: | |
class BlueprintResource(ModelResource): | |
# workloads = ManyToManyField(Workload, 'workloads') | |
workloads = fields.ManyToManyField('catalog.api.WorkloadResource', attribute='workloads', | |
full=True, null=True) | |
def obj_create(self, bundle, request=None, **kwargs): | |
return super(BlueprintResource, self).obj_create(bundle, request) |
NewerOlder