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
#!/usr/bin/env node | |
var JSON = require('JSON'); | |
var fs = require('fs'); | |
var argv = require('yargs').argv; | |
var isObject = function(v) { return v && (typeof v==='object') && !('length' in v); }; | |
var isArray = function(v) { return v && (typeof v==='object') && ('length' in v); }; | |
var isPrimitive = function(v) { var res=(typeof v in {'boolean':true,'number':true,'string':true,'undefined':true}) || (v===null); return res;}; | |
var keys = function(v) {keys=[]; for(var key in v){keys.push(key)} return keys}; |
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
#Based on https://github.com/ericholscher/django-test-utils/blob/master/test_utils/management/commands/makefixture.py | |
#v0.1 -- current version | |
#known issues: | |
#no support for generic relations | |
#no support for one-to-one relations | |
from optparse import make_option | |
from django.core import serializers | |
from django.core.management.base import BaseCommand | |
from django.core.management.base import CommandError |
NewerOlder